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

logon script InGroup or IfMember for Win9x clients

Status
Not open for further replies.

mrbrennan

MIS
Oct 3, 2000
16
0
0
CA
Is there any way to use "InGroup" or "IfMember" commands in the logon script for Win9x clients.
 
Well it works for me! This is probably more appropriate for the scripting forum but hey check this logon script...

' ---------------------------------------------------------
' Logon Script
' ---------------------------------------------------------
' Start of VB Script code for Windows Scripting Host (WSH)

' Create WSH objects and populate from the Domain/AD
set wshNetwork = WScript.CreateObject("WScript.Network")
set wshShell = WScript.CreateObject("WScript.Shell")

' Wait for up to 30 seconds
HurryUp = Timer + 30
Do
Wscript.Sleep 100 ' Check every 100mS
Loop until wshNetwork.username <> &quot;&quot; or HurryUp < Timer
If wshNetwork.username=&quot;&quot; then ProblemGettingDomainData

'Set some variables
User = wshNetwork.username
Domain = wshNetwork.userdomain
computer = wshNetwork.computername

'Determine the users Domain/AD Group membership
adspath=&quot;WinNT://&quot; & domain & &quot;/&quot; & user

'Create an object and populate it with users
set adsobj = getobject(adspath)

'Map Drives based on Group Membership
'Users can belong to many groups. The group name for every group that the user belongs to is
'passed through a &quot;select case&quot; test. If the group name under test matches any &quot;case&quot; statement,
'then the line(s) under the &quot;case&quot; statement is actioned.

'Cycle through the user's group membership list
for each prop in adsobj.groups

'Pass the name of the group through the following filter
Select case prop.name

case &quot;D_NewZealand&quot; ' User is a member of this group so...
mapNetwork &quot;S:&quot;, &quot;\\nzdatasr01\data&quot;

end select ' Finish the filter test for this group name

'Loop around until every entry in the group membership list has been tested

Next

'Quit the script
Wscript.Quit

 
You need to run windows scripting host for that or any other program that gives added functionality to login scripts like kixstart.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top