Capturing logged-on user's Group Membership on NT 4 Network 
Author Message
 Capturing logged-on user's Group Membership on NT 4 Network

Under NT 4.0(SP6a) with ADSI 2.5 Client installed I can't use
CreateObject("ADSystem") - works only under Win2000 (what a pity!)

Question: can anyone give me an idea how to find groups the current user
(logged-on user) belongs to?
If running "showgrps.exe" is the only answer then how to capture the output
of "showgrps.exe" ? (I can't use creating a text file: because of "dramatic"
differences in subnetworks speeds even putting VBScript to "sleep" is
unreliable). Any way of capturing cmd-line output in VBScript?

I'd appreciate help...



Tue, 11 Nov 2003 06:36:03 GMT  
 Capturing logged-on user's Group Membership on NT 4 Network
domain = "domainname"
username = "username"
set user = getobject("WinNT://" & domain & "/" & username & ",user")
dl = ""
for each group in user.groups
  s = s & dl & group.name : dl = vbcrlf
next
msgbox s

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> Under NT 4.0(SP6a) with ADSI 2.5 Client installed I can't use
> CreateObject("ADSystem") - works only under Win2000 (what a pity!)

> Question: can anyone give me an idea how to find groups the current user
> (logged-on user) belongs to?
> If running "showgrps.exe" is the only answer then how to capture the output
> of "showgrps.exe" ? (I can't use creating a text file: because of "dramatic"
> differences in subnetworks speeds even putting VBScript to "sleep" is
> unreliable). Any way of capturing cmd-line output in VBScript?

> I'd appreciate help...



Tue, 11 Nov 2003 07:56:25 GMT  
 Capturing logged-on user's Group Membership on NT 4 Network
Thanks Michael,

I found my error soon after I posted it (tried to CreateObject - going
around...).  Appreciate though!

Gregg.


Quote:
> domain = "domainname"
> username = "username"
> set user = getobject("WinNT://" & domain & "/" & username & ",user")
> dl = ""
> for each group in user.groups
>   s = s & dl & group.name : dl = vbcrlf
> next
> msgbox s

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --




- Show quoted text -

Quote:
> > Under NT 4.0(SP6a) with ADSI 2.5 Client installed I can't use
> > CreateObject("ADSystem") - works only under Win2000 (what a pity!)

> > Question: can anyone give me an idea how to find groups the current user
> > (logged-on user) belongs to?
> > If running "showgrps.exe" is the only answer then how to capture the
output
> > of "showgrps.exe" ? (I can't use creating a text file: because of
"dramatic"
> > differences in subnetworks speeds even putting VBScript to "sleep" is
> > unreliable). Any way of capturing cmd-line output in VBScript?

> > I'd appreciate help...



Wed, 12 Nov 2003 07:35:05 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. enumerating membership of groups by the user's token

2. NT 4.0, user groups, PDC's, BDC's and IsMember

3. How to capture user's NT login?

4. VBScript and NT Login Scripts - Group membership?

5. VBScript NT Login Script - checking for group membership

6. Checking NT Group Membership

7. error when checking for NT group membership

8. Testing for NT Group membership within VB Script

9. Checking NT Group Membership

10. Checking for NT Domain Group Membership

11. Determining NT Global Group Membership???

12. Testing NT 4 Group Membership

 

 
Powered by phpBB® Forum Software