Title: Message
No; it doesn't get deleted. I've used the following sub-routine for the same purpose on our student network. Call it with deletemailbox <full path to user> - you'll need to change the servername to match your exchange server.
 
What I normally do for our staff network is run a routine which checks to see if the user still exists on the payroll database and when they last changed their password; if they're not on the payroll and they've not changed their password recently then I use a script to disable the account and move them to a special OU, adding a comment with the date on which this was done. This makes it easy to re-enable the account when you find that our HR department has just "lost" a member of staff (which they do with disturbing regularity!!) and also easy to just delete them en-masse if they don't get used for a month or so.
 
Steve
 

Sub deletemailbox(recip)
servername="computer01"
Set objPerson = Createobject("CDO.Person")
'Initialize
Set objMailbox = Createobject("IMailboxStore")
'Initialize
objPerson.DataSource.Open recip
Set objMailbox = objPerson
If objMailbox.HomeMDB = ""
Then
   
writelog "No Mailbox Found for " & recipname
Else
   
objMailbox.DeleteMailbox
    objPerson.Datasource.Save
    writelog "Mailbox for " & recipName & " delete successfully."
End
If
End
Sub

-----Original Message-----
From: Barber, Thomas [mailto:[EMAIL PROTECTED]
Sent: 02 April 2003 14:04
To: [EMAIL PROTECTED]
Subject: [ActiveDir] Slightly OT: Deleting Accounts

I am re-writing several scripts to delete accounts.  We are running AD Native Mode, with a single Exchange 2000 Server.  When I programmatically delete a user account (using Windows Scripting Host) does the Exchange email account get deleted as well?  I know a user’s Exchange email account can not exist without the AD account, but I’m wondering what happens to any messages and data that exist on the Exchange server?

 

Thanks in advance.

 

 

-Tom Barber

Systems Manager

Alfred State College

 

 

Reply via email to