Creating a OcsPowerShell PSSession under a different set of credential

I have recently been asked multiple times how to create a PowerShell session to OcsPowerShell. This is quite easy to do, just remember: Use a secure string for the password: $secure_string_pwd = convertto-securestring “password” -asplaintext -force Create and import the session: $session = New-PSSession -ConnectionUri “https://domain/OcsPowerShell” -Credential $cred  A complete sample code can be found…

0