November 28th, 2013

PowerTip: Remove PowerShell Web Access Authorization Rules

Doctor Scripto
Scripter

Summary: Learn how to remove Windows PowerShell Web Access authorization rules.

Hey, Scripting Guy! Question How can I remove Windows PowerShell Web Access authorization rules that are no longer required?

Hey, Scripting Guy! Answer If you can identify the rule, use Remove-PswaAuthorizationRule from the PowerShellWebAccess module:

Remove-PswaAuthorizationRule -Id 1

~or~

Get-PswaAuthorizationRule -RuleName ‘server02 AD admin only’ | Remove-PswaAuthorizationRule

To remove all rules for a particular server:

Get-PswaAuthorizationRule | where Destination -eq ‘manticoreserver02’ |
Remove-PswaAuthorizationRule

To remove rules based on the configuration name:

Get-PswaAuthorizationRule | where ConfigurationName -eq ‘ADPS’ | Remove-PswaAuthorizationRule

Recommendation   Use Get-PswaAuthorizationRule, filter the rule (or rules) you want to remove,
then pipe the results to Remove-PswaAuthorizationRule

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback