Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login Scripts, Simple question

Status
Not open for further replies.

StressedTechie

Technical User
Jul 13, 2001
367
GB
Okay I have created several logon scripts for different departments.
They look like this

net use <drive letter>: &quot;\\server\data&quot;
net use <drive letter>: \\server\systems
net use <drive letter>: \\server\programs
net use <drive letter>: &quot;\\server\client&quot;
net use <drive letter>: \\server\reference

I now want to add a mapping for each users home directory. What is the syntax of this. I am a little boggled as to how to recognise the username and map this to the users directory without having to taylor each users script. I know there must be a way of having a Generic script.

Cheers
 
If the folder is named the same as the user's name it is simple.

If:
real logon name = johndoe
real folder name = \\server\home\johndoe

Then this will work:
net use x: \\server\home\%username%

Welcome to the tip of a very big iceberg. Watch your footing, my friend. :)
 
If you open a user's properties in User Manager on NT4 there is a profile tab. In here there is a Home directory setting where you can specify the user's home drive and the drive letter to be allocated. They will then automatically receive this mapping upon login.
If setting up a new user this option will automatically create the user's home folder within the specified path.
You may use the %username% variable (e.g. \\Myserver\Home\%username%).
I believe this is also the case in W2K Active Directory - though I have not used AD as yet.
 
I've seen it done several ways. We use this:

net use U: /home
 
What about groups? Suppose I had a group &quot;radio&quot; and I wanted to map \\servername\radio to R: for everyone in that group. Is there a way to use IF/THEN statements in a login script? I'm thinking something like:

if member of &quot;radio&quot;
then net use R: \\servername\radio

I don't really want to experiment on a live environment so I'm holding off on doing the script until I get more info.

Thanks,

Joe Brouillette
 
You're right Joe! Use the ifmember.exe from NT resource kit. The only problem with using this is that you need to copy ifmember.exe to everyone's %systemroot% folder.


ifmember domain\radio
if not errorlevel 1 goto next
net use r: \\server\radio /persistent:no

:next

Jeremy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top