• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1257
  • Last Modified:

Using net use script in .bat file for gpo logon scripts in server 2003 and 2008 doman

I'm trying to use a net use script in a .bat file as a logon script in a gpo object in a server 2003 domain (user configuration/windows settings/scripts/logon).   It doesn't appear to be working after I run gpupdate /force.  the script is "net use <drive letter>: \\<file servername>\<shared directory>   and the script runs correctly if i run the .bat file locally.

Obviously I don't work with scripts much.  Help me out?   Thanks.

0
alexsupertramp
Asked:
alexsupertramp
  • 5
  • 3
  • 3
  • +1
2 Solutions
 
Paul MacDonaldDirector, Information SystemsCommented:
You may need to wrap the path in quotes:

net use <drive letter>: "\\<file servername>\<shared directory>"
0
 
Donald StewartNetwork AdministratorCommented:
Since you have a 2008 server, have you considered using Group Policy Preferences ?

http://blogs.technet.com/b/grouppolicy/archive/2009/02/11/gp-preferences-will-reduce-logon-scripts-mapping-drives.aspx
0
 
alexsupertrampAuthor Commented:
The quotes didn't make a difference, and I'm able to name this script in the "Logon Script" field on the profile tab of the user's properties, and the drive maps properly.  I just wonder what i'm missing with the gpo?

i was aware of group policy preferences in w2k8, but i guess i should say that i'm just working in a server 2003 environment.   i shouldn't have mentioned 2008.  
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
Donald StewartNetwork AdministratorCommented:
Just a little fyi,

Even if your in a 2003 environment as long as you have a Vista or Windows 7 client on your network, you can then use RSAT to administer GP preferences.
0
 
techfortatCommented:
How are you adding the scripts to the group policy you are creating?
The easiest Way to do it is just save the script under \\servername\SYSVOL\domainname\scripts or where you want them to reside.

Create the group Policy then it will bring you to the GPO Editor MMC snap-in. Under the second section User Configuration, Go To Windows Settings -> Scripts
Double click on Logon and it will ask you to browse to your scripts.

Hit apply and OK, then apply and OK all the way out.
then do your gpupdate
Give it a few minutes and if that does not kick off then drag the users into another Organizational Unit in AD then back into the company/department OU they were in where the GPO is assigned. That should do it.
0
 
alexsupertrampAuthor Commented:
techfortat...i did it almost the exact way you are describing, although i am adding individual users for testing purposes, through the group policy management tool , and not entire OU's.  it sounds like no one has a problem with the script itself or the way i'm applying it...maybe i have a group policy issue.     stew...thanks for the heads up on the rsat through windows 7.  downloading now.
0
 
Donald StewartNetwork AdministratorCommented:
Good luck, this is the way I am doing it in our environment and it works well
0
 
techfortatCommented:
Could it be possible you have a conflicting GP? Or maybe one you had applied to this user either through an OU or the domain root itself? If any of teh above are true i would try making an OU for this test group and applying the GPO to that OU and removing all parent objects then move that user into the OU and see if it takes. Group Policies can be a pain to release from a SID.

If you are applying the GPO to a specific user try creating a new test user and applying a new Logon GPO to that user or try it with the Test OU scendario mentioned above just to rule out any GPO edit/change anomalies.
0
 
alexsupertrampAuthor Commented:
tech....thanks for the troubleshooting steps.  very helpful.  i'm going to follow your instructions.  i am getting some gpo errors in the event log, relating to specific gpo's, so i do wonder if there is a conflict.   i also deleted a dc recently that i couldn't demote first because it had abruptly died, and i fear that i'm experiencing replication issues.  

stew...liking the remote server management.  i figured this existed some place but i just needed someone to point me the way.
0
 
techfortatCommented:
well I am sure you do have some issues there you might want to check out. An easy way to assess the damage is load the Microsoft support tools. Once you installt he tools open command prompt and go to the directory its installed C;\Program Files\Support Tools then run these commands
dcdiag /fix
netdiag /fix

It will fix what it can and alert you to other things that might point you in the right direction to straighten out any problems.
0
 
alexsupertrampAuthor Commented:
ok, the dcdiag picked up the frs errors and it named the dead domain controller, so i know for sure that i didn't get everything cleaned up.  i'll close this ticket and open a new one with that issue.  thanks again to both of you.  
0
 
alexsupertrampAuthor Commented:
I think that, through this question, I determined that I'm not doing anything wrong with the way i'm applying the script to the gpo, or at least i have bigger problems at the moment.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now