0

I need to determine if a computer is in fact a laptop with wifi capabilities (with emphasis on wifi rather than laptop). More precisely, I want to distribute a piece of software I wrote via WSUS and Local Update Publisher to those clients. To this end, I want to create appropriate "Package installable rules", that is simple rule used bay the Windows Update Service on the client to decide beforehand whether or not an update/installation package is applicable. Typically, such "installabel rules" are logical combinations of rules of type "File exists", "Registry Key exists", "WMI Query", "MSI Product Installed", so I'd prefer one of those methods. The method I hope someone here can help me find should work with Win 7/Vista, preferably also with XP.

My guess is that WMI query is the way to go, but I have little experience in that. I have found that one can e.g. query for EnclosureType and that might detect a laptop. However, I would be much happier if an actually available wifi interface would be detected. Does anyone have an idea how to approach this?

If there is anything you need me to clarify, don't hesitate to comment.

Hagen von Eitzen
  • 816
  • 3
  • 15
  • 41

1 Answers1

1

To test whether the WLAN AutoConfig service is running using WMI you can use this query: SELECT * FROM Win32_Service WHERE Name = 'Wlansvc' AND State = 'Running'. However relying on the service status might be misleading if the service is started manually without a wireless card present.

You can also search the adapter names for anything containing "wireless" with this query: SELECT * FROM Win32_NetworkAdapterConfiguration WHERE Description LIKE '%wireless%' (% is WMI's wildcard for zero or more characters).

There is another class in the root\wmi namespace (previous queries were using the default root\cimv2 namespace) that represents an 802.11 configuration entry, however I found out that support for it is not always present so it shouldn't be used as the only method of detection: SELECT * FROM MSNdis_80211_Configuration.

I've had no experience with using WSUS Local Update Publisher so I can't help you with the exact implementation of WMI queries, but you can test them in PowerShell using Get-WmiObject -Query "<query>" or Get-WmiObject -Query "<query>" -Namespace <namespace> if you require a custom namespace.

mprill
  • 584
  • 3
  • 10
  • Thanks a lot! At least the first query seems to do what it is supposed to do, so I'll next try all those refinements with the other criteria as well. – Hagen von Eitzen Dec 18 '12 at 08:42