Discussion Locked

Windows 2000 Logon Script

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
My network includes a Windows 2000 server and mainly Windows 98 clients. My logon script is a batch file which launches a Windoiws Script Host File. This works on most of my client PC's however, on a few the batch file will not run. Also I would like to be able to identify the Gruoups that a user is a member of in my WSH Logon script, can anyone help me?

8 replies

by neal2002

Check to make sure WSH is enable on the win98 PCs that the script won't run on. You'll find WSH under the windows components in the add/remove programs applet. Turning off WSH was 1 of the security steps that people can took to keep viruses like love letter from running

by sako

This WSH script enumerates what groups a user is a member of and prints it to a file named C:\Groups.txt. Edit it to fit into your current logon script and you are good to go. Hope this helps!

fso = new ActiveXObject("Scripting.FileSystemObject");
aFile = "C:\\Groups.txt"
ForWriting = 2
ForAppending = 8
domain = "Put your domain here"
username = "type Username here"

usr = GetObject ("WinNT://" + domain + "/" + username + ",user")

mList = new Enumerator(usr.Groups());

for (; !mList.atEnd();mList.moveNext())
{
s = mList.item()
//Write a log

if (fso.FileExists(aFile)){
f = fso.OpenTextFile(aFile, ForAppending)
f.Write(s.Name)
f.WriteBlankLines(1)
f.Close()
}
else{
f = fso.OpenTextFile(aFile, ForWriting, "True")

f.Write(s.Name)
f.WriteBlankLines(1)
f.Close()
}

}

by john

Thanks for the help guys, but I am still having problems. I was able to get the logon script working with all the Windows 98 Clients, however, the Group issue is still causing me headaches. The following line is where the script fall over for me: usr = GetObject ("WinNT://" + domain + "/" + username + ",user") returns an Error file name ir class name not found during Automation replication. Can anyone be of any further help?

by sako

I just tested the script again here and it works fine. Just to make sure, where the script reads "put your domain here" and "type username here" you put the domain you are working under and you have to put the username (you will have to get it by adding some code in the script). The quotes stay there.

This discussion is closed to new replies.