Regular Contributor.. mtthwcruz Regular Contributor..
Regular Contributor..
689 views

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.

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

Re: OO 9.7 Running Powershell Script on Remote Server

Hi,

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):
Enable-PSRemonting
Set-ExecutionPolicy RemoteSigned
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):
Enable-PSRemonting
Set-ExecutionPolicy RemoteSigned
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,

Vlad

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.