Solved

server 2008 login script

Posted on 2010-08-22
21
525 Views
Last Modified: 2012-08-13
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.
0
Comment
Question by:sraley
  • 10
  • 6
  • 3
  • +1
21 Comments
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 250 total points
ID: 33496763
Delete the connection if it exists then remap.

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

Assisted Solution

by:stephen_c01
stephen_c01 earned 250 total points
ID: 33497030
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
 
LVL 13

Expert Comment

by:George Sas
ID: 33497068
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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 7

Expert Comment

by:stephen_c01
ID: 33497093
but he said he didnt want to mess with the GPO, so i was giving an alternative.
0
 
LVL 13

Expert Comment

by:George Sas
ID: 33497105
He can just specify a "Logon Script" under the users Profile tab in AD.
0
 

Author Comment

by:sraley
ID: 33497341
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
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 33497391
The commands I posted are command line commands so they would have to be saved in a text file with a .cmd extension
0
 
LVL 13

Expert Comment

by:George Sas
ID: 33497446
You can call it .cmd , .bat , .vbs etc.
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 33497451
You cannot call it .vbs - that's for Vbscripts - not batch scripts.
0
 
LVL 13

Expert Comment

by:George Sas
ID: 33499192
If your logon script it's a vbs script you can call it vbs
0
 

Author Comment

by:sraley
ID: 33614156
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
 
LVL 13

Expert Comment

by:George Sas
ID: 33615615
Reboot the system and at the boot press S on the console. this should boot it in safe mode.
0
 

Author Comment

by:sraley
ID: 33616679
What is safe mode going to help me do?
0
 
LVL 13

Expert Comment

by:George Sas
ID: 33616801
reset the root password.
0
 

Author Comment

by:sraley
ID: 33645105
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
 

Author Comment

by:sraley
ID: 33645589
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
 

Author Comment

by:sraley
ID: 33648070
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
 

Author Comment

by:sraley
ID: 33715186
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
 

Author Comment

by:sraley
ID: 33762351
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
 

Author Comment

by:sraley
ID: 33827070
any other ideas on password resetting or how to get my GPO's /config out if I have to wipe this server?
0
 

Author Comment

by:sraley
ID: 33868632
Finally got the administrator password resolved and working on script now.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
This article runs through the process of deploying a single EXE application selectively to a group of user.
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

786 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