• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 13233
  • 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
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
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
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.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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