码迷,mamicode.com
首页 > 其他好文 > 详细

Exchange刷新已禁用邮箱状态

时间:2018-04-16 18:31:14      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:Exchange刷新已禁用邮箱状态

刷新已禁用用户邮箱状态

Get-MailboxStatistics -Database MXDB-NanQu | foreach {Update-StoreMailboxState -Database $_.Database -Identity $_.MailboxGuid -Confirm:$False}

Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -eq "test" } | select -Property *
Update-StoreMailboxState -Database  MB-FSLubao03 -Identity   0548a52c-6147-4f87-aea1-b42ac3029925

当用户邮箱被禁用后,需要过一段时间该用户邮箱才会出现在“已断开连接”的邮箱中,默认EX最长刷新周期为24小时,通过下面命令可以强制刷新该用户邮箱状态,之后就可以在EXchange管理页面重新链接该邮箱。

复制代码

$displayname = "小明"
$w=get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -eq $displayname }
$w.database
$w.MailboxGuid

#先确认是否有重名

Update-StoreMailboxState -Database $w.database -Identity $w.MailboxGuid
get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -eq $displayname }|select disconnectdate,disconnectreason

复制代码

#下面命令刷新该邮箱数据库中所有用户邮箱状态

Get-MailboxStatistics -Database MXDB-NanQu | foreach {Update-StoreMailboxState -Database $_.Database -Identity $_.MailboxGuid -Confirm:$False}

#当用户邮箱已被禁用,其disconnectreason为空,可以直接链接邮箱(未测试)

Get-MailboxDatabase -Identity "Databasename" | Get-MailboxStatistics | Where { $_.Displayname -eq "Display Name" } | Connect-Mailbox -User "Userid"

==============================================================

本示例将连接链接的邮箱。Identity 参数指定 Exchange 数据库中断开连接的邮箱。 LinkedMasterAccount 参数指定帐户林中要将邮箱重新连接到的 Active Directory 用户帐户。 Alias 参数指定重新连接的邮箱的别名;别名是电子邮件地址中 @ 符号左侧的部分。

Connect-Mailbox -Identity "Kai Axford" -Database MBXDB02 -LinkedDomainController FabrikamDC01 -LinkedMasterAccount kai.axford@fabrikam.com -Alias kaia

此示例将连接用户邮箱。Identity 参数指定 Exchange 数据库中断开连接的邮箱。 User 参数指定要将邮箱重新连接到的 Active Directory 用户帐户。

Connect-Mailbox -Identity "Jeffrey Zeng" -Database MBXDB01 -User "Jeffrey Zeng"

Exchange刷新已禁用邮箱状态

标签:Exchange刷新已禁用邮箱状态

原文地址:http://blog.51cto.com/3032439/2104008

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!