Tirasa developed a new ConnID connector called ConnIDCMDBundle. This bundle is used to connect to Apache Syncope the resources that are managed by Bash or Powershell scripts. In this post I will explain how use it to execute the adamsync.ps1 in a remote contest.
Tirasa developed a new ConnID connector called ConnIDCMDBundle. This bundle is used to connect to Apache Syncope the resources that are managed by Bash or Powershell scripts.
In this post I will explain how use it to execute the adamsync.ps1 in a remote contest. Our use case is to execute a script on bridge server that called another script (real adamsync script) on a remote ADAM server.
To create a remote Powershell script we need a credential of remote server, so we have to create the encrypt file containing the password of remote administrator user.
read-host -assecurestring | convertfrom-securestring | out-file C:\securestring.txt
Now we are able to create a remote Powershell script:
$username = "TIRASA\Administrator"
$password = cat c:\ConnectorServer\scripts\credential.txt | convertto-securestring
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
Invoke-Command -ComputerName frassino -ScriptBlock { c:\script\adamsync.ps1 } -Credential $cred
This script execute a remote Powershell script adamsync.ps1 (this is only an example of script name) on ADAM server called frassino.
Latest step is to configure a new Connector in Apache Syncope (CMD) to execute previuos script; it's done deal, isn't it?