locked
Question about Enumerations and Lists SCSM 2012 RRS feed

  • Question

  • I added some additional fields to the Change Status list in the console, but when I look at the change status enum in powershell, I only see the standard values that come OTB... Is there something I need to do to create these values as enums? 

    Everything seems to work otherwise, I can still use powershell to set the CR status to one of the custom list entries...

    But when I try to do any sort of filtering in powershell is where I seem to run into an issue...  But I might just have my code wrong...

    I dont have an example in front of me, but if you need one, let me know and I will post one.

    SCSM 2012


    Joshua Fuente

    Friday, January 11, 2013 5:02 PM

Answers

  • Hey

    When you added the entry in the GUI you may find it by using "Enumxxxxx" as the ID, then you have all the information you need. This is a kind of ID that is set automatically when adding entries through the GUI.

    Cheers
    Marcel


    SCSMfaq // Blog --> http://blog.scsmfaq.ch // Twitter --> #scsmfaq // Business --> http://www.itnetx.ch

    • Marked as answer by NachoScript Tuesday, January 22, 2013 1:46 PM
    Monday, January 14, 2013 1:20 PM
  • Maybe this helps to use the status of a change request as a filter/criteria 

    $DisplayNChangeStatus = 'Displayname of Change status'
    $ChangeStatus = Get-SCSMEnumeration|?{$_.DisplayName -eq $DisplayNChangeStatus}

    The variable $ChangeStatus should contain all information. 

    Hope this helps.


    Andreas Baumgarten | H&D International Group

    • Marked as answer by NachoScript Tuesday, January 22, 2013 1:46 PM
    Tuesday, January 15, 2013 12:04 AM

All replies

  • Hey

    When you added the entry in the GUI you may find it by using "Enumxxxxx" as the ID, then you have all the information you need. This is a kind of ID that is set automatically when adding entries through the GUI.

    Cheers
    Marcel


    SCSMfaq // Blog --> http://blog.scsmfaq.ch // Twitter --> #scsmfaq // Business --> http://www.itnetx.ch

    • Marked as answer by NachoScript Tuesday, January 22, 2013 1:46 PM
    Monday, January 14, 2013 1:20 PM
  • Maybe this helps to use the status of a change request as a filter/criteria 

    $DisplayNChangeStatus = 'Displayname of Change status'
    $ChangeStatus = Get-SCSMEnumeration|?{$_.DisplayName -eq $DisplayNChangeStatus}

    The variable $ChangeStatus should contain all information. 

    Hope this helps.


    Andreas Baumgarten | H&D International Group

    • Marked as answer by NachoScript Tuesday, January 22, 2013 1:46 PM
    Tuesday, January 15, 2013 12:04 AM
  • Ok, that makes since, thanks...

    Any ideas on this one?

    $DisplayNChangeStatus = 'approved'
    $ChangeStatus = Get-SCSMEnumeration|?{$_.DisplayName -eq $DisplayNChangeStatus}
    Get-SCSMObject -Class $CRClass -Filter "Status -eq $changestatus" | select title
    
    Get-SCSMObject : Status_72C1BC70_443C_C96F_A624_A94F1C857138='Approved Approved Approved' -- Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-x
    xx-xxxxxxxxxxxx).
    At C:\Users\jfuente\AppData\Local\Temp\2\Untitled1.ps1:9 char:15
    + Get-SCSMObject <<<<  -Class $CRClass -Filter "Status -eq $changestatus" | select title
        + CategoryInfo          : NotSpecified: (:) [Get-SCSMObject], UnknownDatabaseException
        + FullyQualifiedErrorId : Microsoft.EnterpriseManagement.Common.UnknownDatabaseException,SMLets.GetSMObjectCommand
    


    Joshua Fuente

    Wednesday, January 16, 2013 3:56 AM