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

login scripts in NT4.0

Status
Not open for further replies.

ITProfessional

IS-IT--Management
Aug 27, 2001
46
US
I want to map my personal folder whenever i logg in to a PC. where should I place my script on the PDC so that it can be run whenever i log in .
I tried in user manager for domain login script. but it didnotwork.
any help??
Kamran
 
You should place the logon script (Logon.bat for example) in the C:\Winnt\System32\REPL\Import\SCripts directory on your Domain controllers. Then edit a users profile in USer Manager for Domains under profile with the logon script.

I use KixTart scripting for logon scripts. You can download this free software from Kixtart.org. Joseph L. Poandl
MCSE 2000


 
thanks Joseph,
I copied my script in the same directory on PDC. but what should I write in User manager for domains=>profile=>login script?
I mean only the file name or \\<PDC>\netlogon\filename.bat
I tried both. If i type only file name, it is ok. but when i login to my PC, it doesnot map the drive. If I type the \\<PDC>... it says this is not the correct relative path.
waht wrong i am doing?
 
You should only have to type the name of the scipt in the profile.

For example,

LOGON SCRIPT: logon.bat

(It knows that the file will be located in the repl directory.)

What type of client machine are you using to logon to the network? Winnt? Win9x?

Maybe your script has a mistake in it? I would also check the share and NTFS permissions on the directory that you are trying to map a drive to.

Another thing you could try is to run the script manually. To do this, manually map a drive to the \\server\netlogon directory. Now, go to a COMMAND (or CMD) prompt. Change the letter from C:\ to the letter of your mapped drive. If you type dir, you should see your *.bat file. Now, run the *.bat file. You should be able to see problems here if they exist in your script.

If you are trying to map drive letter H: to a share in your logon script, you might want to make sure that letter h: isn't already mapped by the users. To do this, include the following command at the top of the logon script: NET USE H: /DELETE

Hope some of this helps....

(I would truely recommend using KIXTART for logon scripts. There is so much more logic that can be added to logon scripts when using kixtart. Visit kixtart.org for more information....its free and widely used.)



Joseph L. Poandl
MCSE 2000


 
thanks Joseph,
I got it finally. Actually i was not writing the complete path. thanks for your help. Now what is the name of the software i should download from kixtar.org..
thanks
 
For an NT 4.0 environment, I think you should down load version 3.63 from
You can find an on-line manual on the kixtart.org site. I think you get an updated manual with the download. From the kixtart.org site you can post questions to other kixtart.org experts.

Hope this helps... Joseph L. Poandl
MCSE 2000
 
I have downloaded it. But i donot know how to use it?
I mean is it a program from you can make your own script or how it works?
 
Its a scritping language. It allows you to put more logic in your logon scripts. For example, you can create a script using kixtart to map a network drive if the user belongs to a particular NT group. For example:



;******* MAP drive if in MANAGERS NT group *******

IF INGROUP (&quot;MANAGERS&quot;)
USE L: &quot;\\server1\managershr&quot;
USE O: &quot;\\server65\managerpayroll&quot;
ENDIF

This is a very basic example. There is much more you can do with it....like update antivirus definitions through logon scripts, check for registry entries, copy files to end users, map printers, etc. I've actually removed LANDESK client software and replaced it with SMS 2.0 software. It is really powerful and robust to work with.



Kixtart Install instructions:

To install KiXtart on the network:

1) To install KiXtart on the network, copy the required files to the NETLOGON share of the logonserver(s):

Kix32.exe
KX16.DLL
KX32.DLL


2) Install the KIXTART RPC Service on each Domain controller in your environment.

-Copy Kxrpc.exe to a directory on the server that will run the service. For example create a directory called kixtart and copy this file to it (c:\winnt\system32\kixtart)

-At the command prompt, switch to that directory and type the following command: KXRPC –install

The service will install and your ready to go.....


Once the above two steps are complete, your ready to start writting Kixtart logon scripts... here's a quick example:

1) create a *.bat (This bat file will be the file called in your user profile under logon script.)

(a) Start -> RUN -> CMD
(b) Edit logon.bat
(c) type the following line:

%0\..\kix32 &quot;logon.kix&quot;

(d) save the file and exit
(e) Move this file in the netlogon directory of every DC.

(You have to create a *.bat file that calls the kixtart script file. This is done because NT can only call *.bat files. It doesn't have the ability to call and execute a *.kix file...so the bat file is used. The bat file is just a one line file that calls the your kix logon script.)


2) The fun part....now, you can open a blank NOTEPAD doc and write the script:

(a) Start -> RUN -> NOTEPAD
(b) edit your kixtart script...you can edit this..


? &quot;Running Logon.kix logon script&quot;
;******* MAP drive if in MANAGERS NT group *******

IF INGROUP (&quot;MANAGERS&quot;)
USE L: &quot;\\server1\managershr&quot;
USE O: &quot;\\server65\managerpayroll&quot;
ENDIF

(c) Now save this file as logon.kix in the netlogon directory of every DC.



Your all set...now go to user manager for domains and add the LOGON.BAT script to all profiles.

Hope this helps..... (It seems like a lot of directions but it's really easy....give it a try. When you look at the manual and see all of the commands, you will see how powerful this logon scripting really is....)





Joseph L. Poandl
MCSE 2000


 
Hi Joseph,
Here is my script named kakhan.bat in netlogon share.
================
if &quot;%OS%&quot; == &quot;windows_NT&quot; goto NT4

set os=Windows 98
echo Hello &quot;%USERNAME%&quot;, Welcome to CAEtech Network
echo You are accessing the network from &quot;%COMPUTERNAME%&quot;
echo You are using the %OS% os.
echo Please wait, authenticating %USERNAME% with %LANGROUP% domain
net use Y: \\arsenic\kakhan$ /y
:NT4
:end
====================
Now when i log in it was executed few times but after I installed kixsart, it is not executing.
Second, I executed this script with command line, it is wroking fine only for mapping drive. other variables are not working. for e.g. %USERNAME%, %COMPUTERNAME%, %LANGROUP%.
When I tried to use INGROUP, it didnot work either. says error 67.
I am using a windows 98 PC.

So my idea is now:
first remove the kirtart app, and just test the batch file for a user. So how can I uninstall it?
second, why these commands are not working? Infac the senario you wrote, exactly what i need? i.e for different groups, different drives are mapped with users' login.
khank@caetech.com
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top