Setting multiple properties

Jun 3, 2011 at 8:21 PM

I'm trying to set multiple properties on incidents using Set-SCSMObject.  I know how to set a single property using -Property and -Value.  Is it possible to set multiple properties in a single command?

Jun 9, 2011 at 12:47 AM

use the PropertyHashtable parameter:

$incident | set-scsmobject -propertyHashtable @{
   TargetResolutionTime = [datetime]::Now.AddDays(60)
   ContactMethod = "by pony express"


Jun 22, 2011 at 12:38 PM


I'm experiencing problems setting the dateTime when executing the commandline above.

Do you have any idea what could cause the error? I copied the set-scsmobject part of the command line and executed it.

This is the error message:

Set-SCSMObject : Simple object value was not the proper type.
At line:1 char:104
+ Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR487" | Set-SCSMObject <<<<  -proper
tyHashtable @{
    + CategoryInfo          : ObjectNotFound: (21/08/2011 13:33:11:DateTime) [Set-SCSMObject], InvalidSimpleObjectValu
    + FullyQualifiedErrorId : Could not assign date ,SMLets.SetSMObjectCommand


Jun 22, 2011 at 5:18 PM

if you are using the exact line as above, it could be a misrecognition of the datetime format. What culture is your OS set to?