Configuring the PowerShell adapter


The PowerShell actor adapter supports empty and multiple configurations. The PowerShell adapter considers the target as localhost and executes the command on the command line under the following conditions:

  • The adapter has an empty configuration, and the dynamic target is not defined
  • You do not define a dynamic target, and the configuration has a blank target or no target
  • You define a dynamic target and do not specify the host name

Adapter type: bmc-adapter-microsoft-windows-powershell-actor_vv.rr.nn

Default name: MicrosoftPowerShell

To configure the PowerShell adapter, see Configuring base adapters.

BMC recommends that you do not use empty elements in an adapter configuration because they might cause errors.

Prerequisites for the PowerShell adapter remoting feature:

The following table describes the adapter configuration elements for the PowerShell adapter that you can specify by using the form view, XML view, or both. You cannot use the form view to configure elements and attributes that do not have an entry in the "UI label" column.

 Configuration node elements for the PowerShell adapter

 

The following figure shows an XML sample for the PowerShell adapter configuration.

XML sample of the PowerShell adapter configuration

<config>
     <target>host1</target>
     <user-name>user1</user-name>
     <password encryption-type="Plain">pass1</password>
     <powershell-version>2.0</powershell-version>
     <use-userprofile>true</use-userprofile>
     <script-file-path>local</script-file-path>
     <character-set>gb18030</character-set>
     <logon-with-user-credentials>true</logon-with-user-credentials>
</config>

The following figure shows an XML sample for a PowerShell adapter configuration with the <powershell-consolefile> tag.

XML sample of the PowerShell adapter configuration with <powershell-consolefile> tag

<config>
 <target>host1</target>
 <user-name>user1</user-name>
 <password encryption-type="Plain">pass1</password>
 <powershell-consolefile>
    Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Console.psc1
 </powershell-consolefile>
</config>

The following figure shows an XML sample for the PowerShell adapter configuration when the remoting feature is enabled.

XML sample of the PowerShell adapter configuration when the remoting feature is enabled

<config>
 <target>10.128.249.29</target>
 <user-name>bmcadmin</user-name>
 <password encryption-type="Plain">asdfgh@123</password>
 <powershell-version>2.0</powershell-version>
 <use-userprofile>false</use-userprofile>
 <script-file-path>local</script-file-path>
 <enable-psremoting>true</enable-psremoting>
</config> 

The following figure shows an XML sample for the PowerShell adapter configuration when the <impersonate-user> element is set to true.

XML sample for the PowerShell adapter configuration when the Impersonate User is set to true.

<config>
       <target>vm-yyy-w2k</target>
       <user-name>domain.local\domainuser1</user-name>
       <password>password</password>
       <protocol>default</protocol>
   <service-launch-mode>64bit</service-launch-mode>
   <logon-with-user-credentials>true</logon-with-user-credentials>
   <impersonate-user>true</impersonate-user>
</config>

The following figure shows an XML sample for the PowerShell adapter configuration when the <service-launch-mode> is 64-bit.

XML sample for the PowerShell adapter configuration when the <service-launch-mode> is 64-bit

<config>
       <target>vm-yyy-w2k</target>
       <user-name>domain.local\domainuser1</user-name>
       <password>password</password>
       <protocol>default</protocol>
   <service-launch-mode>64bit</service-launch-mode>
   <logon-with-user-credentials>true</logon-with-user-credentials>
   <impersonate-user>false</impersonate-user>
</config>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*