0

Has anyone already used the SCOM 1801 rest api? We’re struggling with authentication:

$scomHeaders = New-Object “System.Collections.Generic.Dictionary[[String],[String]]”
$scomHeaders.Add(‘Content-Type’,’application/json’)
$scomCreds = Get-Credential
$uriBase = ‘https://xxxx.xxx.xx/OperationsManager/authenticationMode
Invoke-RestMethod -Method get -Uri $uriBase -Credential $scomCreds
Returns ‘Windows’ so I guess I’m authenticated (without credential this gives a 401)

$uriBase = ‘https://xxxx.xxx.xx/OperationsManager/authenticate
Invoke-RestMethod -Method Post -Uri $uriBase -Credential $scomCreds
Returns 401

Thanks in advance!!

Thijs Hereygers answered