Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WMI Determine Workstation or Laptop (Portable PC)

Posted on 2011-02-25
5
Medium Priority
?
4,723 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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

885 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