Tuesday, November 25, 2008

Deleting One Telephone Number from a User Account

Deletes a phone number from the otherMobile attribute of the MyerKen Active Directory user account. This operation removes only one phone number (425-555-0113) without affecting any other phone numbers.

Set objUser = GetObject _
  ("LDAP://cn=Myerken,ou=Management,dc=NA,dc=fabrikam,dc=com") 
 
objUser.PutEx ADS_PROPERTY_DELETE, "otherMobile", Array("(425) 555-0113") 
 
objUser.SetInfo
objComptCopy.SetInfo

This is a VB Script, this can be used by saving the file in .vbs file