question

LukKeller-7596 avatar image
0 Votes"
LukKeller-7596 asked AndreasBaumgarten commented

Get-ADUser pipeline Property + Properties

Hello,

Im a newbie around Powershell commands and im startin as a AD administartor. Im having trouble to put together these two commands + exporting them. I need to list all users with a1 at the start of their name + add their Enabled status + add their description and then export it into separate columns in excel. Can anyone help me with this please?


Get-ADUser -Filter 'Name -like "a1*"'-Property Enabled | FT Name, Enabled -Autosize


Get-ADUser -Filter 'Name -like "a1*"' -Properties Description | Format-Table Name,Description

windows-server-powershellwindows-active-directory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AndreasBaumgarten avatar image
1 Vote"
AndreasBaumgarten answered AndreasBaumgarten commented

Hi @LukKeller-7596 ,

please try this:

 Get-ADUser -Filter 'Name -like "a1*"' -Property Enabled, Description |
     Select-Object Name, Enabled, Description |
         Export-Csv -Path c:\Temp\exportuser.csv -NoTypeInformation -Encoding UTF8


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Awesome! It works perfectly! Thank you so much. Only one question left to ask, is there some way to fix description export to support specific characters? We have descriptions in Czech language so instead of Ž, Č, Ř, Ě, Ý and etc. it showing question marks.

0 Votes 0 ·

Hi @LukKeller-7596 ,

I updated the script above. Please try again.


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

0 Votes 0 ·

Now it works like a magic. Thank you so much!!

0 Votes 0 ·
Show more comments