Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Query Active Directory for Computer Account Enabled/Disabled

I'm trying to get a list of computer accounts in AD, with the status of whether they're enabled or disabled. 
 
I know how to do this for User Accounts, by expanding the User table, and looking at UserAccountControl, then converting the binary values to useful information. 
 
However, I can't find a similar field in the Computer table for computer objects. 
 
Searching turned up two posts asking for this information in the past, but none of the responses provided this information.
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi DSWigfield,

I test this in my enviornment, you could choose computer table, tehn expand User record in it , you will see the  UserAccountControl in it

let
    Source = ActiveDirectory.Domains("domian"),
    domain name = Source{[Domain=" domain namexxx"]}[#"Object Categories"],
    computer1 = domain name{[Category="computer"]}[Objects],
    #"Expanded user" = Table.ExpandRecordColumn(computer1, "user", {"msDS-User-Account-Control-Computed", "userAccountControl"}, {"user.msDS-User-Account-Control-Computed", "user.userAccountControl"}),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded user",{"user.userAccountControl", "computer", "displayName"})
in
    #"Removed Other Columns"

Then you could know the status based on value

You could refer to ms-DS-User-Account-Disabled attribute and UserAccountControl Attribute/Flag Values for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
dax
Community Support
Community Support

Hi DSWigfield,

I test this in my enviornment, you could choose computer table, tehn expand User record in it , you will see the  UserAccountControl in it

let
    Source = ActiveDirectory.Domains("domian"),
    domain name = Source{[Domain=" domain namexxx"]}[#"Object Categories"],
    computer1 = domain name{[Category="computer"]}[Objects],
    #"Expanded user" = Table.ExpandRecordColumn(computer1, "user", {"msDS-User-Account-Control-Computed", "userAccountControl"}, {"user.msDS-User-Account-Control-Computed", "user.userAccountControl"}),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded user",{"user.userAccountControl", "computer", "displayName"})
in
    #"Removed Other Columns"

Then you could know the status based on value

You could refer to ms-DS-User-Account-Disabled attribute and UserAccountControl Attribute/Flag Values for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.