Tickets status check
This example demonstrates how to reopen the tickets if they were closed automatically. We need to supply respective ticket numbers to the $tid
variable. You can get the ticket ID either from the SCSM console or the respective PowerShell cmdlet:
Import-Module SMLets # Class declaration for Service Request $Class = Get-SCSMClass –Name System.WorkItem.ServiceRequest $tid = 'SR123456' Get-SCSMObject -Class $Class -filter "Id -eq $tid" | Set-SCSMObject -Property Status -Value "In Progress"
We can use the preceding script block for incidents by replacing the service request declaration with the $Class = Get-SCSMClass –Name System.WorkItem.Incident
incident declaration.
We just need to provide the respective ID number with the required class declaration based on our environment.