Skip to main content

Exchange: Find Disabled Accounts with Mailboxes

Summary: In this example we will use a customer AD query to search for disabled accounts with mailboxes.


Example 1.


In this example we will perform a custome AD search using Active Directory Users and Computers


1. Open Active Directory Users and Computers and click the find icon

2. In the "Find" drop down menu, select custom search and click the advanced tab

3. Paste the following in the white pane:

(&(UserAccountControl:1.2.840.113556.1.4.803:=2)(msExchHomeServerName=*)(objectClass=User))



This will enumerate all disabled accounts with mailboxes. From here you can delete all the mailboxes by selecting the first user and scolling down to the bottom of the list and selecting the last user by shift + left click. Then right click the list, Exchange tasks and delete mailbox.



To perform a search of a single server:


(&(UserAccountControl:1.2.840.113556.1.4.803:=2)(msExchHomeServerName=/O=Domain/OU=MyOU/cn=Configuration
/cn=Servers/cn=Exservername)(objectClass=User))

Click find.


To obtain the full dn of your msExchHomeServerName attribute, you can find this in ADSIEdit.

1. Go to start run, type adsiedit.msc (part of windows server support tools)

2. Expand Domain, this should resemble your OU structure. Locate a user, right click a user cn=my user and select properties.

3. Look for attribute msExchHomeServerName and double click. Copy this string and paste it in the above Ldap query.


Other tricks:


Find disabled accounts with mailboxes that are not hidden in the GAL.


(&(UserAccountControl:1.2.840.113556.1.4.803:=2)(msExchHomeServerName=*)(!msExchHideFromAddressLists=TRUE)(objectClass=User))

To export to txt file using LDIFDE from command prompt:

C:\>ldifde -f c:\exportlist.txt -r "(&(UserAccountControl:1.2.840.113556.1.4.803
:=2)(msExchHomeServerName=*)(!msExchHideFromAddressLists=TRUE)(objectClass=User)
)" -l "dn"


Best practices:


Ensure that you have deleted Mailbox retention configured to ensure that these mailboxes can be recovered in a swift manner. To configure mailbox retention, open Exchange System Manger, locate your mailbox store, properties limits tab.




James Chong (MVP)MCSE M+, S+, MCTS, Security+
msexchangetips.blogspot.com

How useful was this article? Want to see a tip not listed? Please leave a comment.

Facebook

Facebook Recommendations

Followers


Web Designing In Karachi



Haroof.com


Politics blogs

My Zimbio

Email Subscribe

Enter your email address:

Watch online Live TV

Popular posts from this blog

BRITISH FIRM TO INTRODUCE DISSOLVABLE POLYTHENE BAGS IN KARACHI.

CNews Karachi. July 05: A Pakistani Scientist in Britain has invented a new chemical for processing plastic (polythene) bags which has the quality of dissolution after its use in 105 days.A manufacturing unit for these plastic bags was being set up in Turkey while interest has been shown in the setting up of a big unit and manufacturing firm’s head quarter in Karachi which will be used to supply such dissolvable polythene bags to Asian countries. The Director of UK based firm Bio Plast Biodegradable Plastics GL Punn while leading a 15 member delegation called on EDO Municipal Services City Government Masood Alam. The Executive Director of Bio Plast Pakistan Muhammad Hanif Awan and M. Sultan Mehmood Awan was also present on this occasion. The Director of Bio Plast informed the EDO Municipal Services about the characteristics of new chemical. He said that the firm was going to set up its first plant in Turkey which will be operative in next two months. The delegation also praised the vi

Admission Open in Class XI in Pre-Engineering, Pre-Medical, and Commerce Groups at BODMAS MODEL COLLEGE, North Nazimabad, Karachi

  Admission Open in Class XI in Pre-Engineering, Pre-Medical, and Commerce Groups at BODMAS MODEL COLLEGE, North Nazimabad, Karachi.

Matric General Group Result SECONDARY SCHOOL CERTIFICATE (S. S. C.) PART - II CLASS - X - 2010 (www.apnieyesp.com )

PASSED THE SECONDARY SCHOOL CERTIFICATE (S. S. C.) PART - II CLASS - X) ANNUAL EXAMINATION, 2010. ERRORS AND OMISSIONS EXCEPTED, CANDIDATES BEARING THE FOLLOWING ROLL NUMBERS ARE DECLARED TO HAVE PASSED THE SECONDARY SCHOOL CERTIFICATE (S. S. C.) PART - II CLASS - X) ANNUAL EXAMINATION, 2010. ------------------------------------------------- GENERAL GROUP (REG&PVT) --- GRADE..'A-ONE' ---- ----------------------- ( CANDIDATES SECURING TOTAL MARKS 680 AND ABOVE) MARKS SECURED BY THE CANDIDATES OUT OF TOTAL MARKS OF 850 ARE MENTIONED AGAINST EACH ROLL NUMBER IN BRACKET --------------------------------------------------- 601086 (689) XXX (XXX) XXX (XXX) XXX (XXX) XXX (XXX) XXX (XXX) 601327 (681) 363 (684) 364 (719) 407 (685) 664 (682) 788 (687) 601836 (692) 882 (683) XXX (XXX) XXX (XXX) XXX (XXX) XXX (XXX) 602315 (723) 316 (715) 320 (712) 321 (739) 325 (686) 326 (702) 602327 (683) 329 (70

Labels

Show more