Shunze ¾Ç¶é >¹q¸£¸ê°T¾Ç¨t >Exchange 2010 > ¡m¤À¨É¡nµLªk¦b²¾°Ê«á²M²z¨Ó·½«H½c «¢Åo¡AÁÙ¨S¦³µù¥U©ÎªÌµn¤J¡C½Ð§A[µù¥U|µn¤J]
« ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD » Åã¥Ü¦¨¦C¦L¼Ò¦¡ | ¼W¥[¨ì§Úªº³Ì·R
µoªí·s¥DÃD µoªí¦^ÂÐ
§@ªÌ
¥DÃD
shunze
¤u¤Í§B§B


µù¥U¤é´Á: 2002 04
¨Ó¦Û: ¼é¦Á²×¤î¤§¦a
¤å³¹: 2380

shunze Â÷½u
¡m¤À¨É¡nµLªk¦b²¾°Ê«á²M²z¨Ó·½«H½c¤Þ¥Î¦^ÂÐ ½s¿è/§R°£¤å³¹ ·j´M¥Ñ  µoªíªº¨ä¥L¤å³¹ ¦^³øµ¹ª©¥D IP ¦ì¸m ¦^¦¹­¶³Ì¤W¤è

¦P¤¯«H½c¦b²¾°Ê¨ì·sªºMAILBOXDATABASE«á¡A
¥X²{ĵ§i°T®§¡A¨Ó·½«H½cµLªk§R°£¡H



¿ù»~°T®§¦p¤U¡G
ĵ§i: µLªk¦b²¾°Ê«á²M²z¨Ó·½«H½c.
¿ù»~¸Ô²Ó¸ê®Æ: MapiExceptionUnexpectedMailboxState: Unable to delete mailbox. (hr=0x80004005, ec=2634)



¦bºô¸ô¤W§ä¨ì¤F¥H¤U°µªk¡A¦¨¥\ªº§â¨Ó·½«H½c§R°£¤F¡ã

²Ä¤@¨B¡A¨ú±o¨Ï¥ÎªÌMAILBOXGUID

Get-MailboxStatistics -Database <MAILBOXDATABASE> | Where { $_.DisconnectReason -eq "SoftDeleted" } | Format-List LegacyDN, DisplayName, MailboxGUID, DisconnectReason

¨ä¤¤ <MAILBOXDATABASE> ¬°«H½c¸ê®Æ®w¦WºÙ¡A¥i¥ÎÂù¤Þ¸¹®Ø°_¨Ó¡C
°õ¦æ«á¡A·|¦C¥X°ÝÃD¨Ï¥ÎªÌ«H½cªº MAILBOXGUID¡C

²Ä¤G¨B¡A§Q¥Î MAILBOXGUID ¨Ó§R°£¨Ï¥ÎªÌ¨Ó·½¨Ó·½
Remove-StoreMailbox -Database <MAILBOXDATABASE> -Identity MAILBOXGUID -MailboxState Softdeleted

¨ä¤¤ MAILBOXGUID ¬°²Ä¤@¨B©Ò§ä¨ìªº MAILBOXGUID¡C
¿é¤J«á·|¥X²{¬O§_­n§R°£ªº¸ß°Ý¹ï¸Ü®Ø¡A«ö Y ´N¹ï°Õ¡ã



♥¶¶¤l¦Ñ±Cªººô©ç¡A½Ð¦hÃö·Ó¡ã

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!




2013-09-12, 17:18 shunze ªº­Ó¤H¸ê®Æ §â shunze ¥[¤J¦n¤Í¦Cªí µo°eEmailµ¹ shunze ÂsÄý shunze ªººô¯¸ MSN : shunze@gmail.com
shunze
¤u¤Í§B§B


µù¥U¤é´Á: 2002 04
¨Ó¦Û: ¼é¦Á²×¤î¤§¦a
¤å³¹: 2380

shunze Â÷½u
³z¹LPowerShell²M°£¨Ó·½«H½c¤Þ¥Î¦^ÂÐ ½s¿è/§R°£¤å³¹ ·j´M¥Ñ  µoªíªº¨ä¥L¤å³¹ ¦^³øµ¹ª©¥D IP ¦ì¸m ¦^¦¹­¶³Ì¤W¤è

³Ìªñ¦b¬ã¨sPowerShell¡Aµo²{¥¦ÁÙº¡¦nª±ªº¡C
³z¹LPowerShell¨Ó²M°£¾ã­ÓExchange ServerùØ¡A«H½c²¾°Ê«áªº´Ý¯d¨Ó·½«H½cscript¦p¤U¡C

$MailDatabases = Get-MailboxDatabase
foreach ($MailDatabase in $MailDatabases)
{
    $DatabaseName = $MailDatabase.Name
    $Mailboxs = Get-MailboxStatistics -Database "$DatabaseName" | Where { $_.DisconnectReason -eq "SoftDeleted" }
    foreach ($Mailbox in $Mailboxs)
    {
        $MailboxGUID = $Mailbox.MailboxGUID
        $UserName = $Mailbox.DisplayName
        if ($MailboxGUID) {
            Write-Host "User:$UserName, Database:$DatabaseName, MailboxGUID:$MailboxGUID"
            Remove-StoreMailbox -Database "$DatabaseName" -Identity "$MailboxGUID" -MailboxState Softdeleted -Confirm
        }
    }
}

«ü¥O½X²³æ»¡©ú¦p¤U
  • Get-MailboxDatabase ¨ú±oExchange Database¶°¦X¡C
  • DisconnectReason -eq "SoftDeleted" ¥HSoftDeleted¬°±ø¥ó¡A¨ú±o¨Ï¥ÎªÌMailBox¶°¦X
  • ÂÇ¥ÑMailBoxGUIDªº­È¨Ó§PÂ_MailBoxª«¥ó¬O§_¦³®Ä¡A¦A¶i¤@¨B³z¹L¤W«ü¥O¨Ó§R°£¸ÓMailBox¡C



♥¶¶¤l¦Ñ±Cªººô©ç¡A½Ð¦hÃö·Ó¡ã

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!




2014-02-03, 20:31 shunze ªº­Ó¤H¸ê®Æ §â shunze ¥[¤J¦n¤Í¦Cªí µo°eEmailµ¹ shunze ÂsÄý shunze ªººô¯¸ MSN : shunze@gmail.com
  « ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD »
µoªí·s¥DÃD µoªí¦^ÂÐ
¸õ¨ì:

Powered by: Burning Board 1.1.1 2001 WoltLab GbR