Quantcast
Channel: Jimmy Harper's Operations Manager Blog
Viewing all articles
Browse latest Browse all 20

PowerShell Command to Approve SCOM Agents Listed in a Text File

$
0
0

 

My customer has a lot of manually installed SCOM Agents that have not yet been approved in the console, and wanted a quick way to approve only the ones that are listed in a text file.

The following PowerShell command can take care of this pretty easily (modify the C:\Servers.txt path as needed). Also, be sure that the servers are in FQDN format in the text file (Server.Domain.com).

Foreach ($Computer in (Get-Content C:\Servers.txt)) {Get-SCOMPendingManagement | where {$_.AgentPendingActionType -eq "ManualApproval" -and $_.AgentName -eq $Computer}| Approve-SCOMPendingManagement}


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>