Hello,
I have the following:
Set-QADUser -Identity $Name -ObjectAttributes @{TargetAddress=$TargetAddress}
Which will set the target address based on a variable defined above in $TargetAddress and $Name.
This will write the target address fine however I want to be able to pull out the target addresses which have a space in them and export it to a csv file. I can do an export like the below:
Get-QADUser -Title "student" -SizeLimit 0 |Where-Object {$_.TargetAddress -match "\s" -and $_.ProxyAddresses -match "\s" -and $_.cn -match "\s"}
Select-Object Title,FirstName,LastName,cn,SamAccountName,TargetAddress,ProxyAddresses,ParentContainer |
Export-Csv "c:\StudentSpaces.csv"
It seems to run through fine but produces nothing although I know there are alot of them there.
Does anyone know why?
Many Thanks
James