Tiny script that shows all SCSM 2012 Tier Queues that are empty

The other day I had the need to get all the Tier Queues that were not set in Service Manager 2012. This tiny script does the trick!

Import-Module SMLets
Write-Output "ID,Title,TierQueue,AffectedUser,AssignedTo,Status"

# Get one -1 day
$date=(Get-Date).AddDays(-1).toString("g")

# Get all SCSM Incidents -1 day
$IR=Get-SCSMIncident -CreatedAfter $date
Foreach ($iIR in $IR)
{
    $ID=$iIR.ID
    $title=$iIR.Title
    $TierQueue=$iIR.TierQueue
    $AffectedUser=$iIR.AffectedUser
    $AssignedTo=$iIR.AssignedTo
    $Status=$iIR.Status
    
    # Get all TierQueues that are empty
    if ($TierQueue -eq "")
    {
        Write-Output "$ID,$title,$TierQueue,$AffectedUser,$AssignedTo,$Status"
    }
}

 

One thought on “Tiny script that shows all SCSM 2012 Tier Queues that are empty”

  1. good morning , I would like to consult you , as serious to know what are all incidents, manual activities for a specific _TierQueue ? and bring me user by description , title, etc. Thanks!

Leave a Reply to santiago Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.