How To: Change all users “Log on to…” settings.

Here’s a quick VBScript that will change all the users in an OU’s ADSI userWorkstations attribute.

Const ADS_PROPERTY_CLEAR = 1

Set objOU = GetObject("LDAP://OU=Users OU, DC=DOMAIN, DC=Local")
objOU.Filter = Array("User")

For Each objItem in objOU
        objItem.PutEx ADS_PROPERTY_CLEAR, "userWorkstations", 0
        objItem.SetInfo
Next

It basically runs through each user object within the OU, clears the userWorkstations attribute and sets it to <not set>. It will allow the user affected to logon to any computer on the domain. You just need to change the LDAP path to the OU that you want to change.

You can also configure the userWorkstations to specific computers. Just change the 0 in the objItem PutEx to “COMPUTER1,COMPUTER2,ECT)





Tags: , , ,

No Responses
Filed under:Uncategorized

Leave a Reply