Avatar of techdrive
techdrive
Flag for United States of America

asked on 

Combining output powershell into csv and html

I have these three commands here that works well with the output.What I would like to do is combine all three of these in one script and have the out put to come out in a csv and also a html with the following



#First command
get-mailbox -resultsize:unlimited | foreach { ($_.emailaddresses -like "smtp:*").Count -gt 1 -and $_.primarysmtpaddress -match '^[\W]' -or } | Select Displayname, emailaddress, alias

Open in new window


#Second command
get-mailbox | foreach {$_.recipienttypedetails -like "shared*"} | Select Displayname, emailaddress, alias

Open in new window


#Third Command
get-mailbox -resultsize:unlimited | where {$_.displayname -notmatch '^[\W]' } | Select Displayname, emailaddress, alias

Open in new window





Here are the results for the first command
 
      Displayname, emailaddress, alias
      Displayname, emailaddress, alias
      Displayname, emailaddress, alias



      Here are the results for the second command


      Displayname, emailaddress, alias
      Displayname, emailaddress, alias
      Displayname, emailaddress, alias


      Here are the results for the third command

      Displayname, emailaddress, alias
      Displayname, emailaddress, alias
      Displayname, emailaddress, alias
PowershellExchange

Avatar of undefined
Last Comment
David Johnson, CD

8/22/2022 - Mon