FN-GM Posted March 24, 2020 Posted March 24, 2020 (edited) Hello, I am trying to separate 2 polices. One for laptops (and tablets etc) and one for desktops. I have this WMI that should pick out the laptops. Select * from Win32_Battery WHERE (BatteryStatus = 0) Is anyone able to help with the battery status number to use for computers without a battery please? I have tried 1 and 2 and it isn't that. Thanks Edited March 24, 2020 by FN-GM
FN-GM Posted March 24, 2020 Author Posted March 24, 2020 Actually the above is filtered on laptops as well. Odd.
Arthur Posted March 24, 2020 Posted March 24, 2020 (edited) You could try Win32_ComputerSystem or Win32_SystemEnclosure as an alternative to Win32_Battery since the latter will be unreliable if the battery in a laptop is dead or faulty. Desktop SELECT PCSystemType FROM Win32_ComputerSystem WHERE PCSystemType = 1 Mobile SELECT PCSystemType FROM Win32_ComputerSystem WHERE PCSystemType = 2 For Win32_SystemEnclosure see also: List of Win32_SystemEnclosure Chassis Types Edited March 24, 2020 by Arthur 1
FN-GM Posted March 24, 2020 Author Posted March 24, 2020 (edited) Thanks Number 2 is unknown? How would one use multiple numbers please? Edited March 24, 2020 by FN-GM
Arthur Posted March 24, 2020 Posted March 24, 2020 Number 2 is unknown? I have edited my post above. I was getting the numbers for Win32_ComputerSystem PCSystemType confused with Win32_SystemEnclosure Chassis Types. 1
FN-GM Posted March 24, 2020 Author Posted March 24, 2020 Thanks - but you still have 2 in there for mobile? Sorry if I am being stupid and missed something.
MYK-IT Posted March 24, 2020 Posted March 24, 2020 Could you use / detect chassis type? https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-systemenclosure 1
FN-GM Posted March 24, 2020 Author Posted March 24, 2020 Could you use / detect chassis type? https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-systemenclosure That's what Arthur is suggesting (I think) but I am confused around the syntax. I guess I would have to list multiple types such as Notebook, Docking Station and Tablet? Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now