I’m working on different scripts and functions to automate the building of SharePoint servers, both for “real-world” use as well as for making it easier to build VMs for myself.
Some of the things I do everytime I build an environment are getting old, and so I’m working to automate them using PowerShell. The goal is to be able to build a module with all of my scripts and functions that I can simply import and run.
Today while eating lunch I solved two problems that I typically run into:
1. Disable IE ESC
2. Disable UAC
It turns out that both are just registry entries that need modified…
function Disable-InternetExplorerESC { $AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 Stop-Process -Name Explorer Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green } function Enable-InternetExplorerESC { $AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 1 Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 1 Stop-Process -Name Explorer Write-Host "IE Enhanced Security Configuration (ESC) has been enabled." -ForegroundColor Green } function Disable-UserAccessControl { Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 Write-Host "User Access Control (UAC) has been disabled." -ForegroundColor Green }
Add
Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -Value 0
Because you are only deactivating the prompt and not the uac