How to check if user is local admin?
Does any one know if wise script has any functionality to check if the current logged on user has local admin rights and if so, continue the installation. I know I can achieve this using an MSI, but wanted to find out if it can also be done with wise script.
Let me know if you know of any other method that would allow me to check if the current logged on user is local admin and if so, return a value.
Let me know if you know of any other method that would allow me to check if the current logged on user is local admin and if so, return a value.
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
Have a search on AppDeploy for 'computerperformance'. One of my posts containing that text will have a number of links to scripting sites (including computerperformance.co.uk) where you'll find some VBSs for testing group membership. If VBS isn't your thing, I'm sure the code could be adapted.
BTW, if the WiseScript is destined to be in an MSI, why not simply use the test 'IsAdmin' or 'Privileged' (one supercedes the other, I can never remember which is which...) as a condition on whatever feature/component/CA you're concerned with?
BTW, if the WiseScript is destined to be in an MSI, why not simply use the test 'IsAdmin' or 'Privileged' (one supercedes the other, I can never remember which is which...) as a condition on whatever feature/component/CA you're concerned with?
Posted by:
justinSingh
15 years ago
My situation is that I have a vendor EXE which requires local admin rights to install properly. If the user doesn't have local admin right, then it doesn't install all of the features.
I need a script that would check to see if a user is local admin and if so, continue with the script and launch install for the application. I was thinking of using 2 separate WiseScripts to achieve my this goal. My first script would try to create a registry key under HKLM->Software. I assume that if a user has local admin rights, then the script should be able to create the registry key under HKLM->Software. If the user isn't local admin, then the script would fail, but basically either way, I would have my 2nd script search for a string within the log file of the first script.
Do you think this is a good design for my script? You thoughts are very much appreciated!
Thanks!
I need a script that would check to see if a user is local admin and if so, continue with the script and launch install for the application. I was thinking of using 2 separate WiseScripts to achieve my this goal. My first script would try to create a registry key under HKLM->Software. I assume that if a user has local admin rights, then the script should be able to create the registry key under HKLM->Software. If the user isn't local admin, then the script would fail, but basically either way, I would have my 2nd script search for a string within the log file of the first script.
Do you think this is a good design for my script? You thoughts are very much appreciated!
Thanks!
Posted by:
anonymous_9363
15 years ago
My situation is that I have a vendor EXE which requires local admin rights to install properly.In what way does that differ from every other vendor install? Anything which requires write access to the file system and/or registry will require local admin rights.
Do you think this is a good design for my script?Why are you making things so complicated? First, any install will require admin rights. Second, I'd highly recommend capturing it as an MSI and working from there.
Posted by:
revizor
15 years ago
Posted by:
blacklisted_packager
15 years ago
You can try using ifmember.exe which checks whether a particular user is member of a particular group.
http://www.microsoft.com/downloads/details.aspx?FamilyID=07C2F6D7-815E-4FA0-9043-4E4635CCD417&displaylang=en
This works like a charm and returns exit code which can be used for scripting.
http://www.microsoft.com/downloads/details.aspx?FamilyID=07C2F6D7-815E-4FA0-9043-4E4635CCD417&displaylang=en
This works like a charm and returns exit code which can be used for scripting.
Posted by:
justinSingh
15 years ago
Sorry VBScab! I forgot to mention that the vendor installation is already a MSI wrapped in a EXE. The EXE has some logic built-in which passes the info contained in the .dat file for the app installation to use. I've tried logging the MSI installation and looking in the "Commandline" section of the log to see what properties or parameters were being passed by the EXE to the MSI. I didn't find any parameters I haven't already tried passing to the MSI directly and even if I run the MSI just with the /qb switch, I get the installation, but not the information contained within the .def file.
BTW, the app I'm working with is Clear Case 7.
I do appreciate everyone's time and advice on this. Thank you!
BTW, the app I'm working with is Clear Case 7.
I do appreciate everyone's time and advice on this. Thank you!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.