How to get list of all attribute in AD

Richa Kumari 286 Reputation points
2024-04-19T11:35:32.11+00:00

Hello,

How To get list of all attribute in AD(default and custom attribute ) in csv file.

Thanks

Rich

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,886 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,379 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,071 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 10,845 Reputation points MVP
    2024-04-19T12:38:26.8233333+00:00

    Use the following:

    # Import Active Directory module
    Import-Module ActiveDirectory
    # Retrieve schema information for all attributes
    $attributes = Get-ADObject -SearchBase (Get-ADRootDSE).schemaNamingContext -LDAPFilter "(objectClass=attributeSchema)" -Properties * | Select-Object Name, Description
    # Export the attributes to a CSV file
    $attributes | Export-Csv -Path "AD_Attributes.csv" -NoTypeInformation
    
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin