How To Get List Of Custom Attributes From Active Directory Via PowerShell
Query King | Mon, 12 Dec 2022 at 06:17 hours | Replies : 2 | Points : 100
Category : Active Directory
How to get list of all users Custom Attributes from Active Directory via PowerShell. I need to get extension Attributes for all AD users.
This Question is already solved Click To See The Answer
Solved
Hi,
Please try below powershell command to get list of all users Custom Attributes from Active Directory via PowerShell.
$Users= Get-ADUser -properties * -Resultpagesize 0 -Filter *
ForEach ($Count in $Users) { Get-ADUser $Count -Properties UserPrincipalName, emailAddress, SAMAccountName, extensionAttribute1, extensionAttribute2, extensionAttribute3, extensionAttribute4, extensionAttribute5, extensionAttribute6, extensionAttribute7, extensionAttribute8, extensionAttribute9, extensionAttribute10, extensionAttribute11, extensionAttribute12, extensionAttribute13, extensionAttribute14, extensionAttribute15 | Select UserPrincipalName, emailAddress, SAMAccountName, extensionAttribute1, extensionAttribute2, extensionAttribute3, extensionAttribute4, extensionAttribute5, extensionAttribute6, extensionAttribute7, extensionAttribute8, extensionAttribute9, extensionAttribute10, extensionAttribute11, extensionAttribute12, extensionAttribute13, extensionAttribute14, extensionAttribute15 | Export-Csv -Append All_Users.csv }
Thanks, i got the expected list of Custom Attributes.