Checking NT Group Membership 
Author Message
 Checking NT Group Membership

We are currently looking to use WSH as our default login script language,
instead of KIX32.

A number of KIX scripts we currently have, check for whether a user is a
member of a particular NT group, and then run a particular command, e.g map
a drive.

What I would like to know is whether this is possible in WSH, and whether an
example script is available.

Many thanks

Scott Davies



Wed, 12 Sep 2001 03:00:00 GMT  
 Checking NT Group Membership
Both my site http://wsh.glazier.co.nz/frame.htm (in the code section)
and Clarence's site http://cwashington.netreach.net have examples of this.
Something like this...

On Error Resume Next
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WSHNetwork = WScript.CreateObject("WScript.Network")
' Get the user ID, loop fixes a bug in the network object
strUser = ""
While strUser = ""
  strUser = WSHNetwork.UserName
Wend

' Use ADSI get get list of groups the user belongs to
adsPath = "WinNT://" & strDomain & "/" & strUser
set adsObj = GetObject(adsPath)
For Each Prop In adsobj.groups
  Select Case Prop.Name
   Case "Domain Admins"
    Call Administrators()
   Case "Group1"
    Call Group1()
   Case "Group2"
    Call Group2()
   'etc
  End Select

It will require ADSI to be installed on each client.

Regards,
Ian
WSH FAQ http://wsh.glazier.co.nz/frame.htm
Collaborate Today http://collaborate.glazier.co.nz


Quote:
> We are currently looking to use WSH as our default login script language,
> instead of KIX32.

> A number of KIX scripts we currently have, check for whether a user is a
> member of a particular NT group, and then run a particular command, e.g
map
> a drive.

> What I would like to know is whether this is possible in WSH, and whether
an
> example script is available.

> Many thanks

> Scott Davies



Thu, 13 Sep 2001 03:00:00 GMT  
 Checking NT Group Membership
Today i was looking for exactly the same thing
I think 'they' do it with ADSI but i don't now if it is advisable to install it
on current NT4 servers
As soon NT5 will see the daylight in our organisation if you know how to do this


Quote:

> We are currently looking to use WSH as our default login script language,
> instead of KIX32.

> A number of KIX scripts we currently have, check for whether a user is a
> member of a particular NT group, and then run a particular command, e.g map
> a drive.

> What I would like to know is whether this is possible in WSH, and whether an
> example script is available.

> Many thanks

> Scott Davies



Sat, 15 Sep 2001 03:00:00 GMT  
 Checking NT Group Membership

ADSI is a CLIENT side piece. There is no need to install on the servers unless you are going to be running admin scripts from the server.

Clarence

--
Check it out..

Http://cwashington.netreach.net

On this site you will find resources for all of your scripting needs.
Everything you need to get up and running. Over 200 Sample
Scripts, ActiveX controls, reference materials, and technical support
via an online discussion lounge.

[ Win32Scripting... automate!! ]

Today i was looking for exactly the same thing
I think 'they' do it with ADSI but i don't now if it is advisable to install it
on current NT4 servers
As soon NT5 will see the daylight in our organisation if you know how to do this


Quote:

> We are currently looking to use WSH as our default login script language,
> instead of KIX32.

> A number of KIX scripts we currently have, check for whether a user is a
> member of a particular NT group, and then run a particular command, e.g map
> a drive.

> What I would like to know is whether this is possible in WSH, and whether an
> example script is available.

> Many thanks

> Scott Davies



Sat, 15 Sep 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Checking NT Group Membership

2. VBScript NT Login Script - checking for group membership

3. error when checking for NT group membership

4. Checking for NT Domain Group Membership

5. Checking Group Membership for a Computer

6. Checking for Group membership

7. Checking group membership

8. checking group membership like IFMEMBER

9. Checking Group Memberships

10. Checking for Group membership not working?

11. How to check group membership in non trusted domain

12. Checking Global Group Membership

 

 
Powered by phpBB® Forum Software