Computing.Net > Forums > Programming > check which group user belongs to

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

check which group user belongs to

Reply to Message Icon

Name: newtechie
Date: November 29, 2007 at 12:23:32 Pacific
OS: win server 2003
CPU/Ram: p3
Product: dell
Comment:

im trying to find a way to quickly determine whether a user belongs to administrators group or not (if he/she does, then they will be allowed to perform an install otherwise recieve an error). I am working with macromedia installanywhere, so the options of programmiing are jpretty much limited to scripts...any dos script that can help me do that? or any reg entry i can read?

any help is appreciated!



Sponsored Link
Ads by Google

Response Number 1
Name: tonysathre
Date: November 29, 2007 at 13:27:56 Pacific
Reply:

This script requires ifmember.exe from the 2003 ResKit


@echo off
ifmember /l Administrators > nul
if not errorlevel 1 (
start installer.exe
) else (
echo You must be a member of the Administrators group to install
)

Disclaimer: Script is untested


"Computer security." — Oxymoron


0

Response Number 2
Name: newtechie
Date: November 29, 2007 at 13:35:35 Pacific
Reply:

sadly i asked we are unable to bundle this with our product without being able to go through tons of paperwork - i had come across ifmember.exe on ms resources page as well
:(


0

Response Number 3
Name: Razor2.3
Date: November 30, 2007 at 07:10:01 Pacific
Reply:

Well, WMI's an option, but it's a pain.

You could also try doing something only an Administrator could do, then stop if it fails. IE:

ECHO. > "%SystemRoot%\_.tmp" || GOTO :EOF


0

Response Number 4
Name: klint
Date: November 30, 2007 at 18:27:27 Pacific
Reply:

If you can't use the resource kit, I think Razor's suggestion is probably as good as any other, as long as you delete any .tmp file written.

If you don't want to create a .tmp file, you can try the following:

net user %username% | find "Administrators" > nul
echo %errorlevel%

By the way, aren't Power Users also supposed to be able to install applications, not just Administrators?


0

Response Number 5
Name: Razor2.3
Date: November 30, 2007 at 21:53:22 Pacific
Reply:

I'd say, "not if the System Administrator is worth his wage," but who knows? The idea is still valid, even if the example is not.


0

Related Posts

See More



Response Number 6
Name: klint
Date: December 1, 2007 at 04:12:17 Pacific
Reply:

No, I think your example is valid, too. It seems that Power Users can also write into %SystemRoot%, so your example would work.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: check which group user belongs to

User Manager, Export data ? www.computing.net/answers/programming/user-manager-export-data-/14598.html

Simple icq script... www.computing.net/answers/programming/simple-icq-script/8165.html

kill a process from command line www.computing.net/answers/programming/kill-a-process-from-command-line/14109.html