Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Is it possible to create a logon script based on OU and Group membership?

Is it possible to create a logon script based on OU and Group membership?
0
walkerps
Asked:
walkerps
  • 3
  • 2
1 Solution
 
evandrotexCommented:
If I understood, check this examples:

Set ADSysInfo = CreateObject("ADSystemInfo")      'gets ad info
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName) 'Identifies the user
strGroup = LCase(Join(CurrentUser.MemberOf)) 'checks the group

Then you use a "if". Example:

If InStr(strGroup, "cn=groupname") Then
 wshNetwork.MapNetworkDrive "X:","\\server\share"
End if
0
 
Ben StirlingCommented:
Yes you can!

However, as of vista scripts are … not the best option (UAC causes issues). Group policies is the better option, and can be applied to groups or OU’s.
0
 
walkerpsAuthor Commented:
Can group policies be applied to groups AND OU’s?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
evandrotexCommented:
Once you have the script, create a GPO under User Configuration - Windows Settings - Scripts - Logon (example) and link to OU.
0
 
Ben StirlingCommented:
Why use a script at all, you can do everything you need via GPO's?
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now