function Get-UACControlSettings{[CmdletBinding()]param()$ConsentPromptBehaviorAdmin = (Get-ItemProperty -Path HKLM:SOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem -Name ConsentPromptBehaviorAdmin).ConsentPromptBehaviorAdmin$PromptOnSecureDesktop = (Get-ItemProperty -Path HKLM:SOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem -Name PromptOnSecureDesktop).PromptOnSecureDesktop# ConsentPromptBehaviorAdmin = 0/PromptOnSecureDesktop = 0 - Neverif(($ConsentPromptBehaviorAdmin -eq 0) -and ($PromptOnSecureDesktop -eq 0)){Write-Verbose "$(Get-TimeStamp): Never notify.";return Never}# ConsentPromptBehaviorAdmin = 3/PromptOnSecureDesktop = 0 - Notify - do not dimif(($ConsentPromptBehaviorAdmin -eq 3) -and ($PromptOnSecureDesktop -eq 0)){Write-Verbose "$(Get-TimeStamp): Notify only when programs try to make changes to computer (do not dim desktop).";return Notify - do not dim;}# ConsentPromptBehaviorAdmin = 0/PromptOnSecureDesktop = 1 - Defaultif(($ConsentPromptBehaviorAdmin -eq 3) -and ($PromptOnSecureDesktop -eq 1)){Write-Verbose "$(Get-TimeStamp): Default - Notify only when programs try to make changes to computer.";return Default;}# ConsentPromptBehaviorAdmin = 0/PromptOnSecureDesktop = 0 - Neverif(($ConsentPromptBehaviorAdmin -eq 2) -and ($PromptOnSecureDesktop -eq 1)){Write-Verbose "$(Get-TimeStamp): Always notify.";return Always;}}
PowerShell v3 Function Get UACControlSettings
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment