find logged in users security groups

HI,
I’ve searched the forums but i couldn’t see anything pertinent.

I have a windows app and i would like to check if the current user is in a security group so that i can then allow or disallow them from using certain functionality.
I know i can run a windows program and parse the output, but I’m looking for something a bit slicker

Not sure of anything else besides:

whoami /groups command whoami

yeah thats what im using,i was hoping for something more! maybe it doesnt exist.

Yes I saw the “looking for something a bit slicker” :smiley:

Was not sure what command you were using so through in my 1.5 cents :stuck_out_tongue:

thanks for answering, it IS appreciated :slight_smile:

I’d have thought there would be a built in win32 api or something to do it, running a command and parsing the output all seems a so UNIX

Does this help?

https://msdn.microsoft.com/en-us/library/windows/desktop/bb776463(v=vs.85).aspx

These API links to NetUserGetLocalGroups and NetUserGetGroups might help:-

https://msdn.microsoft.com/en-us/library/windows/desktop/aa370655(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/aa370653(v=vs.85).aspx