PowerShell action

Facebooktwittergoogle_pluspinterestlinkedinmail

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:

  1. 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
  2. Enable-WSManCredSSP –Role Server – turns on authentication of: Credential Security Support Provider (CredSSP). Details: https://technet.microsoft.com/en-us/library/hh849872.aspx
  3. Set-PSSessionConfiguration –Name Microsoft.PowerShell32 –showSecurityDescriptorUI – Changes session configuration on local computer. Details: https://technet.microsoft.com/en-us/library/hh849726.aspx

 

Installation:

–          Cloud Login: https://www.microsoft.com/en-us/download/confirmation.aspx?id=39366

–          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:

  1. If there is no dedicated login and password, then action works in context of WEBCON BPS Service user
  2. If user data is configured, then action works in context and with permissions of provided user

1

Note! Concerning security issues, option 1 is not recommended!

 

Action configuration

Powershell action is configurable in the same way as other actions available in WEBCON BPS.

2

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:

$username

$password

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.

3

Test button allows to check if provided script works properly.

Note! Script is actually performed in the system!

One thought to “PowerShell action”

  1. Hi there,

    I got the following error for simple powershell “On exit” call:

    “test” > C:\temp\test.txt

    Error:
    Es ist ein Fehler aufgetreten: Error during asynchronous call.
    – Operation was withdrawed.
    – Error in On leave action New action
    – The caller was not authenticated by the service.
    – The request for security token could not be satisfied because authentication failed.
    – Mehr Einzelheiten [+]

Leave a Reply

Your email address will not be published. Required fields are marked *