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
$CiresonSoftwareAssetClass = Get-SCSMClass -Name Cireson.AssetManagement.SoftwareAsset
$CiresonHardwareAssetClass = Get-SCSMClass -Name Cireson.AssetManagement.HardwareAsset
$CiresonSoftwareAssetHasRelComputerREL = Get-SCSMRelationshipClass -Name Cireson.AssetManagement.SoftwareAssetHasRelatedComputer
$CiresonSoftwareAsset = Get-SCSMObject -Class $CiresonSoftwareAssetClass -Filter "Name -eq "<SWANAME>"
$CiresonHardwareAsset = Get-SCSMObject -Class $CiresonHardwareAssetClass -filter "Name -eq "<ComputerName"
New-SCSMRelationshipObject -Source $CiresonHardwareAsset -Relationship $CiresonSoftwareAssetHasRelComputerREL -Target $CiresonSoftwareAsset -Bulk
I have trid to change the -Source and -Target around but it is the same,
Any one have an Idea??