(My English is bad) Hi Techies,
I am trying to get Mailbox statistics using Remote PowerShell with cmd executed as an Administrator.
powershell -command "$session=New-PSSession -ComputerName 'EX2' -Credential $cred; invoke-command -Session $session -ScriptBlock { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; dir env:}"
this command is ok,
but I change the command to Get-MailboxDatabase
powershell -command "$session=New-PSSession -ComputerName 'EX2' -Credential $cred; invoke-command -Session $session -ScriptBlock { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; Get-MailboxDatabase -Status}"
I get an ADInvalidCredentialException
: