server 2008 login script

Is there a way to use the net use command in server 2008 or another way to map a network drive upon login so that you are not prompted if the drive is already mapped to overwrite it. It will automatically do this without prompting the user. We have group policies in effect and one of rules to map a drive for everyone doesn't always work so I'm trying to find a work around rather than trying to fix the group policy. We've spent enough time and money on figuring out the group policy problem with gpupdate.
sraleyAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
Delete the connection if it exists then remap.

If Exist x:\ NET USE /DELETE x:
net use x: \\server\share /PERSISTENT:NO
0
 
stephen_c01Connect With a Mentor Commented:
using the above code make a new text file and call it, mapdrive.cmd

and put in

If Exist x:\ NET USE /DELETE x:
net use x: \\server\share /PERSISTENT:NO


If you want to have it happend for 1 user, add it to that users start up folder in the start menu, if you want to happen for all users who logon to the server put it in the all users->startup folder.
0
 
George SasIT EngineerCommented:
Sorry to bug in stephen_c01 :) but  no need to copy the files on the local machines etc ...
He is working with GPO's so I guess he can just add the script to the logon script or even to a GPO targeted on spcific ou or so.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
stephen_c01Commented:
but he said he didnt want to mess with the GPO, so i was giving an alternative.
0
 
George SasIT EngineerCommented:
He can just specify a "Logon Script" under the users Profile tab in AD.
0
 
sraleyAuthor Commented:
yes i'd put it in the users profile in AD but does it have to be call .cmd or is there any specific extension needed?
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
The commands I posted are command line commands so they would have to be saved in a text file with a .cmd extension
0
 
George SasIT EngineerCommented:
You can call it .cmd , .bat , .vbs etc.
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
You cannot call it .vbs - that's for Vbscripts - not batch scripts.
0
 
George SasIT EngineerCommented:
If your logon script it's a vbs script you can call it vbs
0
 
sraleyAuthor Commented:
I haven't been able to try the script because someone said the password on the server expired and they changed it, but what is written down isn't working. Our ilnux boot disk that we have used on 2003 servers to reset the administrator password has worked before but in 2008 it gives an error that my partition is read only and cannot fined the system32 folder. Any ideas on a linux reset password boot utility?
0
 
George SasIT EngineerCommented:
Reboot the system and at the boot press S on the console. this should boot it in safe mode.
0
 
sraleyAuthor Commented:
What is safe mode going to help me do?
0
 
George SasIT EngineerCommented:
reset the root password.
0
 
sraleyAuthor Commented:
That option requires that I already have created a usb reset password policy which I have not. So I guess I have to find another 2008 enterprise server and create this file on the usb stick?
0
 
sraleyAuthor Commented:
the local admin password that is still taped to the side of the machine isn't working either regular or safe mode using the server/administrator login name. I'm unable to use some of the links I found in here and on Petri to reset the password. I can't boot into safe mode command prompt to try net user since I have to enter the password to get into the dos prompt.
0
 
sraleyAuthor Commented:
well I just found a linux boot clear password cd dated June 2010 that says it works on 2008/win7 and it told me it cleared the administrator password and saved the same. I leave password blank for both domain and local admins and can't get in. Incorrect password.
0
 
sraleyAuthor Commented:
I made a password reset usb disk from another 2008 machine, it recognizes it and asks me to input new password which I do and then I get an error that it can't change the password. any ideas on exporting the login script and gpo's that I've spent so much time and money getting created?
0
 
sraleyAuthor Commented:
anyone know how to get the gpo and items off the server manually since I can't log in to fix the login script and i'm unable to reset the password?
0
 
sraleyAuthor Commented:
any other ideas on password resetting or how to get my GPO's /config out if I have to wipe this server?
0
 
sraleyAuthor Commented:
Finally got the administrator password resolved and working on script now.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.