I want to reset the PROFILE FIELD on all users in AD, remove the logon script path and the home dir patch all to be left blank.
I suppose I need a script using ADSI to perform the changed can anyone give me something to work with ?
found this on tech-net:
Const ADS_PROPERTY_UPDATE = 2
Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com"
objUser.Put "givenName", "Ken"
objUser.Put "initials", "E."
objUser.Put "sn", "Myer"
objUser.Put "displayName", "Myer, Ken"
objUser.Put "physicalDeliveryOfficeName", "Room 4358"
objUser.Put "telephoneNumber", "(425) 555-1211"
objUser.Put "mail", "myerken@fabrikam.com"
objUser.Put " "
objUser.PutEx ADS_PROPERTY_UPDATE, _
"description", Array("Management staff"
objUser.PutEx ADS_PROPERTY_UPDATE, _
"otherTelephone", Array("(800) 555-1212", "(425) 555-1213"
objUser.PutEx ADS_PROPERTY_UPDATE, _
"url", Array("
objUser.SetInfo
But I need to reset all users in one OU´s Profile Field and the above script doesnt help me much... I know.
new to this scripting and just need this to be fixed fast, hope someone can help me.
rgds,
Lars
I suppose I need a script using ADSI to perform the changed can anyone give me something to work with ?
found this on tech-net:
Const ADS_PROPERTY_UPDATE = 2
Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com"
objUser.Put "givenName", "Ken"
objUser.Put "initials", "E."
objUser.Put "sn", "Myer"
objUser.Put "displayName", "Myer, Ken"
objUser.Put "physicalDeliveryOfficeName", "Room 4358"
objUser.Put "telephoneNumber", "(425) 555-1211"
objUser.Put "mail", "myerken@fabrikam.com"
objUser.Put " "
objUser.PutEx ADS_PROPERTY_UPDATE, _
"description", Array("Management staff"
objUser.PutEx ADS_PROPERTY_UPDATE, _
"otherTelephone", Array("(800) 555-1212", "(425) 555-1213"
objUser.PutEx ADS_PROPERTY_UPDATE, _
"url", Array("
objUser.SetInfo
But I need to reset all users in one OU´s Profile Field and the above script doesnt help me much... I know.
new to this scripting and just need this to be fixed fast, hope someone can help me.
rgds,
Lars