We help IT Professionals succeed at work.
Get Started

Combining output powershell into csv and html

techdrive
techdrive asked
on
75 Views
Last Modified: 2016-03-01
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
Comment
Watch Question
The More I know, the more I don't know
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE