$date=Get-Date
$oldday=(Get-Date).AddDays(-10)
Get-ADUser-Filter*-Properties*-SearchBase"OU=syncall,DC=azureyun,DC=com"|{$_.whenCreated-le$date-and$_.whenCreated-ge$oldday}|Select-Objectname,samaccountname,Givenname,surname,Displayname,distinguishedName,userPrincipalName,title,mobile,telephoneNumber,employeeNumber,postalCode,whenCreated,company,department,streetAddress|Export-CsvC:\azureyunuser2019.csv-EncodingUTF8–NoTypeInformation