# Detecting "running as admin" as an Application Variable

**URL:** https://www.finalbuilder.com/forums/t/detecting-running-as-admin-as-an-application-variable/2292
**Category:** Discussion
**Created:** [July 20, 2014, 11:57am UTC](https://www.finalbuilder.com/forums/t/detecting-running-as-admin-as-an-application-variable/2292 "2014-07-20T11:57:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rmcginty](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/rmcginty/32/57_2.png) [@rmcginty](https://www.finalbuilder.com/forums/u/rmcginty)
#### Post date: [July 20, 2014, 11:57am UTC](https://www.finalbuilder.com/forums/t/detecting-running-as-admin-as-an-application-variable/2292/1 "2014-07-20T11:57:17Z")

</div>

I currently do a variety of tricks to determine whether FinalBuilder is running under admin privileges, but after I noticed that there is a IS64BITOS variable, I was wondering if a "ISRUNNINGASADMIN" or something similar that could be added for simplicity.&nbsp; If there is already something like this, I couldn't find it, so just thought I'd suggest.

Ryan

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [July 21, 2014, 2:21am UTC](https://www.finalbuilder.com/forums/t/detecting-running-as-admin-as-an-application-variable/2292/2 "2014-07-21T02:21:12Z")

</div>

Hi Ryan,   
  
 At the moment FinalBuilder doesn’t have a variable which returns the following;   
  
 - Is running as admin   
 - Is running in elevated privileges (mostly the same as “running as admin”)   
 - UAC state (on/off)   
  
 These are something which could be added to FinalBuilder. I have logged a support case of it. If you would like for me to keep you in the loop on its progress, feel free to email support. From there I will link you into the case.

---

<div class="post-metadata">

### Author: ![rmcginty](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/rmcginty/32/57_2.png) [@rmcginty](https://www.finalbuilder.com/forums/u/rmcginty)
#### Post date: [July 21, 2014, 9:24am UTC](https://www.finalbuilder.com/forums/t/detecting-running-as-admin-as-an-application-variable/2292/3 "2014-07-21T09:24:23Z")

</div>

Done - thanks!

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [July 22, 2014, 1:28am UTC](https://www.finalbuilder.com/forums/t/detecting-running-as-admin-as-an-application-variable/2292/4 "2014-07-22T01:28:39Z")

</div>

Hi Ryan   
  
As a work around until we add this feature, add a variable to your project (IsRunningAsAdmin) and add a Run Script action, set the language to Powershell and add this to the OnExecute script :   
  
[code]If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`[Security.Principal.WindowsBuiltInRole] “Administrator”)){Break}$FBVariables[‘IsRunningAsAdmin’] = $True[/code]
