|
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
|
Title: Message
- [ActiveDir] Slightly OT: Deleting Accounts Barber, Thomas
- RE: [ActiveDir] Slightly OT: Deleting Accounts Steve Rochford
- RE: [ActiveDir] Slightly OT: Deleting Accounts Steve Rochford
