Need help with a script.
I can export the names of the users in a group but I am trying to get more information about the user. I have the following script that will export the users to a CSV file.
Get-ADGroupMember -Identity Group you want | Export-Csv C:\Temp\File.csv
I want to use a foreach statement to add the following:
get-ADuser -Properties * | Select-Object -Property Name,SamAccountName,Description,EmailAddress,LastLogonDate,Manager,Title,Department,whenCreated,Enabled,Organization | Sort-Object -Property Name | export-csv -path C:\temp\test.csv
Can someone help me put the script together.
Thanks for your help.