right now I am having an issue with Exchange server 2007. The get-mailbox | FL query is working fine when I am executing the same on power shell of Exchange server after executing Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin.
I have executed the same on remote machine by using powershell console.
Code:
$server='192.168.1.23';$pwd= convertto-securestring '123' -asplaintext -force;$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'exchangeserver\Administrator',$pwd; invoke-command -computername $server -credential $cred -scriptblock {Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin get-mailbox | FL}
However I am getting below mentioned error message.
‘The term 'Get-mailboxdatabase' is not recognised as the name of a cmdlet, function, script file or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.’
When I tried to execute on remote machine again then again I got an error message and it can be stated as follow.
‘A positional parameter cannot be found that accepts argument 'get-mailbox'.
+CategoryInfo :InvalidArgument: {:} [Add-PSSnapin], ParameterBIndingException
+FullyQualifiedErrorId: PositionalParameterNotFound,Microsoft.Powershell.Commands.AddPSSnapinCommand’
Can you tell me why I am not able to execute above mentioned query? Any help will be highly appreciated. Thanks a lot in advance.
Bookmarks