Group Policy WMI filtering: How do I query for laptops or desktops?

Hi,

I know, this question has already been asked many times but now those queries are not working for Windows 7 SP1. For example:

select * from Win32_SystemEnclosure where (ChassisTypes = 8 OR ChassisTypes = 9 OR ChassisTypes = 10)

When I try to validate this query, it says, invalid query. Moreover, I can't use the battery option because it always detect AIO (All in one) devices as laptops. Same as battery, I can't use the battery option too because we do have NUCs and they use laptop memory type.

Most of our laptops are 64 bit.
Is there any other way?
LVL 2
A1opusAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

McKnifeCommented:
Allow the question: what NUC devices are wrongly detected as laptops if you use "the battery option"? The battery wmi filter has always worked for me, so far and I have never heard that anyone needed anything else to detect laptops, nor have I heard of misdetections, yet.
0
Muhammad MullaCommented:
There's also PCSystemType under the Win32_ComputerSystem class https://msdn.microsoft.com/en-us/library/aa394102%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
A1opusAuthor Commented:
Hi McKnife,

Sorry, my bad, it's memory. NUCs use same memory modules as laptops.
0
A1opusAuthor Commented:
Thanks OfflineGeek

I have used that class and created the following WMI query:

Select * from Win32_ComputerSystem where Name LIKE "%-L" OR name Like "%-L1"  OR Name LIKE "%-L2"  OR Name LIKE "%-L3" OR  Name LIKE "%-L4 OR Name LIKE "%-L5 OR Name LIKE "%-L6"

It is working like a charm.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.