$server='WIN-XXX';$pwd= convertto-securestring 'abc123' -asplaintext -force;$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'WIN-XXX\Administrator',$pwd; invoke-command -computername $server -credential $cred -scriptblock {Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; get-mailbox XXX}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)