Loginscript based on group membership
- This topic has 0 replies, 1 voice, and was last updated 9 years, 7 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Home › Forums › Scripting › Windows Script Host › Loginscript based on group membership
I just wanted to share this with you guys.
I use this as login script to map drives and set a default printer.
It is based on group membership.
It works like this,
In my example in the Root of ADUC i created a OU called Company Users.
Under this OU i created a OU Security Groups.
In here i put all groups i use like: Financial, Support etc.
I used domain.local as the domain name.
In the script you see some code like this:
Set objGroup = GetObject(“LDAP://CN=
If (objGroup.IsMember(strAdsPath) = True) Then
objNetwork.SetDefaultPrinter “
End If
You have to replace all text that is all in caps.
See my example below:
Set objGroup = GetObject(“LDAP://CN=Financial,OU=Security Groups,OU=Company Users,DC=Domain,DC=local”)
If (objGroup.IsMember(strAdsPath) = True) Then
objNetwork.SetDefaultPrinter “Laserjet 2600”
End If
You must be logged in to reply to this topic.
Find out more about our cookie policy here.