I'm trying to install SCOM client through a PowerShell script and register it through OMS server. The script works when ran locally. But, it doesn't when configured via SCCM Software Library \ Scripts (Slightly modified drive letter). When Deploying to a selected client (Assents and Compliance\Devices) by right click, Run Script and selecting the PowerShell script. It goes through the normal process and returns with the Script Status Monitor Exit Code 0, see screenshot. But, remotely logging into the client, I don't see the Microsoft Monitoring Agent on the Control Panel and I don't see it on the SCOM server.
I'm not sure which log to look at on both the sccm server (C:\Program Files\Microsoft Configuration Manager\Logs) and on the client end (C:\Windows\CCM\Logs).
Here's my script
msiexec.exe /i "X:\Applications\SCOM_MOMAgent\MOMAgent.msi" /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=POM MANAGEMENT_SERVER_DNS=scom.server.com MANAGEMENT_SERVER_AD_NAME=scom.server.com ACTIONS_USE_COMPUTER_ACCOUNT=1 USE_MANUALLY_SPECIFIED_SETTINGS=1 AcceptEndUserLicenseAgreement=1 Start-Sleep -s 120 $mma = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg' $mma.AddManagementGroup('POM' , 'scom.server.com' , 5723) $workspaceId = "some-random-numeric-alpha-character" $workspaceKey = "some-random-numeric-alpha-character" $mma.AddCloudWorkspace($workspaceId , $workspaceKey) $mma.SetProxyUrl('oms.server.com:8080') $mma.ReloadConfiguration() $mma1 = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg' $mma1.AddManagementGroup('DROM' , 'scom2.server.com' , 5723) $mma1.ReloadConfiguration()
Any suggestions on how to resolve my issue and which logs to look at?