Skip to content

Instantly share code, notes, and snippets.

@Torxsmind
Created April 9, 2021 13:49
Show Gist options
  • Select an option

  • Save Torxsmind/8e845fc2052339aaecd3e21b3449f3ee to your computer and use it in GitHub Desktop.

Select an option

Save Torxsmind/8e845fc2052339aaecd3e21b3449f3ee to your computer and use it in GitHub Desktop.
Get all active directory users properties
$now = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S"
$filepath = 'C:\temp\Service_Accounts_' + $now + '.csv'
Get-ADUser -Filter * -Searchbase "DC=domain,DC=com" -Properties * | Export-CSV -append -NoTypeInformation $filepath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment