Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I export a list of user accounts that are enabled from Active Directory?

0
Posted

How can I export a list of user accounts that are enabled from Active Directory?

0

When you configure the “Account options” settings for a user in Active Directory, numerical values are assigned to the UserAccountControl attribute. When a user account is disabled, the following property flag is set: Property flag Value in hexadecimal Value in decimal ACCOUNTDISABLE 0x0002 2 To export all enabled accounts, we could specify the filter as the following: (&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)) For example we could export all enabled user accounts via the following command, csvde -d “dc=,dc=” -r “(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))” -f enabled.csv Likewise, we could export all disabled user accounts via the following command. csvde -d ” dc=,dc=” -r “(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))” -f disabled.csv NOTE: There is no “!” before “userAccountControl”.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123