Created
February 1, 2018 09:22
-
-
Save taddison/067f9c833ca32e366b59a4394449cb5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# has a -whatif | |
$cred = get-credential | |
$servers = @("server1", "server2") | |
foreach($server in $servers) | |
{ | |
Invoke-Command -ComputerName $server -Credential $cred -ScriptBlock { get-msmqqueue | where-object { $_.QueueName -like "*somequeuewildcard*" } | Clear-MsmqQueue -WhatIf } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment