Change notes field of existing Request Offering

Dec 4, 2013 at 1:45 PM
Hi all,

When we try to change the "notes" field of a request offering we get the following error:
Set-SCSMObject : Cannot process extension elements as EnterpriseManagementObject. User EnterpriseManagementObjectProjection for all extension element CRUD operations.
At ...\Untitled1.ps1:5 char:7
+ $RO | Set-SCSMObject -Property Notes -Value "Test"
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-SCSMObject], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,SMLets.SetSMObjectCommand
Our code looks like this:
Import-Module smlets
$ROName = "RequestOffering"
$compName = "Note"
$RO = Get-SCSMClass -Name System.RequestOffering | Get-SCSMObject | Where-Object {($_.Title -like "*$ROName*") -and ($_.notes -eq "$compName")}
$RO | Set-SCSMObject -Property Notes -Value "Test"
Any help will be appreciated.
Dec 5, 2013 at 12:25 PM
may be this is because you get more then one object back in $Ro

try this
$ro | % {Set-SCSMObject -Property Notes -Value "Test" }
Dec 6, 2013 at 6:57 AM
Hi crochlitz,

Thanks for the quick reply.

I tried the solution you suggested, but we still got the same error.
I also checked the number of objects in $RO, which was 1.
Dec 9, 2013 at 12:24 PM
Edited Dec 9, 2013 at 12:27 PM
Mick_VR, because its an TypeProjection - do this

$prop = @{"Notes" = "Test"}
$rm |Set-SCSMObjectProjection -PropertyValues $prop -Verbose

this should work

Btw:
?? Why you dont use cmdlet - Get-SCSMRequestOffering ??
Marked as answer by Mick_VR on 12/9/2013 at 11:40 PM
Dec 10, 2013 at 7:40 AM
Thanks crochlitz, it is working now!

I didn't use the Get-SCSMRequestOffering cmdlet because i also want to add the request offering to a service offering.
When i use the Get-SCSMRequestOffering cmdlet the Add-SCSMRequestOffering does not accept it, so i have to use Get-SCSMObject.