-
Notifications
You must be signed in to change notification settings - Fork 1
Agent Management
Emre Guclu edited this page Dec 3, 2020
·
3 revisions
Runs HSLockodwn on multiple dcs. Requires Powershell Remoting.
Import-Module OperationsManager
$ProblemDCs="dc1","dc2","dc3"
$AddScriptBlock={
set-location "C:\Program Files\Microsoft Monitoring Agent\Agent"
.\HSLockdown.exe /A 'NT AUTHORITY\SYSTEM'
get-service -Name HealthService | Restart-Service -Verbose
}
Invoke-Command -ScriptBlock $AddScriptBlock -ComputerName $ProblemDCsThe following line lists scom Gateways with their failover servers.
Get-SCOMGatewayManagementServer | Select-Object -Property DisplayName, @{Name="PrimaryServer"; Expression={($_.GetPrimaryManagementServer()).DisplayName}},@{Name="FailOverServer"; Expression={($_.GetFailoverManagementServers()).DisplayName}}
Get-SCOMAgent | select-object -Property DisplayName, PrimaryManagementServerName, @{Name='FailoverMS';Expression={($_.GetFailoverManagementServers()).Name}}
Run the below line on the management server to figure out which agents are connected.
Get-NetTCPConnection -LocalPort 5723 | Format-Table -Property @{Name="LocalDNS";Expression={(resolve-dnsname $_.LocalAddress).NameHost}},LocalPort,@{Name="RemoteDNS";Expression={(resolve-dnsname $_.RemoteAddress).NameHost}},RemotePort,@{Name="ProcessName";Expression={(Get-Process -PID ($_.OwningProcess)).Name}},state
Footer notes Emre Güçlü emreg@microsoft.com
Side bar