Solved

WMI Determine Workstation or Laptop (Portable PC)

Posted on 2011-02-25
5
4,108 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 21

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 21

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Active directory upgrade to DFSR 4 27
Script for Password Expire Notifications 7 63
AD FSMO Issues 14 62
GPO warning 15 24
There are two modes of restricted groups GPOs. Replacing mode:   Additive mode:   How do they work? Replacing mode: Everything (users, groups, computers) that is member of the local administrators group will be cleared out. After th…
I'm sure that every Windows systems administrator has written, or at least used, a batch or VBS login script at some point in their career, whether it is to map network drives, install printers, or set some user preferences.  No more! With Window…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

707 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

13 Experts available now in Live!

Get 1:1 Help Now