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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon Scripts 1

Status
Not open for further replies.

keithmyers

IS-IT--Management
Jan 17, 2003
141
0
0
US
All users in my enterprise have static drive mappings on their local machines. This was in place prior to my employment as the system administrator. I want to map user's drives in a logon script. How do you do that per department? I want accounting to map G to their drive and HR to map G to their drive. Does anyone have example scripts that you could share with me? I need to do this because I am going to migrate users files to a different server and don't want to visit every desktop to change mappings.

Thanks
-Keith-
 
This depends on whether you use NT or 2000 AD.

In Active Directory you can have the users in OU's for each department and put a logon script in the GPO at User Config ->Windows Settings ->Scripts ->Logon

Put something like this in the script

net use u: \\fileserver\sharename\%username%

i usualy put a time command and printers in the script also

if you are using NT, you will have to make a script for each department and assing each user to it. I dont remember if you have to use a unique script for each person or if you can share the scripts for each dept. Too long since i did NT.

Good Luck Doomhamur
Network Engineer

"Certifications? we dont need no stinking certifiaction."
yahoo IM handle: greater_vortex
 
I'm using 2000/AD.

Isn't there a way to write a script that says:

If user is a member of xyz, then map g: to \\server\share?

I seem to remember having one script for all users.

-Keith-
 
There is a utility out on the web called ifmember.exe. It's an old NT util but it still works with 2K AD.
This allows you to map network shares based on group membership.

I use this combined with a logon script dished out by domain group policy.
here is part of my script:

:finance
ifmember finance
if not errorlevel 1 goto HR
net use I: \\server\share

:HR
ifmember HR
if not errorlevel 1 goto admin
net use H: \\server\share

Email me if you want a copy of ifmember
 
create a script called finance.bat

net use g: \\server\share
...

create a script called hr.bat

net use g: \\server\share
...


Then highlight all users in finance and in profile set script as finance.bat and stick it in netlogon on all DCs. Same with hr.
 
you can also use kixtart.exe very easy to use .
find it over the net ( at google.com )

but it won't work on nt4 ws ...
there indeed is something like :

if memberof(financegroup) then .... Alex,
Problem? No Problem!
Drink more beer...
 
The absolutly easiest way to do any scripting is to buy Scriptlogic.
Anything you could possible want to do via script is doable through an easy to use interface.

Map drives, printers, Office settings, etc, all by group, user, IP address, machine name, etc

Very inexpensive for all that it can do and a huge time saver.

They have a 30 or 45 day trial (can't remember which). Anyone I've ever suggested it to has loved it. =============
Mens et Manus
=============
 
polymath5 , with all my respect ,

"to buy" is really the easiest way , but get real ,
you can not buy everything , and if you can do something
without spend money ( I am talking about easy stuff like scripts , mapping , etc . ) then you should do it ...
Almost everything is already on the web , so just find it ... Alex,
Problem? No Problem!
Drink more beer...
 
With all respect, why do you want to reivent the wheel every time? Why not use tools to save you time? What is your time worth to your employers? I can buy anything that will keep my networks up and running smoothly. I see it like tax software, I can complete my taxes manually, but why?

I can manually script this stuff. But I'm pretty sure there is nobody that could make as many changes to a script in as many different areas: printers, drive mapping, Outlook and all office product configs, copy shorcuts to desktops, make registry changes to workstations, and a hell of a lot things AND have these changes be based on Group membership or User or workstation name or IP address or if it's a terminal server client or a workstation (and vary that by OS on the workstation), member server or DC. Then vary that by if it's a dial up or LAN connection. Then push the updated scripts to the DCs, as fast as SL can. Plus the script works First time, no going back to debug. [thumbsup2]

It's good to know how to script, every admin should know how to at least at an intermediate level.

But if I want to quickly make a mapping or printer change I'll chose a tool to do it that saves me time. For example, I just added a network drive mapping for terminal server clients only, removed 2 printers and added 2 different printers to any workstations (no servers) logging in, and pushed it to all 3 DCs, in 1.5 minutes.

Using SL gives me more time for beer [spin2] =============
Mens et Manus
=============
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top