• 0

get user group in VB.NET


Question

im ppullling out my hair here

i want vb.net to gt the security group the account is in (e.g. domain\supernoobs, domain\administrators, domain\domain users, domain\ihatethis, etccccc)

BUT IDONNO how

??

the code i find on interweb always return something weird (0,false,513 wtf???)

and it don't work with user groups on AD :cry:

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

That's tough, because a user can be in multiple groups. You can run something like net user username | find "*" and that will return the local/AD groups the specified user is a member of. But you'll have to parse the output yourself...

Edit: There's also this, but have fun porting it to managed code :rolleyes:

http://msdn.microsoft.com/library/default....localgroups.asp

Link to comment
Share on other sites

  • 0
im ppullling out my hair here

i want vb.net to gt the security group the account is in (e.g. domain\supernoobs, domain\administrators, domain\domain users, domain\ihatethis, etccccc)

BUT IDONNO how

??

the code i find on interweb always return something weird (0,false,513 wtf???)

and it don't work with user groups on AD :cry:

584747538[/snapback]

Have you looked at WMI. There is an ADSI extension...

http://msdn.microsoft.com/library/default....and_domains.asp

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.