OO 9.7 Running Powershell Script on Remote Server
Can anyone provide examples of how to run a powershell script using the "Remote Execution Command" or the "Powershell Script"?
Error when using Remote Execution Command: Error occured while executing command. Process Return Code: '123'
Error when using PowerShell Script Operation: Could not execute powershell command.At line:1 char:1 ystem.Management.Automation.RemoteException: AuthorizationManager check failed.
When it comes to powershell there are some concerns regarding remote script execution:
- powershell must be enabled for remote script executions on both the OO server and the target server, before running the scripts. The commands to set up this can be found on the description of the powershell folder.:
1. Run the followings PowerShell commands on target machine (server/remote host):
Set-Item WSMan:\localhost\Service\TrustedHosts -Value <source_machine_IP>
Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value true
Set-Item WSMan:\localhost\Service\Auth\<authMethod> -Value true
2. Then run the followings PowerShell commands on source machine (Studio/Central/RAS):
Set-Item WSMan:\localhost\Client\TrustedHosts -Value <target_machine_IP>
Set-Item WSMan:\localhost\Client\AllowUnencrypted -Value true
Set-Item WSMan:\localhost\Client\Auth\<authMethod> -Value true
- the central/ras service must be run as an elevated privilege user (basically a domain user that is part of the administrators group). By default OO runs under the local system acount, which is not allowed to execute remote powershell commands.
- Some commands and scripts are not allowed by powershell to be run remotely, if ytou are encountering such a scenario there is nothing OO can do about it.
Hope this helps,