myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Create collection of laptops?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Create collection of laptops? Page: [1]
Login
Message << Older Topic   Newer Topic >>
Create collection of laptops? - 11/11/2008 1:58:11 PM   
khunter

 

Posts: 101
Score: 0
Joined: 9/12/2006
Status: offline
I'm running SMS 2003, SP3.  Report "Hardware 9A - Search for Computers" allows me to get a report based on model (among other things).  I need to create a collection of laptops.  I was wondering if any of the SQL experts out there knew how to take the SQL in this report and tweak into a query to find all laptops based on a value (or value w/ a wildcard, say "Latitude%") ?

It looks like the data field I need to key on is v_GS_COMPUTER_SYSTEM.Model0.

Is there a better way to generate a collection of laptops?  99% of our laptops are Dell Latitudes.  What worries me is the bosses, all of a sudden, are demanding Toshibas, so that could complicate my search.

Thanks.

KH

Post #: 1
RE: Create collection of laptops? - 11/11/2008 2:13:45 PM   
skissinger


Posts: 2293
Score: 145
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
If you have it enabled, getting it out of system_enclosure is what more people use:  http://www.myitforum.com/articles/18/view.asp?id=11662

Someone will correct me I'm sure; but you'd want a collection query along the lines of   chassistypes0 is in ("8", "9", "10", "14")  Did I miss one?  Lunchbox maybe (16)?

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to khunter)
Post #: 2
RE: Create collection of laptops? - 11/11/2008 2:55:51 PM   
khunter

 

Posts: 101
Score: 0
Joined: 9/12/2006
Status: offline
I get a syntax error when I try to import the SQL code in the link you provided into a new query.

KH

(in reply to skissinger)
Post #: 3
RE: Create collection of laptops? - 11/11/2008 3:14:35 PM   
skissinger


Posts: 2293
Score: 145
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
That's a report, not a collection query.  Also, you may not have System Enclosure enabled for inventory.  If you look at resource explorer for a sample computer, do you see System Enclosure? 

If not, you may need to enable reporting by editing sms_def.mof (on your server, in inboxes\clifiles.src\hinv), look for win32_systemenclosure, set the class to TRUE (at the top of that section from FALSE to TRUE), and change FALSE to TRUE for ChassisTypes.
Save the file; and wait a few hours.  (you're waiting for the policy to be updated to your MPs, clients to pick up the new policy, and then a couple clients to report back on the new data you've asked for).

