|
1 | 1 | <# |
2 | 2 | .SYNOPSIS |
3 | | - Clear-SCOMCache |
4 | | -
|
| 3 | + Clear-SCOMCache |
| 4 | + |
5 | 5 | .DESCRIPTION |
6 | | - The script clears the SCOM cache, Flushing DNS, Purging Kerberos Tickets, Resetting NetBIOS over TCPIP Statistics, and Resetting Winsock catalog. And reboots the server(s) if -Reboot switch is present. |
7 | | -
|
| 6 | + The script clears the SCOM cache, Flushing DNS, Purging Kerberos Tickets, Resetting NetBIOS over TCPIP Statistics, and Resetting Winsock catalog. And reboots the server(s) if -Reboot switch is present. |
| 7 | + |
8 | 8 | .PARAMETER Servers |
9 | | - Each Server you want to Clear SCOM Cache on, can be an Agent, Management Server, or SCOM Gateway. |
10 | | -
|
| 9 | + Each Server you want to Clear SCOM Cache on, can be an Agent, Management Server, or SCOM Gateway. |
| 10 | + |
11 | 11 | .PARAMETER Reboot |
12 | | - Optionally reboot the server after stopping the SCOM Services and clearing SCOM Cache. |
13 | | -
|
| 12 | + Optionally reboot the server after stopping the SCOM Services and clearing SCOM Cache. |
| 13 | + |
14 | 14 | .EXAMPLE |
15 | | - Clear SCOM cache on every Management Server in Management Group. |
| 15 | + Clear SCOM cache on every Management Server in Management Group. |
16 | 16 | PS C:\> Get-SCOMManagementServer | %{.\Clear-SCOMCache.ps1 -Servers $_} |
17 | | -
|
18 | | - Clear SCOM cache on every Agent in the in Management Group. |
| 17 | + |
| 18 | + Clear SCOM cache on every Agent in the in Management Group. |
19 | 19 | PS C:\> Get-SCOMAgent | %{.\Clear-SCOMCache.ps1 -Servers $_} |
20 | 20 | |
21 | | - Clear SCOM cache and reboot the Servers specified. |
| 21 | + Clear SCOM cache and reboot the Servers specified. |
22 | 22 | PS C:\> .\Clear-SCOMCache.ps1 -Servers IIS-Server.contoso.com, MS2.contoso.com -Reboot |
23 | | -
|
24 | | - .AUTHOR |
25 | | - Blake Drumm (v-bldrum@microsoft.com) |
26 | | -
|
27 | | - .MODIFIED |
28 | | - May 24th, 2021 |
| 23 | + |
| 24 | + .AUTHOR |
| 25 | + Blake Drumm (v-bldrum@microsoft.com) |
| 26 | + |
| 27 | + .MODIFIED |
| 28 | + May 24th, 2021 |
| 29 | + |
| 30 | + .NOTES |
| 31 | + Additional information about the file. |
29 | 32 | #> |
| 33 | +[OutputType([string])] |
30 | 34 | param |
31 | 35 | ( |
32 | 36 | [Parameter(Mandatory = $false, |
| 37 | + ValueFromPipeline = $true, |
33 | 38 | Position = 1, |
34 | | - ValueFromPipeline)] |
| 39 | + HelpMessage = 'Each Server you want to Clear SCOM Cache on, can be an Agent, Management Server, or SCOM Gateway.')] |
35 | 40 | [Array]$Servers, |
36 | 41 | [Parameter(Mandatory = $false, |
37 | | - Position = 2)] |
| 42 | + Position = 2, |
| 43 | + HelpMessage = 'Optionally reboot the server after stopping the SCOM Services and clearing SCOM Cache.')] |
38 | 44 | [Switch]$Reboot |
39 | 45 | ) |
40 | 46 |
|
@@ -1395,7 +1401,7 @@ if ($Servers -or $Reboot) |
1395 | 1401 | } |
1396 | 1402 | else |
1397 | 1403 | { |
1398 | | -<# Edit line 1403 to modify the default command run when this script is executed. |
| 1404 | +<# Edit line 1409 to modify the default command run when this script is executed. |
1399 | 1405 |
|
1400 | 1406 | Example: |
1401 | 1407 | Clear-SCOMCache -Servers Agent1.contoso.com, Agent2.contoso.com, MS1.contoso.com, MS2.contoso.com |
|
0 commit comments