Jump to content

Recommended Posts

Posted (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 by FN-GM
Posted (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 by Arthur
  • Thanks 1
Posted (edited)

Thanks :)

 

Number 2 is unknown?

 

How would one use multiple numbers please?

Edited by FN-GM
Posted
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. :)

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...