0

So this was an issue I ran into a while back and suddenly it has re-appeared. Not sure if its because of a newer build of windows or what but here goes.

In my unattended file, i have the following line that disables UAC,

<EnableLUA>false</EnableLUA>

I need it disabled for a number of reasons, one of which is that UAC will stop a lot of automated scripts i run after a windows install.

The issue that has re-appeared is that when UAC is disabled this way, it breaks OneDrive where the right-click context menu no longer appears. If i re-enable UAC via the normal way in windows, reboot, they come back. I can then disable UAC the normal way again and all is well. So it seems like this above way of disabling UAC just breaks OneDrive for some reason.

I need a way to disable UAC during windows install or shortly after even that doesnt break onedrive.

Richard Chase
  • 101
  • 1
  • 6
  • Do you need one drive? Because if not then there is a way to disable it through Local Group Policy during the sysprep stage. This will at least clear any OneDrive errors that get inadvertently thrown up. – Mastaxx Apr 29 '22 at 09:17
  • Absolutely yes i need onedrive and I need the right click menus that should be there as well. Specifically, I need the options "Always keep on this device" and "Share". If I didn't, then this wouldn't be a problem. – Richard Chase Apr 29 '22 at 22:18

1 Answers1

0

You may need to tinker with this to get it to work properly, but it sounds like you might need to make changes to the user account control policies. You should be able to do this at the sysprep stage

Specifically, you might find "Run all administrators in Admin Approval Mode" toggle will help.

  1. Run secpol.msc to open the Local Security Policy.

  2. Expand Local Policies, then open the Security Options.

  3. Look for the policies regarding the User Account Control

security policies

I would save out an image of your machine before making any changes, then revert back to your saved image to make further changes until you find the correct settings that allow OneDrive to run with UAC disabled.

You can find more source material for this issue here.

Mastaxx
  • 1,040
  • 8
  • 19
  • Thank you, ill have a look. Is this something that can just be integrated into the autounattend or possibly a batch file to run after windows install? I already have a batch that does a bunch of stuff post installation – Richard Chase May 04 '22 at 17:32
  • You can probably do a first logon script to make changes to security policy but you will have to look up how to do this. Otherwise, you can test until you find the settings that work and when you have what you need you can apply the changes to the image whilst you're in audit mode before running sysprep > then save out the image. – Mastaxx May 09 '22 at 15:34