I read out all AD-User out of different OUs.
I Need the function Append
but if i do it with this it doesn't overwrite the CSV Export if i run the Script again.
If i do it without the function Append it overwrites all other OUs and all I see in the End is the last OU.
My source code:
Foreach($OU in $OUs) {
Get-ADUser -Filter * -SearchBase $OU -Properties $Properties| Select-Object $Properties |export-Csv -Append $Export -Encoding UTF8
}