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.
This is a SBS 2008 domain.
A one time script is all I really need.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
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.
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
Dam i ment for the third line:
net use * /delete /yes
net use * /delete /yes
Can Q explain this in English for the less savvy administrator? Where is the user script located?
ASKER
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.
The can acutally be stored on any share but that'll be the default.
net use * /delete /yes