Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Mailbox

Status
Not open for further replies.

Brysk

Technical User
Aug 22, 2003
77
0
0
NC
What is the option to Delete a user mailbox?

Here's my script
Sub DisableUser(strUsername)
strLDAPConnection = "LDAP://" & strUsername
Set objUser = GetObject(strLDAPConnection)
objUser.Put "userAccountControl", 2
dtmDescriptionDate = InputBox("Inscrivez la raison de la désactivation pour" _
& objUser.DisplayName & vbCr & vbCr & "Terminaison" & vbCr & "Conge Longue Duree")
EndDate = Day(Now()) & "/" & Month(Now()) & "/" & Year(Now())
strDescription = dtmDescriptionDate & " " & objUser.Description
objUser.AccountExpirationDate = EndDate
objUser.PutEx ADS_PROPERTY_UPDATE, "description", Array(strDescription)
objUser.Put "msnpAllowDialin", "FALSE"
' objUser.RemoveMAILBOX
objUser.SetInfo

Set objOU = GetObject(PendingDeletionLDAP)
strUsername = "LDAP://" & strUsername
objOU.MoveHere strUsername, vbNullString
objUser.SetInfo
End Sub
 



is

"LDAP://" & strUsername

pointing to user AD account then i would have to say there will be method to delete a mailbox...unless with exch2003 it is so well integrated into AD that...but no...
so you will need to bind to the exchange box in a similar LDAP manor find the mail object which has the user account associated with it and use a mail class method...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top