Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Effect of PowerShell to Remove Exchange Attributes

$
0
0

If you use a PowerShell Script like the one below, shouldn't the mailbox show up in the Exchange 2010 console under disconnected mailboxes?

Remove Exchange Attributes
----------------------------

Remove Exchange 2010 Attributes for a Corrupted Active Directory Account

Caution : Mailbox Will Go Disconnected and Exchange Attributes will be Removed" -ForeGround "Cyan"


$EnterUser = Read-Host "Enter Alias"

$ADaccount = Get-User "$EnterUser"

$FullDistinguishName = "LDAP://" + $ADaccount.distinguishedName

$AccountEntry = New-Object DirectoryServices.DirectoryEntry $FullDistinguishName

$AccountEntry.PutEx(1, "mail", $null)
$AccountEntry.PutEx(1, "HomeMDB", $null)
$AccountEntry.PutEx(1, "HomeMTA", $null)
$AccountEntry.PutEx(1, "legacyExchangeDN", $null)
$AccountEntry.PutEx(1, "msExchMailboxAuditEnable", $null)
$AccountEntry.PutEx(1, "msExchAddressBookFlags", $null)
$AccountEntry.PutEx(1, "msExchArchiveQuota", $null)
$AccountEntry.PutEx(1, "msExchArchiveWarnQuota", $null)
$AccountEntry.PutEx(1, "msExchBypassAudit", $null)
$AccountEntry.PutEx(1, "msExchDumpsterQuota", $null)
$AccountEntry.PutEx(1, "msExchDumpsterWarningQuota", $null)
$AccountEntry.PutEx(1, "msExchHomeServerName", $null)
$AccountEntry.PutEx(1, "msExchMailboxAuditEnable", $null)
$AccountEntry.PutEx(1, "msExchMailboxAuditLogAgeLimit", $null)
$AccountEntry.PutEx(1, "msExchMailboxGuid", $null)
$AccountEntry.PutEx(1, "msExchMDBRulesQuota", $null)
$AccountEntry.PutEx(1, "msExchModerationFlags", $null)
$AccountEntry.PutEx(1, "msExchPoliciesIncluded", $null)
$AccountEntry.PutEx(1, "msExchProvisioningFlags", $null)
$AccountEntry.PutEx(1, "msExchRBACPolicyLink", $null)
$AccountEntry.PutEx(1, "msExchRecipientDisplayType", $null)
$AccountEntry.PutEx(1, "msExchRecipientTypeDetails", $null)
$AccountEntry.PutEx(1, "msExchTransportRecipientSettingsFlags", $null)
$AccountEntry.PutEx(1, "msExchUMDtmfMap", $null)
$AccountEntry.PutEx(1, "msExchUMEnabledFlags2", $null)
$AccountEntry.PutEx(1, "msExchUserAccountControl", $null)
$AccountEntry.PutEx(1, "msExchVersion", $null)
$AccountEntry.PutEx(1, "proxyAddresses", $null)
$AccountEntry.PutEx(1, "showInAddressBook", $null)
$AccountEntry.PutEx(1, "mailNickname", $null)

$AccountEntry.SetInfo()


John M.


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>