# Cannot run as local admin after windows update 22H2

**URL:** <https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303>\
**Category:** Discussion\
**Tags:** finalbuilder, actions\
**Created:** [November 22, 2022, 9:33pm UTC](https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303 "2022-11-22T21:33:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sg-assetmanagement](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/e9a140/32.png) [@sg-assetmanagement](https://www.finalbuilder.com/forums/u/sg-assetmanagement)\
**Post date:** [November 22, 2022, 9:33pm UTC](https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303/1 "2022-11-22T21:33:19Z")

</div>

I am using Finalbuilder to run some apps and scripts as the local administrator.  
This works fine until I update my machine to WIn11 22H2  
I just verified when I rolled back my VM to pre 22H2 the script runs fine again.  
When the script fails it generates an authorization error

Could it be I have to change something in the local policy settings of my Development (virtual) Machine in order to allow running “as administrator” from within final builder script? Anyone knows where to look for this item?

Error:  
Failed to execute program S:\Sources\bpl\22.0\Win32\PrepSGDevEnv.exe as user Administrator. Error : Toegang geweigerd

(Toegang Geweigerd == Access denied)

---

<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:** [November 22, 2022, 11:50pm UTC](https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303/2 "2022-11-22T23:50:11Z")

</div>

Hi Hans

I assume that S is a mapped network drive or an external drive?

Are you able to run the application from the command line (with or without using runas)? Is your action specifying any credentials (under execution properties on the runtime property page)?

Do you have the Windows Defender Device Guard feature enabled? We have had several issues caused by this feature introduced in 22h2.

---

<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:** [November 22, 2022, 11:56pm UTC](https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303/3 "2022-11-22T23:56:30Z")

</div>

Turns out Windows Defender Device Guard is enabled by default - takes registry changes to turn it off. We have it turned off as it was causing several issues - we’ll have to setup a test with this but I suspect this may well be the cause.

---

<div class="post-metadata">

**Author:** ![sg-assetmanagement](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/e9a140/32.png) [@sg-assetmanagement](https://www.finalbuilder.com/forums/u/sg-assetmanagement)\
**Post date:** [November 23, 2022, 8:05am UTC](https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303/4 "2022-11-23T08:05:26Z")

</div>

Hi every one reading this.

Indeed it took a registry change, see:

> **[Certain Apps Being "Blocked By Your Administrator" After Windows 11 22H2 Upgrade](https://community.spiceworks.com/topic/2466098-certain-apps-being-blocked-by-your-administrator-after-windows-11-22h2-upgrade)**
>
> I have two domain-joined corporate laptops that is managed by group policy and by InTune. One of them was running Windows 10 Enterprise Build 21H2, and the other one was running...

This worked for me:

go to `HKEY_LOCAL_MACHINE>Software>Microsoft>Windows>Current Version>Policies>System`

Modify `EnableLUA`, change value from 1 to 0

(BTW: S: is a local drive in my VM, definitily not a network drive. S: stands for “sources” 😉 )

---

<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:** [November 23, 2022, 9:08am UTC](https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303/5 "2022-11-23T09:08:56Z")

</div>

This is not a good idea, you are turning of UAC with that registry entry.

---

<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:** [November 23, 2022, 9:12am UTC](https://www.finalbuilder.com/forums/t/cannot-run-as-local-admin-after-windows-update-22h2/7303/6 "2022-11-23T09:12:56Z")

</div>

If you right click on FinalBuilder and select Run as Administrator then that will cause a UAC prompt, after that FinalBuilder should be able to run anything.

There is no way to programatically elevate a process that we can use. ShellExecute can do this, but it cannot capture stdout/stderr so there would be no way to log the process output.
