Recently I ran across an issue that it seems lots of folks have, hidden user mailboxes on Microsoft Exchange. Imagine my surprise when I got that call, “We have hidden users on a server! We must be relaying Spam or something!!” Not knowing more at that moment, I got a little nervous, as I was the idiot who installed the server. Can you see me with an idiot hat on?

I soon discovered that hidden users were apparently hidden mailboxes. Using Exchange System Manager (ESM), I too looked at the stores in question, and they did appear empty. However, when I tried to delete them, it stated that there were mailboxes on the store and that I need to move them prior to deletion. This was what started the hidden user thing.

Without going into the details of when and how Exchange creates boxes, heres a VBS script that you can run that identifies these boxes.

Code (vbs)
  1. ‘Shows anything that is mail enabled, but doesn’t have a mailbox
  2. Dim rootDSE, domainObject, conn, cmd
  3. Set rootDSE=GetObject("LDAP://RootDSE")
  4. DomainContainer = rootDSE.Get("defaultNamingContext")
  5. Set fs = CreateObject ("Scripting.FileSystemObject")
  6. strDate = Year(Now) & "-" & Right("0" & Month(Now),2) & "-" & Right("0" & Day(Now),2)
  7. Set userFile = fs.CreateTextFile ("test_" & strDate & ".csv")
  8. Set conn = CreateObject("ADODB.Connection")
  9. conn.Open "Provider=ADsDSOObject;"
  10. Set cmd = CreateObject("ADODB.command")
  11. cmd.ActiveConnection = conn
  12. cmd.Properties("Cache Results") = False
  13. cmd.Properties("Page Size") = 5000
  14. cmd.CommandText = "<ldap:>;(&(mail=*)(msExchHomeServerName=*)(!(homeMDB=*)));adspath;subtree"
  15. Set rs = cmd.Execute
  16. userFile.Write "displayName,CN,mail"
  17. userFile.WriteLine ""
  18. While Not rs.EOF
  19. Set oUser = GetObject (rs.Fields(0).Value)
  20. userFile.Write chr(34) & oUser.cn & chr(34) & "," & chr(34) & oUser.givenName & " " & oUser.sn & chr(34) & "," & oUser.mail & ",smtp:" & oUser.mail
  21.         userFile.WriteLine ""
  22. rs.MoveNext
  23. Wend

The fix once you identify these users is to either remove all Exchange attributes or move the nonexistent mailbox to another Exchange server. If they aren’t using it, why waste a license.

March 24, 2007, 10:44 am o'clock

Add your own comment or set a trackback

Currently no comments

  1. No comment yet

Add your own comment



Follow comments according to this article through a RSS 2.0 feed