Link to home
Start Free TrialLog in
Avatar of calitech
calitech

asked on

logon script in SBS 2008

is there any easy way to create a login script to map all the drives that belong in the network?
This is a SBS 2008 domain.
A one time script is all I really need.
ASKER CERTIFIED SOLUTION
Avatar of -Q-
-Q-
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
3rd line should read
net use * /delete /yes
Avatar of Philip Elder
For scripts in SBS 2008, the one delivery method is via Group Policy Logon Script.

You can create and link a GPO to the SBSUsers OU and call it something like SBSUsers Mapped Drives Policy.

Edit the policy, disable the Computer GP Settings, and navigate down to the user Logon Scripts.

When you go to add a script, the Show Files button will bring up the UNC path via SYSVOL. This view is read-only. Take note of the GPO's GUID and use that to open the physical folder location.

Create the batch file on your desktop, put the net use commands in it that you need and save it.

Copy the batch file into the Explorer window showing the login script's location. You will be double UAC prompted. You cannot create the file in the logon scripts folder, nor can you edit it once it is placed in there.

Once you have copied the file in, you can then add it to the user Logon Scripts for the GPO.

GPUpdate /force [Enter] from the Start search field and your users will get their mapped drives.

Another option, the one we use, is to map the drives using Group Policy Preferences.

Create the above GPO as mentioned, then head down into the User Preferences section and you will see Mapped Drives as one preference. You can set any number of needed mapped drives therein.

Philip
Avatar of calitech
calitech

ASKER

Or how about creating a batch file to run just once and email it to everyone to run, or put it in a common share area and have everyone run it. WIll it recreate the map drives next logon?
If you wanted to just run it once, use the following and it will stay on next logon as you requested.

Adjust with your share names and drive letters.
@echo off
 
net use /delete /yes
 
net use g: \\servername\share1 /persistent:yes
net use h: \\servername\share2 /persistent:yes

Open in new window

Dam i ment for the third line:
net use * /delete /yes
Can Q explain this in English for the less savvy administrator? Where is the user script located?
Thanks
critona: user scripts are located at \\SERVERNAME\NETLOGON on the domain controller, by default.

The can acutally be stored on any share but that'll be the default.