Question:How To Remove Exchange Server Attributes From Active Directory User Using PowerShell

This cmdlet will show you how to remove Exchange Attributes from Active Directory user using PoweShell.

This is very handy when using Cross Forest migration or moving to the Cloud mail and Exchange Attributes are still attached to the user profile even when Exchange server is not present anymore.

To run the command, first import the AD module.

Import-module activedirectory

Copy the user name or usernames to a text file called users run the cmdlet from the same location the text file is located:

 

Get-Content .users.txt |set-aduser  -clear “mDBOverHardQuotaLimit”,

“mDBOverQuotaLimit”,

“mDBStorageQuota”,”mail”,”HomeMDB”,

“HomeMTA”,”legacyExchangeDN”,”msExchMailboxAuditEnable”

,”msExchAddressBookFlags”,

“msExchArchiveQuota”, “msExchArchiveWarnQuota”,

“msExchBypassAudit”, “msExchDumpsterQuota” ,

“msExchDumpsterWarningQuota”,

“msExchHomeServerName”,”msExchMailboxAuditEnable”, “msExchMailboxAuditLogAgeLimit”,”msExchMailboxGuid”,

“msExchMDBRulesQuota”,

“msExchModerationFlags”,,”msExchPoliciesIncluded”,

“msExchProvisioningFlags”,

“msExchRBACPolicyLink”,”msExchRecipientDisplayType”,

“msExchRecipientTypeDetails”,

“msExchTransportRecipientSettingsFlags”,”msExchUMDtmfMap”,

“msExchUMEnabledFlags2”,

“msExchUserAccountControl”,”msExchVersion”,

“proxyAddresses”,

“showInAddressBook”, “mailNickname”


by