Error when executing Get-SCSMClass in SMA Powershell script
Every now and then I get a weird error when executing a script in SMA that otherwise runs without issues. I'm suspecting an intermittent concurrency issue, but I have no idea how to circumvent it.
My script then fails on the instruction
$ActivityClass = Get-SCSMClass System.Workitem$ -ComputerName $ComputerName
The error i'm getting is:
Get-SCSMClass : Item has already been added. Key in dictionary: 'HQSCSMMS01.multi.be_ENU' Key being added:
I tried without the -Computername parameter, but then I get another error:
Get-SCSMClass : The Data Access service is either not running or not yet initialized. Check the event log for more information.