Solved

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

Posted on 2006-11-15
5
653 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

21 Experts available now in Live!

Get 1:1 Help Now