When I was trying to configure a scheduled task to use a specific service account the task manager did not want to accept my service account credentials.
I wanted a quick way to find out if the credentials I was using where correct. Some quick browsing on the web lead me to this.
Very useful when setting up new wmi filters.
GPO WMI filters can get screwed up when edited. Quick way of testing a WMI filter is available using Powershell:
- Grab the GPO WMI filter from GPMC and put it into clipboard
- in Powershell console:
gwmi -Query ‘Paste your WMI filter here’
write gwmi -Query ‘ (single qoute)
paste in your wmi filter
‘ (single qoute)
Result could look like this:
gwmi -Query ‘SELECT ProductType, CSName FROM Win32_OperatingSystem WHERE (ProductType = “1”) AND Not CSName = “CB002021”)‘
When any results are returned WMI filter evaluates to $true (GPO applies), else $false (GPO does not aplly)
Don’t forget that you get the luxury to test against multiple computer just by adding the -Computername parameter:
gwmi -Query ‘SELECT ProductType, CSName FROM Win32_OperatingSystem WHERE (ProductType = “1”) AND Not CSName = “CB002021”)‘ -Computername PC01,PC02
For the hundredth time I Googled how to convert String to DateTime.
It’s time I put it in my memory extension.