[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Logon scripts for groups


I have a w2K server with some xp and 98se pcs.  I need to apply 1 logon script to a group of users that use a mixture of these pcs.  Am I right in saying that 98se doesn't use the group policy and I don't want to have to go into each user and alter each logon script.  I don't seem to be able to apply a logon script to a group.

Any ideas?
1 Solution
Lee W, MVPTechnology and Business Process AdvisorCommented:
No, you can't apply a logon script to a group, nor can 98SE use group policy.  But if this group has access to something the others don't you could write a seperate script (placed in the netlogon share) and add a line to the existing logon script that checks for access to the specific resource. If there, it executes the other script, if not, then it skips it.  For example:

Your best bet is to investigate KIXTART (http://www.kixtart.org/). This has been used by thousands of administrators worldwide for deploying logon scripts when working with heterogeneous clients. It's pretty simple to learn when you want to do simple things like execute commands based upon group memberships. There is a very large (and busy) bulletin board system there as well although I'm sure if you get stuck you can just come back here and we'll help you out.
You can with an AD script
Save it as a .vbs and change the variables as needed

Set WshShell = WScript.CreateObject("WScript.Shell")

DomainString = "DomainName"
UserString = "UserName"
GroupString = "GroupName"
CommandString = "CommandToExecute"

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
    For Each GroupObj In UserObj.Groups
      If GroupObj.Name = GroupString Then
         Wscript.Echo GroupObj.Name
         WshShell.Run CommandString, 1, false
      End If

For Windows 98 systems you maybe need to have :
Windows Script 5.6 for Windows 98, Windows Millennium Edition, and Windows NT 4.0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

If you need to find the version of Windows before running some script :
Leandro IaconoCommented:
I imagine you refer logon script  as logon scripts in Group Policys. If so, GP can only be set at an OU level. What you would simply have to do is put the group of users inside a specific OU and link the GP with the logon scripts to that OU.

It won't work on w98 PCs ... it will only work on the XP computers ...

For windows 98 Computers ...

"Windows 95 and Windows 98 clients need to be managed with the System Policy Editor.

Client computers that are running Windows NT 4.0, Windows 95, or Windows 98 need to have the .pol file (Config.pol for Windows 98 or Windows 95, or Ntconfig.pol for Windows NT 4.0) created on the client computer's operating system copied to the domain's NETLOGON share. This is: %systemroot%\SYSVOL\sysvol\<domain name>\SCRIPTS under Windows 2000, or %systemroot%\winnt\system32\Repl\Import\Scripts under Windows NT 4.0."


System Policys:

I have to agree with CiaranDolan. KiXtart is the program you want to learn. We use it in our company and it has variables to see if it is being run on a Windows 98, 2000, XP, etc. Great way to have use scripts for users that may log on to pc's with varying OS's. Run XP, but then the user may login to a server with Terminal Services.

The above command will return the OS type. Possible values:
"Windows 95"
"Windows 98"
"Windows Me"
"Windows NT Workstation"
"Windows NT Server"
"Windows NT Domain Controller"
"Windows 2000 Professional"
"Windows 2000 Server"
"Windows 2000 Domain Controller"
"Windows XP Home Edition"
"Windows XP Professional"
"Windows XP Server"
"Windows XP Domain Controller"
WannabeNerdAuthor Commented:
In the end for the single task I just did it all manually but sounds like KiXtart will do the job.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now