Click to See Complete Forum and Search --> : Need API for accessing user group of the currently logged in user
Niti
February 12th, 2005, 04:45 AM
Hi,
I am looking for an API that will return the 'group' to which the currently logged in user belongs.
Or is it a way to know if the currently logged in user belongs to a paricular user group?
Niti
Mick
February 12th, 2005, 05:02 AM
NetUserGetGroups (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netusergetgroups.asp)
NetUserGetLocalGroups (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netusergetgroups.asp)
Niti
February 12th, 2005, 05:33 AM
Yes, I had tried these two, however they ( the sample code) give system error 53 or 2221.
These samples only run when I explicitly give the machine name and user name as ADMINISTRATOR. Then also it does not give any groups. whereas on giving the 'net localgroup' at cmd line shows all the groups.
NoHero
February 12th, 2005, 05:35 AM
Yes, I had tried these two, however they ( the sample code) give system error 53 or 2221.
These samples only run when I explicitly give the machine name and user name as ADMINISTRATOR. Then also it does not give any groups. whereas on giving the 'net localgroup' at cmd line shows all the groups.
Take a look at this thread for an example on this ... (http://www.codeguru.com/forum/showthread.php?t=318316)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.