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?
You're casting it to [string] to unroll the array, and that's separating the members with a space. Powershell has an automatic variable called $OFS (for Output Field Separator) that determines what separator character(s) will be used when you do that. The default value is a space. If you change that to a semi-colon before you run that script, it will use that instead of the space.