Link to home
Create AccountLog in
Active Directory

Active Directory

--

Questions

--

Followers

Top Experts

Avatar of georgedschneider
georgedschneider🇺🇸

WMI Filter for GPO
I have a GPO that runs a script.  The problem is I only want it to apply to Windows 2000 workstations or servers.  Is there a way to createa WMI filter through GPMC to only apply if the OS is Windows 2000?

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of lkingpinllkingpinl

depneding on which programming language your script is executed in, this can be done in the script itself.
Or alternatively, in Active Directory if you create OU's based on OS then put all the PC's with Windows 2000 in that OU and apply the GPO to only this OU.
 

Avatar of Vikas ShahVikas Shah🇮🇳

You can go through this, it has the details with example :

http://computerperformance.co.uk/vbscript/wmi_filter.htm

However, as you mentioned that the script should run only if the OS is Windows 2000, for that below mentioned is the code.

Root\CimV2; Select * from Win32_OperatingSystem where Caption = "Microsoft Windows 2000 Server"

above mentioned script says that, Only target computers running Windows XP Professional will have this script running on it.

Please let me know if you need further assistance on this.

Regards,

Vikas Shah

Avatar of Vikas ShahVikas Shah🇮🇳

You can even go through this as well:

http://technet.microsoft.com/en-us/library/cc779036.aspx

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of bluntTonybluntTony🇬🇧

Windows 2000 doesn't support WMI filters - it will ignore them and apply the GPO anyway. Do you have pre-2000 operating systems as well?

If not, you could apply a filter such as:

Namespace: root\CIMV2
Select * from WIN32_OperatingSystem where Version<5.1

Version 5.1 is XP, so anything XP and beyond will not apply this GPO. The pre XP/2003 machines will ignore the filter and apply the GPO.

You can create a WMI filter using GPMC (right click 'WMI Filters' | New)

Avatar of Mike KlineMike Kline🇺🇸

For Windows 2000 the WMI filter is always ignored and the GPO is applied.
So you could write a filter based on the build number, the build number of Windows 2000 is 2195  http://support.microsoft.com/kb/262255
WMI filter would be
SELECT * FROM Win32_OperatingSystem WHERE BuildNumber = 2195
The GPO will only apply if the WMI filter evaluates to TRUE.  So for your XP, 2003, and Vista boxes it would be false and not apply.
Thanks
Mike
 

Avatar of bluntTonybluntTony🇬🇧

Basically if you have pre-2000 operating systems as well as 2000 operating systems, WMI is not the way to go.

If you only have a small number of machines, you could put them in a security group and apply security filtering to the GPO so that it only applies to this group on machines. Or if the current structure allows, you could segregate them into an OU and apply the GPO to this.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Mike KlineMike Kline🇺🇸

hmmm my filter should have come out as
SELECT * FROM Win32_OperatingSystem WHERE BuildNumber = '2195'

Don't get too complicated.  Put all W2K computer in their own OU and apply the GPO to only that OU.  Simple
 

ASKER CERTIFIED SOLUTION
Avatar of georgedschneidergeorgedschneider🇺🇸

ASKER

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account
Active Directory

Active Directory

--

Questions

--

Followers

Top Experts

Active Directory (AD) is a Microsoft brand for identity-related capabilities. In the on-premises world, Windows Server AD provides a set of identity capabilities and services, and is hugely popular (88% of Fortune 1000 and 95% of enterprises use AD). This topic includes all things Active Directory including DNS, Group Policy, DFS, troubleshooting, ADFS, and all other topics under the Microsoft AD and identity umbrella.