something like this (although I grabbed this out of configmgr lab; I don't have an sms2003 lab anymore):
quote:

[ SMS_Report (TRUE), SMS_Group_Name ("System Enclosure"), SMS_Class_ID ("MICROSOFT|SYSTEM_ENCLOSURE|1.0") ]
class Win32_SystemEnclosure : SMS_Class_Template
{
   [SMS_Report (FALSE)     ]        boolean    AudibleAlarm;
   [SMS_Report (FALSE)     ]        string     BreachDescription;
   [SMS_Report (FALSE)     ]        string     CableManagementStrategy;
   [SMS_Report (FALSE)     ]        string     Caption;
   [SMS_Report (TRUE)      ]        uint16     ChassisTypes[];

... more I didn't post...


_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to khunter)
Post #: 4
RE: Create collection of laptops? - 11/11/2008 3:28:52 PM   
khunter

 

Posts: 101
Score: 0
Joined: 9/12/2006
Status: offline
It does work as a report just fine, but I need more than just the number of laptops.  I need to identify them. 

I need to do something to all my laptops via GPO.  I figured the best way to find all my laptops was to use SMS to create the list of the NetBIOS names, then export that list so I could create the membership list for my AD security group.

KH

(in reply to skissinger)
Post #: 5
RE: Create collection of laptops? - 11/11/2008 3:44:28 PM   
khunter

 

Posts: 101
Score: 0
Joined: 9/12/2006
Status: offline
At the most basic level, I'd like to create a collection of all the Dell Latitudes, IBM/Lenovo Thinkpads, and optionally any Toshiba computers in SMS.  We do have a couple of Toshiba laptops.  I think everyone's naming convention is such that I could key off of Model names.

KH

(in reply to khunter)
Post #: 6
RE: Create collection of laptops? - 11/11/2008 4:09:15 PM   
skissinger


Posts: 2293
Score: 145
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
I'm not a GPO guru, but I thought there a way to use a WMI Filter for a GPO?  If so, it's just wmi... root\cimv2, select * from win32_computersystem where model = 'ThisModel' or model = 'Othermodel' or model = 'anotherone', etc. etc. with the OR statements.  At least that way it would only be the # of model types you have to keep up to date in your WMI filter query, not adding every single new computer you get into an AD Security group.

To get your models, try this report:
select distinct model from v_GS_Computer_System

You might want to tie in the systemenclosure chassistypes so you can figure out the laptop models (note: I didn't test this, kind of went from memory, so it likely has a misspelling):
select distinct csys.model, enc.chassistypes from v_gs_computer_system csys join v_gs_systemenclosure enc on enc.resourceid=csys.resourceid

Unfortunately, because chassistypes is stored as an array, a wmi filter isn't possible using win32_systemenclosure.  That *would* have been easier.  But I can't think of how to do it directly using a WMI query.

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to khunter)
Post #: 7
RE: Create collection of laptops? - 11/12/2008 5:52:37 AM  1 votes
jmcleish

 

Posts: 513
Score: 17
Joined: 11/8/2002
Status: offline
I Use the info here:
http://www.myitforum.com/articles/1/view.asp?id=833
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcmciaBinary Value --> Start/
If value is 0 then it's a laptop.
If value is 4 then it's a desktop

I've used this quite successfully.
here is the mof edit for it: ( I added the r at the end of the class etc (for some reason i can't remember now- anyway it works!)
//PCMCIAr
#pragma namespace("\\\\.\\root\\cimv2")
#pragma deleteclass("PCMCIAr", NOFAIL)
[DYNPROPS]
class PCMCIAr
{
[key]
string Keyname;
uint32 Start;
string Group;
uint32 Tag;
uint32 Type;
uint32 ErrorControl;
};
//instance of PCMCIA
[DYNPROPS]
Instance of PCMCIAr
{
KeyName = "PCMCIA Data";
[PropertyContext("local|HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\PCMCIA|Start"),Dynamic,Provider("RegPropProv")] Start;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\PCMCIA|Group"),Dynamic,Provider("RegPropProv")] Group;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\PCMCIA|Tag"),Dynamic,Provider("RegPropProv")] Tag;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\PCMCIA|Type"),Dynamic,Provider("RegPropProv")] Type;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\PCMCIA|ErrorControl"),Dynamic,Provider("RegPropProv")] ErrorControl;
};
// PCMCIAr Reporting Class

#pragma namespace("\\\\.\\root\\cimv2\\SMS")
[SMS_Report(TRUE), SMS_Group_Name("PCMCIAr"), SMS_Class_ID("MICROSOFT|PCMCIAr|1.0")]
class PCMCIAr : SMS_Class_Template
{
[SMS_Report(TRUE), key] string KeyName;
[SMS_Report(TRUE) ] uint32 Start;
[SMS_Report(TRUE) ] string Group;
[SMS_Report(TRUE) ] uint32 Tag;
[SMS_Report(TRUE) ] uint32 Type;
[SMS_Report(TRUE) ] uint32 ErrorControl;
};

Then once your clients have sent in the HW inv (after doing all the stuff required for  a MOF edit)
the collecton query would be:
select SMS_R_System.ResourceID,SMS_R_System.ResourceType,SMS_R_System.Name,SMS_R_System.SMSUniqueIdentifier,SMS_R_System.ResourceDomainORWorkgroup,SMS_R_System.Client from SMS_R_System inner join SMS_G_System_PCMCIAR on SMS_G_System_PCMCIAR.ResourceID = SMS_R_System.ResourceId where SMS_G_System_PCMCIAR.Start = 0

Jane

