Invoke command with IP address as Target server does not works at all

Posted by Praveen on Server Fault See other posts from Server Fault or by Praveen
Published on 2013-10-11T08:36:47Z Indexed on 2013/11/12 9:59 UTC
Read the original article Hit count: 277

Filed under:

Please see the following command and with Trusted Hosts enabled, this does not work:

Invoke-Command -ComputerName <IP address> -port 5985 -Credential (New-Object System.Management.Automation.PSCredential ('Domain\User', (ConvertTo-SecureString 'passwd' -AsPlainText -Force))) -Authentication CredSSP -ScriptBlock {Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010;Get-Mailbox}

This works well when Computername is a hostname. The IP address does not works at all

© Server Fault or respective owner

Related posts about powershell