Logon Scripts

Posted on 2003-03-06
Medium Priority
Last Modified: 2013-12-28
I am trying to fnd out how to write a script where I am have certian items run for one department of users and another for a different department.  I setup groups in my Domain User manager for each department.  Can I setup different logon scripts for each group or is there a way for it to check when when the script is running which group the user is in so it will run the correct batch file???
Question by:ejunge
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 20

Expert Comment

by:Dufo G. Belski
ID: 8082528
You can use the ifmember.exe tool that is in the resource kit.  It is described here:


Here's another example:


Expert Comment

ID: 8083552
Try using this as a template and make mofification as necessary
net use j: \\computer name\folder name
net use g: \\computer name\folder name
net use h: \\computer name\folder name
net use i: \\computer name\folder name
net use t: \\computer name\folder name
net use s: \\computer name\folder name
@echo off
REM Sample Windows NT Login Script for AVUpdate
REM Please replace "<updateserver>" in this file with the name of
REM   the NT Server designated as you update server.

If "%OS%" == "Windows_NT" goto skip
If NOT "%WINBOOTDIR%" == ""  goto 95

echo Running AVupdate using  WIN3x syntax
net use v: \computer name\cheyupd$
net use v: /d
goto skip

REM Run AVupdate using WIN95 syntax
echo Running using WIN95 syntax
\\computer name\cheyupd$\avupdate.exe

echo Thank you for using AV-Update


Expert Comment

ID: 8086899
There is a even more handy tool, if you have problems with writing complex scripts.

Just go to www.scriptlogic.com

this program will allow you to have in one script the possibilty to create outlook profiles, settings, mapped network drives, add programs just once, or ... ... ...

this is a must for easy working with logon scripts!

check it out ( no I do not have any shares in the company, who would have shares anyway these days! )

Accepted Solution

CPscripter earned 200 total points
ID: 8196851
Setting different scripts for different groups is easy. In NT4 Usrmgr select "Select Users" from the "Users" menu. Find and select the group that you want to set the script for and click on the "Select" button. You can then press Enter and edit the logon script setting for all of the users at once.

Note that the select users option adds to any current selection you have. To avoid problems, you should "Deselect" Domain Users before selecting your group.

If you want to have a single script, you can use KIX from the resource kit or if you're adventurous, write a script in VB.


Assisted Solution

SaschaRhein earned 200 total points
ID: 8204581
We are using KIXtart (http://www.kixscripts.com/download.asp) and the login script is quite easy.
In the user settings we just point to a batch file, lets call it login.bat.

And this file contains a line like:
call kix32.exe Main.kix

Please bear in mind that the kix32.exe must be in the netlogon folder as well.

And here is an example for the "Main.kix" script:

; === Sync time with server GBWH16 ===
      settime "\\GBWH16"

; === Map folders ===

      IF InGroup("GBWH Users")
         USE H: "\\GBWH16\" + @UserID + "$"
         USE O: "\\GBWH16\Everyone"
         USE P: "\\GBWH16\Programs"

      IF InGroup("GBHO Display")
         USE G: "\\GBWH16\Display"

; === Install Printer ===

      IF InGroup ("GBHO Press")
         AddPrinterConnection("\\GBHO01\GB HO Press Colour")
         AddPrinterConnection("\\GBHO01\GB HO Press")
         SetDefaultPrinter("\\GBHO01\GB HO Press")


Featured Post

The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question