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

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.
0
calitech
Asked:
calitech
1 Solution
 
-Q-Commented:
just create a batch file in \\servername\NETLOGON\logon.bat and in each users profile in active directory, add logon.bat to their script.

Of course you have to adjust the names and shares to your network.
@echo off
 
net use /delete /yes
 
net use g: \\servername\share1
net use h: \\servername\share2

Open in new window

0
 
-Q-Commented:
3rd line should read
net use * /delete /yes
0
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
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
0
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

 
calitechAuthor Commented:
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?
0
 
-Q-Commented:
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

0
 
-Q-Commented:
Dam i ment for the third line:
net use * /delete /yes
0
 
critonaCommented:
Can Q explain this in English for the less savvy administrator? Where is the user script located?
0
 
calitechAuthor Commented:
Thanks
0
 
-Q-Commented:
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.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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