Solved

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

Posted on 2006-11-15
5
652 Views
Last Modified: 2012-05-05
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
Comment
Question by:bsohn417
5 Comments
 
LVL 8

Author Comment

by:bsohn417
ID: 17948420
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
 
LVL 6

Accepted Solution

by:
Mark Pavlak earned 250 total points
ID: 17949983
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
 
LVL 51

Assisted Solution

by:Netman66
Netman66 earned 250 total points
ID: 17952118
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Active Directory question 5 105
Instant VM Recovery 4 73
shadow copies 7 17
Connecting two servers 30 49
The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now