• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 664
  • Last Modified:

Group Policy Login Script to Map Drive for Users in Multiple OUs

The environment I am currently working on maps drives via group policy.  All users in each OU have their own login script.  I need to map a drive for users in multiple OUs.  

1)  What would you recommend be the best approach to a situation like this?  

2)  Is filtering the login script GPO based on group membership the way to go?  

3)  If so, how would this affect the performance of group policy processing?  
0
bsohn417
Asked:
bsohn417
2 Solutions
 
bsohn417Author Commented:
Come to think of it, it might be best to modify the existing scripts and to map the drive based on group membership.  Anyone have the syntax handy to add to a VBScript script?

On Error Resume Next

' *** Drive Map Letters and Paths ***

strDriveLetter1 = "N:"
strDrivePath1 = "\\Nas01\Network Applications"

strDriveLetter2 = "L:"
strDrivePath2 = "\\Nas01\Staff Data\Justice Action Center"

strDriveLetter3 = "H:"
strDrivePath3 = "\\Nas01\Staff Data"

strDriveLetter4 = "G:"
strDrivePath4 = "\\Nas01\Student Data\Law Review"


' ************************************


Set objNetwork = CreateObject("WScript.Network")

' *** Section which removes drives before mapping
objNetwork.RemoveNetworkDrive strDriveLetter1
objNetwork.RemoveNetworkDrive strDriveLetter2
objNetwork.RemoveNetworkDrive strDriveLetter3
objNetwork.RemoveNetworkDrive strDriveLetter4

' *** Section which maps drives
objNetwork.MapNetworkDrive strDriveLetter1, strDrivePath1
objNetwork.MapNetworkDrive strDriveLetter2, strDrivePath2
objNetwork.MapNetworkDrive strDriveLetter3, strDrivePath3
objNetwork.MapNetworkDrive strDriveLetter4, strDrivePath4

' *** AuditWizard Audit Scan ***
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
Set f2 = fso.GetFile("c:\station.a2k")
f2.Delete
Set objShell = CreateObject("WScript.Shell")
objShell.Run chr(34) & "\\nas01\network applications\auditwizard\network scan\scan32.exe" & chr(34)
0
 
Mark PavlakCommented:
You can also move those OU's into a paretn OU and apply to script to the parent.  GPO's work in heiarchy, therefore if you have a parent OU "X" and childern "Y & Z", you can aplpy the new drive mapping to via gpo to X and childerne y&z will run the script
0
 
Netman66Commented:
Users cannot exist in multiple OUs.

If you mean you want a script to apply to multiple OUs, then link a GPO high enough in the AD tree to allow inheritance to apply it to all the OUs.  This may be at the domain level.

You can certainly use group membership in a single script - yes.  You may want to explore the use of CASE in vbscript to run certain mappings based on membership.


0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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