Convert user to inetorgperson (VBScript)

This code can be found in Chapter 6 of Active Directory Cookbook, 2nd edition

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

' This code will convert a user object to inetOrgPerson.

' ------ SCRIPT CONFIGURATION ------
strUserDN = "<UserDN>" ' e.g. cn=jsmith,cn=Users,dc=rallencorp,dc=com
strClass = "inetOrgPerson"
' ------ END CONFIGURATION ---------

set objUser = GetObject("LDAP://" & strUserDN)
objUsr.PutEx ADS_PROPERTY_APPEND,"objectClass",Array(strClass)
objUsr.SetInfo

This code has been viewed 2023 times.

New from the creators of TechTasks.com: StatSheet.com