Weekly Tip 66

Get Collections that use an OU as their Query Rule

This script will output, as a CSV file, the collection names and IDs of collections that are using an OU as their query.

Note: This script targets device-based collections. It can easily be modified for user by changing lines 6 and 25. Change the CollectionType from “2” to “1” in like 6, and change get-cmdevicecollectionquerymembershiprule to get-cmuserollectionquerymembershiprule in line 25.

Instructions:

Modify line 1 for your CSV file. Provide the path and file name.

Modify lines 2 and 3 to the name of your ConfigMgr primary site server and site code.

Mody line 30 to include the domain and OU that is being used in your queries, leaving the quotes and wildcards.

Example: if ($coll_query -like “*CONTOSO.COM/Desktops*”) {

Disclaimer

All content provided on this blog is for information purposes only. Windows Management Experts, Inc makes no representation as to accuracy or completeness of any information on this site. Windows Management Experts, Inc will not be liable for any errors or omission in this information nor for the availability of this information. It is highly recommended that you consult one of our technical consultants, should you need any further assistance.

[download id=”5157″]

Share:

Facebook
Twitter
LinkedIn

Contact Us

=
On Key

More Posts

WME Cybersecurity Briefings No. 007
Cyber Security

WME Security Briefing 27 April 2024

Critical Security Advisory | US Federal Agencies Ordered to Remove Suspect Foreign Software Overview The latest guidelines from the US Cybersecurity and Infrastructure Security Agency (CISA) insist that federal agencies must identify and remove software products linked to

Read More »
WME Cybersecurity Briefings No. 006
Cyber Security

WME Security Briefing 22 April 2024

Critical Update on FISA Section 702 Reauthorization Overview The expiration date of Section 702 of the Foreign Intelligence Surveillance Act (FISA) is near. So, Congress is looking to reauthorize crucial US spy programs. The provision is

Read More »
WME Cybersecurity Briefings No. 005
Cyber Security

WME Security Briefing 15 April 2024

E-Commerce Security Alert: Unveiling Magecart’s Persistent Backdoor Overview Malicious activities by Magecart attackers have been reported. They are targeting Shopify’s content delivery network (CDN) by creating fake Shopify stores. The backdoor method has enabled them to

Read More »
WME Cybersecurity Briefings No. 004
Cyber Security

WME Security Briefing 11 April 2024

Mispadu Trojan Exploits Windows Vulnerability to Target Financial Data Overview The Mispadu banking trojan has intensified its operations as it’s exploiting an already patched Windows SmartScreen flaw. Since its initial identification in 2019, Mispadu has primarily preyed on

Read More »
Be assured of everything

Get WME Services

Stay ahead of the competition with our Professional IT offerings.

=