Add hardwareasset to softwareasset with powershell as relatedAsset
So i am trying to relate a HWA to A SWA with PowerShell but i get this Error and i am trying to understand it.
"New-SCSMRelationshipObject : The object with ID bb65e826-bca7-f8c9-acfc-e835286814ac is not of a valid class for insertion."
The GUID in this Case is pointing to the $CiresonHardwareAsset
My code so far is as follows
I have trid to change the -Source and -Target around but it is the same,
Any one have an Idea??
Best Answer
-
Justin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭That relationship class is relating Software Items to Computer CIs not Hardware Assets. You might try System.ConfigItemRelatesToConfigItem1
Answers
So if i understand correctly i have to add SCCM CI instead of the HWA?
That worked like a charm thx but how can i get the ASSET to RelatedComputers on the SWA. is that yet another Class?