Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving Windows Group Membership
Message
From
05/04/2007 06:50:28
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01212365
Message ID:
01212368
Views:
16
Hello,

there are at least 3 ways i've found to query if the user has administrative rights.

1. NetUserGetInfo function - query for information level 1 and check
the "usri1_priv" field
http://msdn2.microsoft.com/en-us/library/aa370654.aspx
example in C
http://groups.google.de/group/borland.public.cppbuilder.winapi/browse_thread/thread/c3cf04a2b1ba722c/b4f8f6f7006873df?lnk=st&q=NetUserGetInfo+administrator&rnum=4&hl=de#b4f8f6f7006873df

2.IsUserAnAdmin function - very easy to use but might be unsupported in future OS Versions (and not available depending on service pack level/ shell32.dll version)
see notes @
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/isuseranadmin.asp?frame=true

3. The hardcore API way, should be easily convertable into an FLL function, but I wouldn't do it in pure FoxPro code

http://support.microsoft.com/?scid=kb%3Ben-us%3B118626&x=16&y=17


Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform