WSH - login scripting "if ingroup" 
Author Message
 WSH - login scripting "if ingroup"

WSH - login scripting "if ingroup"Look at http://www.*-*-*.com/

You will need ADSI installed on all workstations.

-mark

  What would the simplest way be of implementing an IF ingroup statement to filter NT groups for login scripting.
  I have used KIX32 so far and would like to switch to wsh.

  Any wsh login scriptiing help will be appreciated.



Fri, 12 Jul 2002 03:00:00 GMT  
 WSH - login scripting "if ingroup"
You'll need ADSI on the workstation to do group checking.  WSH alone is not
sufficient.

Here's a smart portion of a script I wrote that does group checking:

  Set oUser = GetObject("WinNT://" & strUDomain & "/" & strUName)
  Set oUserGroups = oUser.Groups
  For Each Group In oUserGroups
  strGroupName=LCase(Group.Name)

  Select Case strGroupName
  Case "stars"
    .
  Case "cp2000"
    .
  End Select
--
Ronald Mendoza



Quote:
> WSH - login scripting "if ingroup"What would the simplest way be of

implementing an IF ingroup statement to filter NT groups for login
scripting.
Quote:
> I have used KIX32 so far and would like to switch to wsh.

> Any wsh login scriptiing help will be appreciated.



Fri, 12 Jul 2002 03:00:00 GMT  
 WSH - login scripting "if ingroup"
Here's what I use. It needs ADSI. Hope it helps.

Cheers,

Nick.

' **** InGroup Function ***********************
' Written by Nick Brown June 1999
' Takes name of Global NT group as argument
' Returns True if user is member, else False
' Global Variable Dependency: bDebug, oNw
' *********************************************
Function InGroup(strGroup)

If bDebug then wscript.echo "FUNCTION: INGROUP"
On error resume next
Err.clear

Dim strUser, oGroup, oUSer, bGroupMember

  bGroupMember=False
  strUSer=oNw.UserName

  Set oGroup = GetObject("WinNT://DAMNGBH01/" & strGroup)
  For each oUser in oGroup.Members
    If uCase(oUser.Name)=uCase(strUser) Then
      bGroupMember=True
      Exit For
    End If
  Next

  InGroup=CBool(bGroupMember)  

Set oGroup = Nothing
Set oUser= Nothing

Err.clear
End Function

Quote:
-----Original Message-----
From: Dannie de Beer [mailto:IMCEAEX-]

Posted At: 24 January 2000 12:16
Posted To: microsoft.public.scripting.wsh
Conversation: WSH - login scripting "if ingroup"
Subject: WSH - login scripting "if ingroup"

What would the simplest way be of implementing an IF ingroup statement
to filter NT groups for login scripting.
I have used KIX32 so far and would like to switch to wsh.

Any wsh login scriptiing help will be appreciated.



Sat, 13 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Question about "InGroup" function

2. "run as" in login script

3. Problem: CreateObject ("scripting.FileSystemObject") under WSH

4. Problem: CreateObject ("scripting.FileSystemObject") under WSH

5. Disabling "BACK"/"FORWARD" buttons

6. CreateObject("Excel","//server"), MsgBox output

7. Problem With "window.showmodaldialog("")"

8. Disabling "BACK"/"FORWARD" buttons

9. WSH and "Open File" dialog box

10. "Broken" WSH 2.0

11. wsh/vbs and "Memory Leaks"...

12. Stoping WSH "virus's"

 

 
Powered by phpBB® Forum Software