(in reply to skissinger)
Post #: 8
RE: Create collection of laptops? - 11/12/2008 6:52:21 AM   
Tom_Watson

 

Posts: 126
Score: 10
Joined: 9/13/2006
Status: offline
quote:

ORIGINAL: skissinger

If you have it enabled, getting it out of system_enclosure is what more people use:  http://www.myitforum.com/articles/18/view.asp?id=11662

Someone will correct me I'm sure; but you'd want a collection query along the lines of   chassistypes0 is in ("8", "9", "10", "14")  Did I miss one?  Lunchbox maybe (16)?


I don't think a Lunchbox could be considered a laptop - http://www.myitforum.com/forums/m_137455/tm.htm for a description of a Lunch Box.  However, I have the following WQL for my "All Laptops" collection.:-

select SMS_R_System.ResourceID,
     SMS_R_System.ResourceType,
     SMS_R_System.Name,
     SMS_R_System.SMSUniqueIdentifier,
     SMS_R_System.ResourceDomainORWorkgroup,
     SMS_R_System.Client
from   SMS_R_System
inner  join SMS_G_System_SYSTEM_ENCLOSURE
     on   SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId
where  SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ("8","9","10","12","14","18","21")

This might be overkill in that I'm including Docking Station etc.

Regards,
Tom Watson

< Message edited by Tom_Watson -- 11/12/2008 6:53:23 AM >

(in reply to skissinger)
Post #: 9
RE: Create collection of laptops? - 11/12/2008 8:45:56 AM   
rlauder


Posts: 82
Score: 0
Joined: 11/27/2002
From: London, England
Status: offline
We use the System Enclosure class to identify laptops and check for ChassisTypes in ("8","9","10","12","14","21"). We don't have any Toshibas that I know of, but it catches all our Dell Latitudes and the few remaining IBM Thinkpads.

(in reply to Tom_Watson)
Post #: 10
RE: Create collection of laptops? - 11/12/2008 9:12:09 AM   
skissinger


Posts: 2293
Score: 145
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
I see 1 potential issue with using jmcleish's (cliff's) mof edit.  Some laptops are now being produced without a pcmcia slot.  Does anyone know if a laptop doesn't have that built-in, does it still report a value like a laptop would (0)?  Or does it report the desktop value (4)?

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to jmcleish)
Post #: 11
RE: Create collection of laptops? - 11/12/2008 12:05:43 PM   
jnelson993


Posts: 959
Score: 132
Joined: 2/18/2005
From: Minneapolis, MN
Status: offline
I've also seen problems for those desktops that have a PC Card adapter.  They'd have PCMCIA enabled even though they're not a laptop. I've had better luck with the chassis type.

('8','9','10','12','14','18','21')


_____________________________

Number2 (John Nelson)
MyITForum - Blog
MyITForum - Forum Posts

(in reply to skissinger)
Post #: 12
RE: Create collection of laptops? - 11/12/2008 12:38:13 PM   
khunter

 

Posts: 101
Score: 0
Joined: 9/12/2006
Status: offline
Thanks Everyone!

Tom's WQL query does the trick.  It's just what the doctor ordered. 

KH

(in reply to skissinger)
Post #: 13
RE: Create collection of laptops? - 11/13/2008 5:39:28 AM   
jmcleish

 

Posts: 513
Score: 17
Joined: 11/8/2002
Status: offline
EDIT: -

Yes- to create a desktop collection- its the reverse.
I'm really needing some coffee!!

Doh!

< Message edited by jmcleish -- 11/13/2008 5:49:41 AM >

(in reply to khunter)
Post #: 14
RE: Create collection of laptops? - 11/13/2008 6:00:45 AM   
Tom_Watson

 

Posts: 126
Score: 10
Joined: 9/13/2006
Status: offline
I'm guessing that would depend on the definition of desktop.

My definition would be any system running a desktop OS (Win2k Pro, XP, or Vista), but that is NOT a laptop.

Or...  would you say any OS, but simply has to be a desktop-type chassis (so technically if a desktop were running a server OS, you still count it as a desktop)?

So the answer would be - it depends on what you mean by desktop....

