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
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?
@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
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.
Summary: Using user manager I can view users that belong to a particular global group or view the groups that a certain user belongs to. But this interface seems rather clumsly, is there a way of exporting thi...
Summary: Hi ! I'm planning to set up a webserver with xDSL connection running an icq client. The icq client is used for detecting wherther the server is up or not. Could someone with icq scripting knowledge he...
Summary: Thanks for your advice Astroraptor. Yes, I could use tasklist and taskkill but the problem is how should I do it. Here is my situation: I am runing an application called reflection. When it runing win...