Skip to content

Instantly share code, notes, and snippets.

@Depicus

Depicus/ad-fig10

Created Feb 18, 2015
Embed
What would you like to do?
Sub ModifyUsers(ByVal TheObject)
Dim TheUser
For Each TheUser In TheObject
Select Case TheUser.Class
Case "user"
TheUser.Put("DefaultPrinter", "LDNLGHNPXXX")
TheUser.Setinfo()
Case "organizationalUnit", "container"
ModifyUsers(TheUser)
End Select
Next
End Sub
Dim TheDomain
Set TheDomain=GetObject(LDAP://OU=AddingPrinters,DC=depicus,DC=com)
ModifyUsers(TheDomain)
Set TheDomain = Nothing
MsgBox "Finished"
WScript.Quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.