Sample Script to Search Incorrect msExchMasterAccountSid Status

Topic Last Modified: 2005-10-12

The following script sample demonstrates a way to search Active Directory® directory service for Microsoft® Exchange Server mailbox accounts that have an incorrect msExchMasterAccountSid status. It will search for both enabled and disabled Active Directory accounts that are Exchange mailbox-enabled. The script also removes the Associated External Account right from enabled Active Directory accounts, which also clears msExchMasterAccountSid, and sets the Associated External Account for disabled accounts, which also sets msExchMasterAccountSid. If a disabled Active Directory account that is mailbox-enabled has no Associated External Account, the Associated External Account and msExchMasterAccountSid will be set to the well-known Self security identifier (SID). The log file that records problems found and changes made is called NoMAS_VBS.log.