ColliersInternational
asked on
Powershell - Get ProxyAddresses and output to seperate row
I need to grab a list of proxyaddresses from users, contacts and groups and output to a text file, with only one proxy address listed per line in the output file, but also filter out any proxyaddresses that do not match "domain1.com" i.e
address1@domain1.com
address2@domain1.com
address3@domain1.com
I have the below powershell script which outputs on screen what I want,
get-qadobject -OrganizationalUnit -sizeLimit 0 -ip proxyAddresses |
select-object -expand proxyAddresses | where {$_.endswith('@domain1.com ')}
however when exporting to csv the output is the below format
#TYPE System.String
"Length"
"20"
"20"
"20"
Any ideas on how i can get a nice export file with only the filtered proxyaddresses listed on a seperate line?
address1@domain1.com
address2@domain1.com
address3@domain1.com
I have the below powershell script which outputs on screen what I want,
get-qadobject -OrganizationalUnit -sizeLimit 0 -ip proxyAddresses |
select-object -expand proxyAddresses | where {$_.endswith('@domain1.com
however when exporting to csv the output is the below format
#TYPE System.String
"Length"
"20"
"20"
"20"
Any ideas on how i can get a nice export file with only the filtered proxyaddresses listed on a seperate line?
What is the command that you are using to export to csv?
Is it fine if we use the Exchange commands instead of QAD cmdlets? Hope you are doing it for Exchange/email enabled objects only.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly the ouput I required. Thanks.
I'm not big programmer in PowerShell, so please check that only for your information and try to use that or wait for another expert for professional help
In the meantime, if you're interested, please similar thread at this forum where yo_bee had the same problem but in different cmd-let output. He provided at the end all required steps
https://www.experts-exchange.com/questions/27829796/PowerShell-Output-to-CSV-question.html
Regards,
Krzysztof