author: Paweł Jawień; applies to version: 8.2 (available: 2015 Midyear)
With version 8.2 of WEBCON BPS, new action is availalble – Execute PowerShell Script action
Such action may execute any windows powershell command and after activation of certain Powershell addins (Exchange, Lync, Azure, Sharepoint), every system operation possible to be performed using PowerShell, may be executed by PowerShell action.
Examples of available operations:
– Creating new catalogues on disk
– Creating new inbox on Exchange server
– Lync account activation
– Creating user account in Office 365
– Creating new sharepoint sites
How to prepare environment
For action to work correctly, it is necessary to prepare server on which powershell scripts will be executed.
Neccesary server operations:
- Enable-PSRemoting –force – configures computer as receiver of powershell commands, sent using WF-Management technology. Details: https://technet.microsoft.com/en-us/library/hh849694.aspx
- Enable-WSManCredSSP –Role Server – turns on authentication of: Credential Security Support Provider (CredSSP). Details: https://technet.microsoft.com/en-us/library/hh849872.aspx
- Set-PSSessionConfiguration –Name Microsoft.PowerShell32 –showSecurityDescriptorUI – Changes session configuration on local computer. Details: https://technet.microsoft.com/en-us/library/hh849726.aspx
– Lync Powershell install: https://www.microsoft.com/en-us/download/details.aspx?id=39366
– O365 Powershell install: https://www.microsoft.com/en-us/download/confirmation.aspx?id=39366
– Azure AD: http://go.microsoft.com/fwlink/p/?linkid=236297
Action activity context – permissions
PowerShell action needs certain permissions for correct work. Two configurations are available:
- If there is no dedicated login and password, then action works in context of WEBCON BPS Service user
- If user data is configured, then action works in context and with permissions of provided user
Note! Concerning security issues, option 1 is not recommended!
Powershell action is configurable in the same way as other actions available in WEBCON BPS.
In “Actions” tab add new action and in “Action kind” field choose “Execute PowerShell script”. Afterwards go to detailed action configuration by clicking “Configure” button in lower right corner.
In “Credentials” section provide login and password of user in context of which powershell actions are going to be performed. Leaving these fields empty causes action to be performed in context of WEBCON BPS Service user. Login and password may be forwarded to Powershell script using following variables:
Example of usage:
$cred=New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
In “Templates” section, few predefined scripts (examples), allowing for example to Create Exchange account of already existing Active Directory user.
“PowerShell script” section allows to enter script which will be executed by action. Script may use tags from choice tree.
Test button allows to check if provided script works properly.
Note! Script is actually performed in the system!