I am exporting domains in a transport rule and the output does not contain a header so it does not export to CSV properly.
Trying this code:
$CurrentDomains = (Get-TransportRule "domain block").SenderDomainIs
This outputs:
PS C:\Users\user> $CurrentDomains
chess.com
jen.com
bob.com
joe.com
irish.com
ND.com
goirish.com
fieldnotes.com
As you see there is no "title" so when i run an export-csv it just shows up as numbers:
$currentdomains | export-csv c:\temp\domains.csv -notype
The output of the CSV looks like this:
Length
9
7
7
7
7
9
6
11
14
I need the output to look like this with Domain as the header:
Domain
chess.com
domain2.com
domain3.com
domain4.com
fieldnotes.com
goirish.com
mydomain.com
How do I make that happen?