
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...