|
17 | 17 | PS C:\> $agent = Get-SCOMClass | where-object{$_.name -eq "microsoft.systemcenter.agent"} |
18 | 18 |
|
19 | 19 | PS C:\> #Get the grey agents |
20 | | - PS C:\> $objects = Get-SCOMMonitoringObject -class:$agent | where {$_.IsAvailable -eq $false} |
21 | | - PS C:\> .\Clear-SCOMCache.ps1 -Servers $objects |
| 20 | + PS C:\> $objects = Get-SCOMMonitoringObject -class:$agent | where {$_.IsAvailable -eq $false} | .\Clear-SCOMCache.ps1 -Servers $objects.DisplayName |
| 21 | + PS C:\> .\Clear-SCOMCache.ps1 -Servers $objects.DisplayName |
22 | 22 | |
23 | 23 | Clear SCOM cache on every Management Server in Management Group. |
24 | 24 | PS C:\> Get-SCOMManagementServer | .\Clear-SCOMCache.ps1 |
25 | 25 | |
26 | 26 | Clear SCOM cache on every Agent in the in Management Group. |
27 | 27 | PS C:\> Get-SCOMAgent | .\Clear-SCOMCache.ps1 |
28 | | -
|
29 | | - Clear SCOM cache on the Servers specified. |
30 | | - PS C:\> .\Clear-SCOMCache.ps1 -Servers IIS-Server.contoso.com, MS2.contoso.com |
31 | | -
|
| 28 | + |
32 | 29 | Clear SCOM cache and reboot the Servers specified. |
33 | 30 | PS C:\> .\Clear-SCOMCache.ps1 -Servers IIS-Server.contoso.com, MS2.contoso.com -Reboot |
34 | 31 | |
@@ -274,8 +271,8 @@ PROCESS |
274 | 271 | catch |
275 | 272 | { |
276 | 273 | Time-Stamp |
277 | | - Write-Host "[Warning] :: " -NoNewline |
278 | | - Write-Host "$_" -ForegroundColor Yellow |
| 274 | + Write-Host "[Info] :: " -NoNewline -ForegroundColor DarkCyan |
| 275 | + Write-Host "$_" -ForegroundColor Gray |
279 | 276 | Time-Stamp |
280 | 277 | Write-Host "Attempting to Delete Folder: `"$healthservice`\Health Service State`" " |
281 | 278 | try |
@@ -474,7 +471,7 @@ PROCESS |
474 | 471 | } |
475 | 472 | else |
476 | 473 | { |
477 | | -<# Edit line 448 to modify the default command run when this script is executed. |
| 474 | +<# Edit line 479 to modify the default command run when this script is executed. |
478 | 475 |
|
479 | 476 | Example: |
480 | 477 | Clear-SCOMCache -Servers Agent1.contoso.com, Agent2.contoso.com, MS1.contoso.com, MS2.contoso.com |
|
0 commit comments