I need some help!
I have a one-liner that extracts specific user data from AD and saves it in to a CSV file. Â One of those attributes is proxyAddresses from which I only need to extract the primary SMTP and X400 addresses i.e. where X400 and SMTP are in uppercase. The addresses are separated in the string by a space which needs replacing by a semi-colon. Â Any idea how I can achieve this?
get-ADobject -filter 'displayname -like "XYZ*" -and mail -like "*@*"' -properties sn,givenName,DisplayName,title,mail,physicalDeliveryOfficeName,telephoneNumber,facsimileTelephoneNumber,proxyAddresses | Select-Object sn,givenName,displayName,physicalDeliveryOfficeName,telephoneNumber,facsimileTelephoneNumber,title,mail,BuildingCode,@{name="Proxies";expression={[string]$_.proxyAddresses}} | ConvertTo-Csv -NoTypeInformation | foreach {$_ -replace '"', ''} | out-file $exportFile