Reputation: 1004
In "Active Directory Users and Computers" on Windows I have the ability to view a list of all attributes and their values.
I need to somehow export this list of values so that I have one column with the attribute name and one column with the value, just like in the picture.
I tried to do this with PowerShell
Get-ADUser smith -Properties * -value | Get-Member -MemberType property | Out-File "filename.csv"
But this just gives me a list of the attribute name, not the values.
How can I export everything in the attribute editor to a file with PowerShell?
Upvotes: 2
Views: 31639
Reputation: 11
You need to use the MMC.
https://www.technipages.com/active-directory-schema-snap-in
CMD
.regsvr32 schmmgmt.dll
Now, you should be able to add the snap-in using these steps:
mmc
, then press Enter. The Microsoft Management Console opens.The Active Directory Schema option will now be available to use.
Then you select the folder inside that says Class
, and you need to look for User
class. Click on it, and it will show all of your attributes; then you only need to export the list doing right-click on the class.
NOTE: I don't know how to determine the writable attributes from this, but maybe you will figure when you will try it.
Upvotes: 1
Reputation: 4678
I'm not sure how you ended up with that code, as it contains a lot of unnecessary additions that end up with you not having what you want.
All you need to do is
Get-ADUser smith -Properties * | Out-File "filename.csv"
Upvotes: 4