Rene Profile With phone and Laptop

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

# Rene Smit 19-10-20 Inbox rule reporter on external fwd

Connect-ExchangeOnline
$mailboxes = Get-Mailbox  -ResultSize Unlimited 
#mailboxes = Get-Mailbox  rene.smit

$report = @()
ForEach ($mailbox in $mailboxes) { 
    Write-host Now Processing $mailbox.DisplayName
    $inboxrrules = Get-InboxRule -Mailbox $mailbox.Alias | Select-Object Enabled, Name, Priority, From, SentTo, CopyToFolder, DeleteMessage, ForwardTo, MarkAsRead, MoveToFolder, RedirectTo, @{Expression = { $_.SendTextMessageNotificationTo }; Label = "SendTextMessageNotificationTo" }, MailboxOwnerId 

    foreach ($inboxrule in $inboxrrules) {
        Write-host now processing rule $inboxrule.Name for $mailbox.DisplayName -ForegroundColor green
        if (!$null -eq $inboxrule.ForwardTo) {
            Write-Host The rule for $mailbox.Alias with name $inboxrule.Name is a fwd rule and is being forwarded to $inboxrule.ForwardTo -ForegroundColor Cyan$
            $split = $inboxrule.Forwardto.split(":")[1]
            $split = $split.Trim("]")
            $inbfwdline = $null
            $inbfwdline = [PSCustomObject][Ordered]@{
                Displayname       = $mailbox.Name
                userPrincipalName = $mailbox.userPrincipalName
                RuleName          = $inboxrule.Name
                Enabled           = $inboxrule.Enabled
                Forwardto         = $inboxrule.ForwardTo
                Forwardmail       = $split
            }  
            $report += $inbfwdline
        }
    }
    
}
#$report

$Report | Export-csv -NoTypeInformation "C:\temp\InboxRules_Forwards.csv"

Hier nog een mooie code

OF anders ZO

en rtoen kwam er een gans

One thought on “Hello world!

Leave a Reply

Your email address will not be published. Required fields are marked *