Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Administration Rights
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00690323
Message ID:
00693291
Views:
21
Simon,

>Does anybody know how I can return a logical value from a command to see if the currently logged on user has full adminstration rights, i.e. to install a printer (PDF) from my application. I know you can detect this type of thing, but haven't come across any command to do this?

I've found the following code in another forum. I haven't tested it and I haven't looked through it, to see if this is going to do exactly what you need. But maybe it helps.

Armin
#define ADS_SECURE_AUTHENTICATION 1 
 
LOCAL loAd,loProvider,loWinNT,loUser,loGroup 
 
loAd = GETOBJECT("ADs:") 
FOR EACH loProvider IN loAd 
  IF loProvider.Name == "WinNT:" 
    loWinNT = loProvider 
    EXIT 
  ENDIF 
ENDFOR 
loUser = loWinNT.OpenDSObject("WinNT://"+ALLTRIM(STRTRAN(SYS(0)," # ","/")),"Administrator","",ADS_SECURE_AUTHENTICATION) 
FOR EACH loGroup IN loUser.Groups 
  ? loGroup.Name 
ENDFOR 
loGroup    = .NULL. 
loUser     = .NULL. 
loProvider = .NULL. 
loWinNT    = .NULL. 
loAd       = .NULL. 
RELEASE lo* 

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Reply
Map
View

Click here to load this message in the networking platform