Overview

This function will extract UAC settings from one or more systems.  If specified, this command will revert UAC settings to Microsoft's or your own default values.

Dependencies

Access to the registry over the network

Instructions

Get the function into your session.  Dot source this ps1 file, add the function to your script, paste the content of the .ps1 into your session, add it to your profile, etc.

Once loaded, run Get-Help Get-UACSettings -full for further details

 

PowerShell
Edit|Remove
#dot source the script 
."\\path\to\Get-UACSetting.ps1" 
 
#get full help details on this function. 
Get-Help Get-UACSetting -full 
 
#Run the function against multiple computers 
Get-UACSetting -computername Computer1, Computer2 | format-table -autosize 
 
#Revert UAC settings to the default.  Note that you can change the default with parameters, creating your own 'default'. 
Get-UACSetting -computername localhost -reverttodefault 
 
#Set PromptOnSecureDesktop default to 0, revert to default 
Get-UACSetting -PromptOnSecureDesktopD 0 -RevertToDefault | format-table -AutoSize 
 
#Get all non default UAC settings for Computer1 and Computer2 
'computer1''computer2' | Get-UACSetting | ?{$_.isdefault -eq 0} 
 
Output from several examples above: