Solved

WMI Determine Workstation or Laptop (Portable PC)

Posted on 2011-02-25
5
4,222 Views
Last Modified: 2012-06-27
I am creating WMI Filters in AD Windows 2008 Environment.  I would like some policies to be applied to Workstations and some applied to Laptops only.  I have looked at the chassies and see numourous for each.  Is there a way to do this in a better manner with WMI, can you give me the WMI code to do this?

0
Comment
Question by:m698322h
5 Comments
 
LVL 58

Expert Comment

by:tigermatt
ID: 34981356

If I recall correctly, the problem I found when attempting this is that the chassis information (the perfect way to determine the type of machine) was in a WMI array, which a GPO WMI filter can't process.

What I wound up doing was using the presence of a Battery and assuming that meant the machine was a laptop. Of course, this is fraught with issues and there are cases such a policy could apply to PCs (if any PC has a UPS attached for example). However it was the best I could do out of a bad job.

The WMI filter I use for my Workstation is a laptop filter is:
SELECT * FROM Win32_Battery WHERE Description LIKE '%'

Open in new window


When setting policies for laptops and workstations, I set the policy I want to apply to workstations in a workstation policy, then link a laptop policy with higher precendence which uses that WMI filter, and set the setting which is supposed to apply to laptops.

I only set a couple of things to do with roaming profiles in this manner, and for the most part, it seems to work fine. I haven't heard of any significant issues, but don't rely on it for enforcing security or securing portable machines for compliance reasons etc because it isn't foolproof and there are cases where it may not apply.

-Matt
0
 
LVL 22

Expert Comment

by:Joseph Moody
ID: 34981669
Select * from Win32_Battery where BatteryStatus <> 0
0
 
LVL 57

Accepted Solution

by:
Mike Kline earned 500 total points
ID: 34981685
Hey Matt...running into you a lot today :)

Ok my WMI answer is a direct "steal" from Darren Mar-Elia's GP list from 2008.  This is one of the posts I have starred.  He had a contest based on this request and someone came up with a slick query

*****From Joel C on Darren's list*****

Select * from Win32_PhysicalMemory where FormFactor != 12

Returns True on computers that do not have SoDimm form factor memory and False on computers with SoDimm form factor memory.  The assumption is that all laptops will have this style memory and desktops will not.  Works in my environment, but it's a pretty small environment.

************************************

Group Policy Preferences have good item level targeting options that may help   http://technet.microsoft.com/en-us/library/cc733022.aspx

- battery present
-  portable computer targeting

Thanks

Mike
0
 
LVL 22

Expert Comment

by:Joseph Moody
ID: 34981696
Maybe one day, I'll be a genius too...
0
 

Expert Comment

by:queens2007
ID: 37827979
What about machines that do not use SODIMM such as Dell Lattitude laptops.
They will use a formfactor 8 chip ;)
However, the devicelocator will always be DIMM_A, or B or C or D depending on how many chips are in the lattitude.

So for an even more accurate targetting of non-laptop devices including those pesky Dells, I use:
Select * from Win32_PhysicalMemory where FormFactor != 12  and devicelocator != "DIMM_A" and devicelocator != "DIMM_B"
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know all systems administrator at some time or another has had to create a script to copy file from a server share to a desktop. Well now there is an easy way to do this in Group Policy. Using Group policy preferences is not hard. The first thing …
Companies that have implemented Microsoft’s Active Directory need to ensure that the Active Directory is configured and operating properly. If there are issues found and not resolved, it eventually leads the components to fail or stop working and fi…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now