Hi @Robert Groux ,
first some questions:
Which version of Orchestrator are you running?
Which version of PowerShell is used by Orchestrator? (https://get-cmd.com/?p=3731)
Have you tested your script in a 32-bit PowerShell/ISE? Unfortunately Orchestrator is still using the 32-bit PowerShell in a .Net Script activity.
Maybe you this helps:
powershell.exe { Import-Module -Name OperationsManage, OpsMgrExtended -Verbose
New-SCOMManagementGroupConnection -ComputerName "scom.server"
$vms = Import-Csv C:\Scripts\computers.csv
$scom = 'scom.server'
foreach ($vm in $vms) {
$server = $vm.VmName
New-OMComputerGroupExplicitMember -SDK $scom -GroupName 'group.name' -ComputerPrincipalName $server
}
}
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten