Question

Locked

Startup script on computers doesn not work via group policy

By ikram.hussain ·
I have a batch file and vbscript for mapping a network drive, which I am using in the GPO and it doesn't work.

In Active Directory Users and Computers, I have an OU, I right click on the OU and go to properties and select the Group Policy tab, and create a new policy by a name test.

Then click Edit on that test policy and go to the Computer Configuration | Windows Settings | Scripts | Startup and then click the Add and in the Script Name click the Browse which opens the startup folder, I copy my vbscript or batch file as shown below:

Batch File:
NET USE Z: \\F-AD\DATA /PERSISTENT:YES

VbScript:
' ------ SCRIPT CONFIGURATION ------
strDrive = "Z:"
strPath = "\\F-AD\DATA"
strUser = "<User>" ' e.g. AMER\rallen
strPassword = "<Password>"
boolPersistent = True ' True = Persistent ; False = Not Persistent
' ------ END CONFIGURATION ---------
set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDrive, strPath, boolPersistent
WScript.Echo "Successfully mapped drive"

Then close all the windows, and then login from one of the Windows XP machine from that OU, and the drive letter doesn't get mapped.

Any help is appreciated, as I have about 30computers in that ou, that needs to be mapped to that drive letter, any one who logs into it.

But after logging in If I run the batch file or the vbscript from that folder as shown below, it runs fine:
C:\WINDOWS\sysvol\sysvol\d214.org\Policies\{7BAA60E2-3C6D-4D88-A18B-2E15A6A457F0}\Machine\Scripts\Startup

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Wrong place in the GPO

by neilb@uk In reply to Startup script on compute ...

The script is trying to run on the computer when it starts up. If you want the users to pick up the drive when they log on, you'll need to put it in User Configuration | Windows Settings | Scripts | Logon in a GPO that the users pick up.

Collapse -

Yep I Think Your Script is in the Wrong Place.

by cfrond In reply to Startup script on compute ...

As the previous post mentioned your script is set on the Machine instead of the User. The path for the script should look like:

C:\WINDOWS\sysvol\sysvol\d214.org\Policies\{7BAA60E2-3C6D-4D88-A18B-2E15A6A457F0}\User\Scripts\Login

See if this doesn't help you some,

Assign Logon Script via Group Policy
http://www.computerperformance.co.uk/Logon/logon_script_assign.htm

Collapse -

Yes It Works

by ikram.hussain In reply to Yep I Think Your Script i ...

Yes, after setting it to user it works.

Thanks a lot to all of you.

Back to Hardware Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums