PowerShell and Service Manager

Marcos André Machado da Silva 0 Reputation points
2023-10-27T18:21:56.11+00:00

I want to pull some information and Incidents from the Service manager through PowerShell, I'm using the command:

Get-SCSMClassInstance -Class (Get-SCSMClass -Name System.WorkItem.Incident) -Filter 'Id -eq "IR1131310"'

However, the data that I really need (to filter) does not appear in the powershell imports, in fact there are 2, Site and Classification category (or site):

[enter image description here

](https://i.stack.imgur.com/mQKhr.png)

Is there any method for me to pull the information? Thanks

Service Manager
Service Manager
A family of System Center products for managing incidents and problems.
209 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,378 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,071 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 96,606 Reputation points MVP
    2023-10-27T20:45:48.3066667+00:00

    Hi @Marcos André Machado da Silva ,

    Instead of Get-SCSMClassInstance you can use Get-SCSMObject:

    Get-SCSMObject -Class (Get-SCSMClass -Name System.WorkItem.Incident) -Filter "Id -eq IR1131310" | Select-Object *
    

    The result will look like this:

    enter image description here


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards Andreas Baumgarten

    1 person found this answer helpful.
    0 comments No comments