1

Closed

Set-SCSMobject unable to set datetime field

description

Hi,
 
I wanted to set a dateTime value into the TargetResolutionTime of an incident. This fails always with an error message (see below).
I use the SMLets Beta 3 and SCSM2010 SP1 CU2.
 
Since I'm able to update other fields and I'm sure I used a dateTime value, I guess it is a bug in the SMLets.
But may be I'm wrong. In that case please let me know.
BTW: I also used (Get-Date) to set the dateTime value.
 
Thanks for your help
 
Oliver
 
--- snip ---
PS D:\SCSMscripts> Get-SCSMObject -Class (Get-SCSMClass System.WorkItem.Incident$) -Filter "ID -eq IR164" | Set-SCSMObject -debug -PropertyHashtable @{ TargetResolutionTime = [datetime]::now }
DEBUG: Attempting to find property TargetResolutionTime
 
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
DEBUG: PROPERTY TargetResolutionTime == TargetResolutionTime Result: 0
 
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
DEBUG: Assigning 17/06/2011 12:32:36 to TargetResolutionTime
 
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
VERBOSE: Want to set TargetResolutionTime(datetime) to 17/06/2011 12:32:36
 
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
 
Confirm
Simple object value was not the proper type.
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
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 IR164" | Set-SCSMObject <<<< -debug
    -PropertyHashtable @{ TargetResolutionTime = [datetime]::now }
    • CategoryInfo : ObjectNotFound: (17/06/2011 12:32:36:DateTime) [Set-SCSMObject], InvalidSimpleObjectValu
      eException
    • FullyQualifiedErrorId : Could not assign date ,SMLets.SetSMObjectCommand
       
      VERBOSE: Adding 9d0b4646-5f78-0988-e59d-7093509cb7b6 to change list
       
      Confirm
      Continue with this operation?
      [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
       
      Confirm
      Are you sure you want to perform this action?
      Performing operation "Set-SCSMObject" on Target "SMObjects".
      [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
      PS D:\SCSMscripts>
      --- snap ---
Closed Jul 9, 2015 at 11:36 PM by FreemanRU
Fixed in beta 5

comments

radtravis wrote Jun 24, 2011 at 4:54 PM

This is likely a bug on how we handle datetime property values on non-EN-US format OS. It works fine on EN-US but not on other locales.

Oliver_22 wrote Jul 4, 2011 at 2:33 PM

One important hint: I recognized in my installation (previosly set to Luxembourgish date/time format), that also the date/time format for the system account had to be set to EN-US.

wrote Feb 22, 2013 at 12:02 AM

wrote Aug 7, 2013 at 12:01 AM

wrote Aug 7, 2013 at 12:10 AM

FreemanRU wrote Jul 9, 2015 at 11:36 PM

Fixed in beta 5

wrote Jul 9, 2015 at 11:36 PM

wrote Jul 9, 2015 at 11:37 PM