run gpo wmi filter if empty

חזי אנג'ל 6 Reputation points
2021-06-18T05:10:05.46+00:00

I have wmi filter script that i need him run gpo if filter is empty
Is there a syntax that can run this?

my syntax is

Get-wmiobject -query 'select licensestatus from softwarelicensingproduct where LicenseStatus like 1'

and i dont want to run gpo in computers that have LicenseStatus =1
in the computers with LicenseStatus =1 has all the numbers that the computer does not have LicenseStatus =1
I am looking for a way to run gpo on all computers where there is no haveLicenseStatus =1

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,456 questions
Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,742 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,850 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Vicky Wang 2,646 Reputation points
    2021-06-21T09:53:03.947+00:00

    under: User Config > Policies > Admin Templates

    Depending on the setting you want to deploy, you can replace ADM
    templates with GPP Registry - the registry keys can be found either in
    the ADMX files or at http://gpsearch.azurewebsites.net

    Sample for that scenario:
    http://evilgpo.blogspot.de/2012/03/how-to-save-my-screen.html


  2. Vicky Wang 2,646 Reputation points
    2021-06-30T09:20:30.57+00:00

    Hi,
    Thank you for your understanding and support.
    Did you follow the correct steps provided?
    It can be successful in my environment, so you can follow this step
    Hope this information can help you
    Best wishes
    Vicky

    0 comments No comments

  3. Vicky Wang 2,646 Reputation points
    2021-07-05T06:49:43.83+00:00

    Hi,

    Welcome to share your current situation if there are any updates.

    Please feel free to let us know if you need further assistance.

    Best Regards,
    Vicky

    0 comments No comments