Showing results for 
Search instead for 
Did you mean: 
New Member

query enabled computers from AD

I'm trying to query computer objects from AD.

How can I identify the enabled/disabled status?

Any suggestions?

Super User IV
Super User IV

Re: query enabled computers from AD


You would do a bitwise AND with decimal 2 to determine if it is disabled:



(userAccountControl & 2) != 0) // disabled




Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Helpful resources

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors