Exchange服务器监视问题 [英] Problem with Exchange server monitoring
问题描述
大家好,
我的Exchange Server 2007有问题.我试图执行以下查询 get-mailbox | FL .在执行以下查询 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin 后,当我在Exchange服务器的Power Shell控制台中尝试该查询时,该查询就起作用了.
但是我需要从远程计算机执行它,所以我已经从我的powershell控制台执行了它,如下所示...
$ server =''192.168.1.23''; $ pwd = convertto-securestring``123''-asplaintext -force; $ cred = new-object -typename System.Management.Automation.PSCredential -argumentlist''exchangeserver \ Administrator'',$ pwd;调用命令-计算机名$服务器-凭据$ cred -scriptblock {添加PSSnapin Microsoft.Exchange.Management.PowerShell.Admin get-mail | FL}
但是,此查询失败,并出现以下错误...
Hello All,
I have a problem with Exchange server 2007. I was trying to execute the following query get-mailbox | FL. This query was working when I tried it in the Exchange server''s power shell console after executing following query Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin.
But I need it to be executed from a remote machine, so I have executed it from my powershell console , as follows...
$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}
But, this query fails with the following error...
A positional parameter cannot be found that accepts argument ''get-mailbox''.
+CategoryInfo :InvalidArgument: {:} [Add-PSSnapin], ParameterBIndingException
+FullyQualifiedErrorId: PositionalParameterNotFound,Microsoft.Powershell.Commands.AddPSSnapinCommand
我再次修改了此查询,并在 snapin add 部分之后添加了 ; .
$ 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-计算机名$ server -credential $ cred -scriptblock {Add-PSSnapin Microsoft.Exchange.Management.PowerShell. Admin; FL}
这也失败,并显示以下错误.
I have modified this query again and added a ; after the snapin add section.
$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}
This is also fails with the following error.
Active Directory server exchangeserver.xxxxxx.local is not available. Error message: The supplied credential is invalid.
+ CategoryInfo : NotSpecified: <0:int32> [Get-MailBox],ADOperationException
+ FullyQualifiedErrorId : A2B6F75B,Microsoft.Exchange.Management.RecipientTasks.GetMailbox
然后,我从命令中删除了 add-snap-in 部分并再次执行.
$ server =''192.168.1.23''; $ pwd =转换为安全字符串``123''-asplaintext -force; $ cred = new-object -typename System.Management.Automation.PSCredential -argumentlist''exchangeserver \ Administrator'',$ pwd; invoke-command-计算机名$ server -credential $ cred -scriptblock {获取邮箱| FL}
现在,它会引发另一个错误消息.
Then I have removed the add-snap-in section from the command and executed again.
$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 {get-mailbox | FL}
Now it throws another error message.
The term ''get-mailbox'' 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 corerct and try again.
+ CategoryInfo : ObjectNotFound: <get-mailbox:String> [],CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
有人可以帮我吗?
在此先感谢
Can someone help me on this?
Thanks in advance
推荐答案
server =''192.168.1.23'';
server=''192.168.1.23'';
pwd = convertto-securestring``123' '-asplaintext -force;
pwd= convertto-securestring ''123'' -asplaintext -force;
cred = new-object -typename System.Management.Automation.PSCredential-参数列表``exchangeserver \ Administrator'',
cred=new-object -typename System.Management.Automation.PSCredential -argumentlist ''exchangeserver\Administrator'',
这篇关于Exchange服务器监视问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!