Solved

Logon script not working

Posted on 2011-03-15
16
865 Views
Last Modified: 2012-05-11
I'm trying to map a network drive to all my users on my LAN/WAN. I created a file called logon.bat and save this in the NETLOGON share on my server. From my understanding this could then be referenced on the Profile tab under logon script in ADUC.

The script I used is

net use G: /del
net use G: \\Filesrv\Renal Common

When adding .bat file in the users profile tab in ADUC, am I adding the name of the file (logon.bat) within logon script underneath profile path? What is the proper way to add this logon script in profile tab? Anither thing is that I don't want to have to add to each users profile one by one, so is there an easier way?

Thanks,

nimdatx
0
Comment
Question by:nimdatx
[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
16 Comments
 
LVL 4

Expert Comment

by:CHutchins
ID: 35139152
Add it in Group Policy is the proper way to do this.

If you are running an 08 Domain you can add this under GPP in group policy but you will have to add an update to KB machines.  The scripts will not always work with Win 7 machines as well.
0
 
LVL 1

Author Comment

by:nimdatx
ID: 35139374
I tried to use GPP, but it didn't work for me. So what your saying is that adding to Group Policy is the best way? Can you explain how to?
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35139437
"I tried to use GPP, but it didn't work for me."

Are your machines XP?

If so are they at least SP3 and have Client Side Extensions installed on them ?

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&displaylang=en
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Expert Comment

by:stestaz
ID: 35139444
Edit the default domain policies and in the user configuration add the logon script you made
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35139471
"Edit the default domain policies"


NO.....you should always create a new policy.
0
 
LVL 17

Expert Comment

by:Premkumar Yogeswaran
ID: 35139591
HI,

If you want add this to all user, create a saved query and add the logon script for multiple users at the same time.

For saved query,
http://www.petri.co.il/saved_queries_in_windows_2003_dsa.htm#

check this link for saved query..!

define the user from the OU to the saved query and select all. then goto property and add the logon script.bat

Please let me know if you have any questions or issue in the same.

Regards,
Prem
0
 
LVL 1

Author Comment

by:nimdatx
ID: 35139998
I created a new GPO

 Logon Properties
Nothing happened. Any Idea? not sure if i was supposed to put in scrip parameters.
0
 
LVL 47

Accepted Solution

by:
Donald Stewart earned 500 total points
ID: 35140045
Script name should be just "logon.bat"

copy/paste logon.bat to the default location that opens when you click on "Browse"

you dont need any script parameters
0
 
LVL 1

Author Comment

by:nimdatx
ID: 35140312
I know I'm real close....

Made the changes, but no drive mapped.

 Edit Script
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35140349
Does your logon.bat read as follows?

net use G: /del
net use G: \\Filesrv\Renal Common

or

net use G: /del
net use G: "\\Filesrv\Renal Common"   <<<You need quotes if there is a space in the path

0
 
LVL 1

Author Comment

by:nimdatx
ID: 35140460
I have the quotes. I run the logon.bat manually on the desktop and it runs successfully.
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35140510
Does a gpresult show this GPO as applied under "User Settings" ?
0
 
LVL 1

Author Comment

by:nimdatx
ID: 35140529
ok, I got something, but When I select the map drive it gives me an error.

 Map Drive
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35140587
Why dont we stick to your other question where we are troubleshooting GPP(So that we dont have conflicts with the logon.bat and GPP)

http:#a35140080
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35140597
0
 
LVL 1

Author Comment

by:nimdatx
ID: 35141666
I disabled all my other GPOs (my document redirect, GPP) and rebooted my system and it worked. Not sure what happened.

It's working now, but if i disable GPO with logon script will it disconnect map drive once it's been mapped?

THANKS SO MUCH for hagging with me through this issue.
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
Suggested Courses

626 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