Chassis types can be found here - http://msdn.microsoft.com/en-us/library/aa387204(VS.85).aspx or http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept04/hey0921.mspx

Slightly off topic.  I was speaking to a McAfee representative about ePolicy Orchestrator 4.0.  He mentioned that they use the presence of a battery to determine if a system was a laptop or not.  I haven't seen any documentation to back that claim up though.  I'd say checking for a battery isn't the best way of checking.  I remember some old HP towers had a backup battery to allow a system to shut down cleanly if the mains power was gone.  And what happens if you take the battery out?  Does a laptop become a desktop?

Tom

(in reply to jmcleish)
Post #: 15
RE: Create collection of laptops? - 11/13/2008 7:18:14 AM   
jmcleish

 

Posts: 513
Score: 17
Joined: 11/8/2002
Status: offline
Yes Tom,
My definition of desktop is everything that is not a laptop and not a server. I've just recreated all my collections and am about to change my web reports. ARGH!
Thanks to Sherry and John for pointing out that the PCMCIA may be different. I got more newer laptops, but it left it out my older ones. I had to add "1" chassis type in then take out all the crud.

Yes- I'd seen that in the ePO documentation.. still to do that upgrade!
You would think there would be an easier way to determine this. I think we should take all the batteries out and hit the manufacturers over the head with them. Why can't they write "portable" into the BIOS somewhere?
:-)

(in reply to Tom_Watson)
Post #: 16
RE: Create collection of laptops? - 11/13/2008 10:24:01 AM   
jnelson993


Posts: 959
Score: 132
Joined: 2/18/2005
From: Minneapolis, MN
Status: offline
I'm with Tom, a desktop is pretty much machines that aren't in the list of laptops we just found with chassisType, and also don't have Server OS.  We don't get so specific as to actually care whether it's a server hardware with a desktop OS or vice versa.

_____________________________

Number2 (John Nelson)
MyITForum - Blog
MyITForum - Forum Posts

(in reply to jmcleish)
Post #: 17
RE: Create collection of laptops? - 11/13/2008 2:59:11 PM   
Tom_Watson

 

Posts: 126
Score: 10
Joined: 9/13/2006
Status: offline
quote:

ORIGINAL: Tom_Watson
And what happens if you take the battery out?  Does a laptop become a desktop?


Heh heh...  Yanked the battery out of my laptop, and queried WMI with :-

quote:

wmic.exe path Win32_Battery get *
No Instance(s) Available.


So if you use the battery method, a missing battery (faulty, away for repair etc.), would turn your laptop to a desktop.  I don't think so.

I did used to have a laptop with a broken screen though, that I just plugged a monitor into, and used it like a desktop.

Tom

(in reply to Tom_Watson)
Post #: 18
RE: Create collection of laptops? - 11/14/2008 11:34:56 AM   
Tom_Watson

 

Posts: 126
Score: 10
Joined: 9/13/2006
Status: offline
B.T.W.  Michael Niehaus just posted on the mssms list the method that MDT uses to determine desktops/laptops etc.

quote:

From: admin@lists.myITforum.com [mailto:admin@lists.myITforum.com] On Behalf Of Michael Niehaus
Sent: Friday, November 14, 2008 11:18 AM
To: mssms@lists.myitforum.com
Subject: RE: [mssms] RE: WMI condition in Task Sequence fails

This is the logic in MDT that is used to set the IsLaptop and IsDesktop variables:

Select Case objInstance.ChassisTypes(0)
Case "8", "9", "10", "11", "12", "14", "18", "21"
   bIsLaptop = true
Case "3", "4", "5", "6", "7", "15", "16"
   bIsDesktop = true
Case "23"
   bIsServer = true
Case Else
   ' Do nothing
End Select

  -Michael


Looks like you could use this logic in your collections.

PS.  Looks like they also treat 11 = Handheld as a laptop.

Tom

< Message edited by Tom_Watson -- 11/14/2008 11:42:26 AM >

(in reply to Tom_Watson)
Post #: 19
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Create collection of laptops? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.391