Social

torsdag den 9. juni 2016

Filtering on NULL in SMLets

No time since I wrote about Service Manager. Something that comes back to haunt me from time to time is filtering on NULL. I always forget how, so now I will document it, once and for all!

A script speaks a thousand words:


1
2
3
4
5
6
7
$IRClass = Get-SCSMClass system.workitem.incident$
# get all IRs where the classification is not set
Get-SCSMObject -Class $IRClass -Filter "Classification -ISNULL"

# if we need to filter on a property from a class extension, specify that exact class
$MyClassExt = Get-SCSMClass incident.extension$
Get-SCSMObject -Class $MClassExt -Filter "CustomerProperty -ISNULL"

Ingen kommentarer:

Send en kommentar

Søg i denne blog