Invoke command with IP address as Target server does not works at all
- by Praveen
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