Solved

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

Posted on 2006-11-15
5
658 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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