report from 2 cmdlet on 1 line

Hi, i would like to know how i could execute a script that reports all the information on 1 line (to a csv file)

Basicly i need info from get-mailbox (ProhibitSendReceiveQuota, CustomAttribute1)

from get-casmailbox (activesyncenabled, Owaenabled)

and get-aduser (userprincipalname)

i would like to put all those results on 1 line, not really sure how to handle this one. thank you.

February 8th, 2015 11:39am

You would have to write a script that creates a custom object then export those obujects to a CSV firl.

Start here: https://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx

You can also use help:

Help Export-Csv -full

help about_Object_Creation

And: https://gallery.technet.microsoft.com/scriptcenter

Free Windows Admin Tool Kit Click here and download it now
February 8th, 2015 11:58am

Here is a quick example:

$CasMb=get-casmailbox 
$CasMb|ForEach-Object{
        $mb=$_|get-mailbox 
        New-Object PsObject -Property @{
             UserPrincipalName=$mb.UserPrincipalName
              ProhibitSendQuota=$mb.ProhibitSendQuota
              OWAEnabled=$_.OWAEnabled
         }
    }

February 8th, 2015 1:10pm

nice, thanks alot for taking the time, i should be able to complete by myself. really appreciate it.

tyty!

Free Windows Admin Tool Kit Click here and download it now
February 8th, 2015 1:15pm

Great! Good luck.

February 8th, 2015 1:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics