Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface 由于对象的当前状态,Powershell GUI脚本操作无效_User Interface_Powershell_Exchange Server - Fatal编程技术网

User interface 由于对象的当前状态,Powershell GUI脚本操作无效

User interface 由于对象的当前状态,Powershell GUI脚本操作无效,user-interface,powershell,exchange-server,User Interface,Powershell,Exchange Server,我有一个PowerShell GUI脚本,它基于所选邮箱显示与所选邮箱关联的文件夹统计信息 这是我的代码: $buttonFolderStatistics_Click={ if ($combobox1.SelectedIndex -gt -1) { $MailboxName = $combobox1.SelectedItem $textbox1.Text = (Get-Mailbox -Identity $MailboxName.Split('()')[1]) | Out-S

我有一个PowerShell GUI脚本,它基于所选邮箱显示与所选邮箱关联的文件夹统计信息

这是我的代码:

$buttonFolderStatistics_Click={
if ($combobox1.SelectedIndex -gt -1)
{

    $MailboxName = $combobox1.SelectedItem

    $textbox1.Text = (Get-Mailbox -Identity $MailboxName.Split('()')[1]) | Out-String
    $textbox1.Text = (Get-MailboxFolderStatistics -Identity $MailboxName.Split('()')[1]) | Out-String
}

这部分很好:

$textbox1.Text = (Get-Mailbox -Identity $MailboxName.Split('()')[1]) | Out-String
这一部分:

$textbox1.Text = (Get-MailboxFolderStatistics -Identity $MailboxName.Split('()')[1]) | Out-String
这是我收到的错误消息:get-MailboxFolderStatistics:由于对象的当前状态,操作无效

知道为什么会这样吗


谢谢

$MailboxName
的值是什么,即组合框中有什么?尝试将
-AllowClobber
添加到您的
Connect-ExchangeServer
命令中,看看这是否解决了问题。@Mathias组合框的内容是一个遵循以下结构的邮箱列表:邮箱名称(别名),如Luis Patel(lu.pat)@MadTechnician我没有使用任何Connect ExchnageServer命令,我只是在Microsoft.Exchange.Management.PowerShell.E2010中使用此add pssnapin-ea SILENTLYCONTINU我相当确定这是因为某些信息与Active Directory同步,但不是所有的细节。如果您只需要一些基本的邮箱信息,它可以从广告中获取。更详细的信息必须来自Exchange本身。
$MailboxName
,,例如,组合框中有什么?请尝试将
-AllowClobber
添加到
连接Exchange服务器
命令中,看看这是否解决了问题。@Mathias组合框的内容是一个如下结构的邮箱列表:邮箱名称(别名),如Luis Patel(lu.pat)@MadTechnician我没有使用任何Connect ExchnageServer命令,我只是在Microsoft.Exchange.Management.PowerShell.E2010中使用此add pssnapin-ea SILENTLYCONTINU我相当确定这是因为某些信息与Active Directory同步,但不是所有的细节。如果您只需要一些基本的邮箱信息,它可以从广告中获得。更详细的信息必须来自Exchange本身。