Install-SCOMAgent
-PrimaryManagementServer $MgmtServer
-DNSHostName $AgentDiscovered
-ActionAccount $Credential
this is the install command to install agents from power shell script
$mgmtServer
- is the primary management server.$AgentsDiscovered
- is array of computer names that are discovered and on whom agent is to be installed.$Credential
- contains the credential necessary for installation.
Agents are getting installed. I want the agents installed successfully to be logged into a file.
How to get the return values of Install-SCOMAgent Command to verify if agents are installed successfully or not.