invoke-command

#SSL

$pw = ConvertTo-SecureString 'Password1' -AsPlainText -Force

$ac = New-Object System.Management.Automation.PSCredential ('accountname',$pw)

$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck Invoke-Command -cn server1 -Credential

$ac -port 5986 -UseSSL -SessionOption $so -ScriptBlock {whoami}

Last updated