How to clean up Exchange 2007 mailboxes automatically?
Hi to all! As an administrator in one educational organization I have a pretty task to keep the mailboxes on our Exchange 2007 (Windows Server 2008 R2) server clean. This means that every new outlook course must have a completely clean mailbox. In Exchange 2000/2003 I could delete these mailboxes in Exchange-Manager for all users in one OU and create them again without the users are affected by this operation. Since Exchange 2007 the user account is deleted with the mailbox. I wrote a script that creates user accounts in the specified OU (dsadd-based) and then the mailboxes for these users are also created (powershell-based). The problem is that after this operation the users cannot log in with their preconfigured profile (probably because of wrong NTFS permissions to the profile folder) and a new one (not preconfigured) will be created. If I only disable the mailbox then I can’t create a new one. Does anyone have the same task and what are possible solutions?Can't get it out of my head...
January 24th, 2011 5:17am

Wow, you are definitely over thinking this! Just run these two lines in the Exchange Management Shell (replace with your domain and OU) Get-mailbox -OrganizationalUnit 'demolab.local/Students' | Disable-Mailbox -Confirm:$false Get-User -OrganizationalUnit 'demolab.local/Students' | Enable-Mailbox Please also click change-type and change this post to a question; not a comment. Mike Crowley Check out My Blog!
Free Windows Admin Tool Kit Click here and download it now
January 26th, 2011 11:58pm

Hi, Mike! Thanks for reply. Will enable-mailbox connect a new one to the user or the old (disabled)? I have now no possibility to try it... sorry. Can't get it out of my head...
January 27th, 2011 3:50am

"enable mailbox" is the same as the exchange 2003: exchange tasks\create mailbox(existing user) but the actual old mailbox content will go away. Mike Crowley Check out My Blog!
Free Windows Admin Tool Kit Click here and download it now
January 27th, 2011 9:45am

Thanks!Can't get it out of my head...
January 28th, 2011 3:34am

Thanks! But there is another problem. When I try to start an Outlook after disable/enable mailbox, I receive a popup "Exchange server is not connected..." What can be a reason? A client: a VMware virtual machine with Windows 7 and Office 2010 Pro Plus. And another question. Should I delete the disabled mailboxes before I enable them again? How do I do this? Can't get it out of my head...
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2011 11:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics