What's the X drive and how would the local system account on a managed client have an X drive?
Why aren't you using an Application for this so that the content can be delivered as well?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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?
Thanks..
What's the X drive and how would the local system account on a managed client have an X drive?
Why aren't you using an Application for this so that the content can be delivered as well?
Hi,
It seems the msiexec didn't run successfully and the most possible reason is that the path is not recognized. As Jason mentioned above, when admistering from ConfigMgr, the account is SYSTEM. By defult, powershll call the command but not care about whether it succeeds. We need to confirm that the SCOM agent installation is successful before applying any configuration.
To test this, I've modified the script slightly, test with local system and the MMA appears in the control panel.
drive x: does not exit, however, it shows true as the result for powershell
run under local system context
sample script for your reference
start-transcript -path "\\10.1.1.2\d\alex\debug0901.txt" -append
#map the drive dynamically, so that it can be accessible under local system context
$command = "\\10.1.1.30\c$\System Center Operations Manager 2019\agent\AMD64"
$command = "cmd /c net use x: "+ '"' + $command + '"' + " /user:<domain\user> <password>"
invoke-expression $command
$params = '/i', "X:\MOMAgent.msi", '/qn', 'USE_SETTINGS_FROM_AD=0', 'MANAGEMENT_GROUP=test01', 'MANAGEMENT_SERVER_DNS=om16.sc.com', 'MANAGEMENT_SERVER_AD_NAME=om16.sc.com', 'ACTIONS_USE_COMPUTER_ACCOUNT=1', 'USE_MANUALLY_SPECIFIED_SETTINGS=1', 'AcceptEndUserLicenseAgreement=1'
$p = Start-Process 'msiexec.exe' -ArgumentList $params -NoNewWindow -Wait -PassThru
$p.ExitCode
#unmap the drive
$command = "cmd /c net use x: /delete"
invoke-expression $command
#Start-Sleep -s 12
#if the installation succeeds, contine the configuration
if ($p.exitcode -eq 0)
{
$mma1 = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg'
$mma1.AddManagementGroup('test01' , 'om16.sc.com' , 5723)
$mma1.ReloadConfiguration()
}
stop-transcript
Alex
If the response is helpful, please click "Accept Answer" and upvote it.
Hi @Cody
I would suggest you to Install an agent on a server by using the action account credentials and see if that helps .
A sample like this
$InstallAccount = Get-Credential
$PrimaryMgmtServer = Get-SCOMManagementServer -ComputerName "MgmtServer01.Contoso.com"
Install-SCOMAgent -DNSHostName "Server01.Contoso.com" -PrimaryManagementServer $PrimaryMgmtServer -ActionAccount $InstallAccount
Hope this Answers all your queries , if not please do repost back .
If an Answer is helpful, please click "Accept Answer" and upvote it : )
The x: drive is a temp virtual drive that I created for this test. I've tried using a FQDN name.
(e.g. \scom.server.com\Applications\SCOM_MOMAgent\MOMAgent.msi)
When you say "Why aren't you using an Application for this so that the content can be delivered as well?" are you referring to when right click on the object and select Install Application?
I'd like to be able to do that. But, I'm unsure how to set that up.
Sorry for the the late response. I can't seem to response or upload screenshots to the forum at learn.microsoft.com for the last few days. Anyone is also having issue.
I can't seem to get the script to run via sccm script installer. No script debugging logs (like your example: start-transcript -path "\10.1.1.2\d\alex\debug0901.txt") going into the network share on the sccm share folder. I'm wondering if it's a permission thing. Is there a log that I can look that I can look at within the sccm logs that's dedicated to script installer like ccm.log when deploying sccm clients.