Group member check! 
Author Message
 Group member check!

Why does the script below say that the member is not a member of that
group when i know he is? Script below:

Dim net, o
  Set net = CreateObject("WScript.Network")
  Set o = GetObject("WinNT://Ntserver1/ITDept")
  If o.ismember("WinNT://Ntserver1/johnd") = True Then
    wscript.echo "Member in group"
  Else
    wscript.echo "Member not in group"
  End if

Have SBS server and I run this from a W2K machines.

Thanks

John D

Thanks

John D

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Mon, 27 Sep 2004 01:31:06 GMT  
 Group member check!
What do you get back when you try something like this for that user?

Set oUser = GetObject("WinNT://aka/administrator")
For Each oGrp In oUser.Groups
wscript.echo oGrp.Name
Next


Quote:
> Why does the script below say that the member is not a member of that
> group when i know he is? Script below:

> Dim net, o
>   Set net = CreateObject("WScript.Network")
>   Set o = GetObject("WinNT://Ntserver1/ITDept")
>   If o.ismember("WinNT://Ntserver1/johnd") = True Then
>     wscript.echo "Member in group"
>   Else
>     wscript.echo "Member not in group"
>   End if

> Have SBS server and I run this from a W2K machines.

> Thanks

> John D

> Thanks

> John D

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Mon, 27 Sep 2004 01:43:03 GMT  
 Group member check!
I get back that Domain Users, ITDept, Domain Admin. So it is saying I am
part of that group? I'll try it again.

Thanks

John D

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 27 Sep 2004 22:58:10 GMT  
 Group member check!
I have not had much luck with doing it the other way around. I also used a
domain name as opposed to a server name.  Since no one else has popped up with
an answer, you might want to check in microsoft.public.adsi.general - the people
over there know ADSI-related issues like this inside-out.


Quote:
> I get back that Domain Users, ITDept, Domain Admin. So it is saying I am
> part of that group? I'll try it again.

> Thanks

> John D

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Mon, 27 Sep 2004 23:20:08 GMT  
 Group member check!
Thanks

John D

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 27 Sep 2004 23:26:06 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Enumerate Local Group Members and Identify Domain of Members

2. How do I add a domain global-groups in a member-server local group

3. Enumerating Members of a Local Group (Not on a DC)

4. Use ADSI to get the groups of a member

5. Find each group a user is a member of

6. How to List All Groups and Members

7. If member of a group then map network drive

8. Enumerate Global Group Members from Remote, Non-Admin?

9. groups and members

10. Make drive mapping when member of group

11. Enumerate Local Groups a user is a member of from a different domain

12. Finding group member

 

 
Powered by phpBB® Forum Software