General discussion

Locked

Windows 2000 Logon Script

By john ·
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?

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Windows 2000 Logon Script

by Neal2002 In reply to Windows 2000 Logon Script

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

Collapse -

Windows 2000 Logon Script

by john In reply to Windows 2000 Logon Script

The question was auto-closed by TechRepublic

Collapse -

Windows 2000 Logon Script

by Sako In reply to Windows 2000 Logon Script

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()
}

}

Collapse -

Windows 2000 Logon Script

by john In reply to Windows 2000 Logon Script

The question was auto-closed by TechRepublic

Collapse -

Windows 2000 Logon Script

by john In reply to Windows 2000 Logon Script

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?

Collapse -

Windows 2000 Logon Script

by Sako In reply to Windows 2000 Logon Script

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.

Collapse -

Windows 2000 Logon Script

by john In reply to Windows 2000 Logon Script

The question was auto-closed by TechRepublic

Collapse -

Windows 2000 Logon Script

by john In reply to Windows 2000 Logon Script

This question was auto closed due to inactivity

Back to Windows Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums