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

need step by step procedure to setup logon scripts in Win 2003 server

Hello - I am new to 2003 server - active directory.

I'd like to setup a server to use logon scripts.

I just want users drives to be automatically mapped.

As I said, I'm new to this so complete step by step instructions would be very helpful.


thank you in advance for your assistance,

Kerry

0
kpdonahue
Asked:
kpdonahue
  • 2
3 Solutions
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Create a text file ending in .bat - for example, logon.bat

Then for each drive you want to map, use a set of lines like this:

REM - check if X: is already mapped, if so, delete it.
if exist x:\ net use x: /delete
REM - map X: to the share sharename on the server myserver
net use x: \\myserver\sharename

Then place this file on the domain controller in:
c:\windows\sysvol\sysvol\<your domain name>\scripts

Finally, on each user who you want to use the script, go to their account properties and set the logon script to be the same name as the text file - no path.

So if you used the sample I gave above, then the logon script would be:
logon.bat
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
You can also use Group Policy scripts as described here:
http://www.serverwatch.com/tutorials/article.php/1474241

Note: there are multiple types of scripts - the two most common are batch and vbscript.  Batch is generally a simple grouping of commands you would type on the command line, vbscript is like writing a program.  You can do everything in vbscript, but it generally requires a good knowledge of visual basic to do things effectively.  And the code required is greater - the same kind of script as I gave you (mine is batch) done in vb would be 4-8 lines longer.
0
 
Cherukuri30Commented:
lets take an example. Assume that you have a user with the name "kerry" and there is folder with the name "kerry_files" (shared folder) in your server and when kerry logs into his computer this folder should be mapped as z drive in his computer.

SCRIPT you can use .VBS (VB SCRIPT) or .BAT file. this example is with VB SCRIPT.

' Beginning of the script

Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUserName
strDriveLetter = "Z:"
strRemotePath = "\\computer name\kerry_files"
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

' End of the script.


paste the above script  in notepad and save as logon.vbs


now copy this file in your server to the following location

c:\windows\sysvol\sysvol\your domain name\scripts

* your domain name is the name of your domain.


no open active directory users and computers

right click on the username kerry and select properties

and give the logon script name in the box "LOGON.VBS"

You are done





0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now