Created
February 18, 2015 23:26
-
-
Save Depicus/50f64fa0a8afb999c195 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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