Code Monkey home page Code Monkey logo

get-exolforwarding's Introduction

get-exolForwarding

There are 5 types of forwarding in MS Exchange Online. Two are properties of the mailbox and 3 are types of rules. Note: This script can take a long time to run in large organizations.

Prerequisites

  • MSOnline PowerShell module
    Install-Module -Name MSOnline -Scope AllUsers
  • ExchangeOnlineManagement PowerShell module
    Install-Module -Name ExchangeOnlineManagement -Scope AllUsers

This script will

  • Make folder c:\temp if it doesn't exist
  • Check if the MSOnline and ExchangeOnlineManagement modules are installed
  • Get all of the mailboxes in your tenant
  • Get every domain that is a part of your tenant (acceptedDomains)
  • For every mailbox:
    • Check to see if it has a forwarding property (DeliverToMailboxAndForward, ForwardingSmtpAddress, ForwardingAddress)
    • If it does AND is going to a domain outside of your tenant accepted domains THEN export to CSV
    • Get every rule
      • For every rule:
        • See if it is a forwarding rule (ForwardTo , or ForwardAsAttachmentTo, or RedirectTo)
        • If does AND is going to a domain outside of your tenant accepted domains THEN export to CSV
  • Results will be saved to the following CSV file formatted with date and time the script was run:
c:\temp\exolForwarding_DATE_TIME.csv
  • Once finished running, the script will tell you:
    • The location of the output
    • The time the script started
    • The time the script finished

The following properties are exported to the generated CSV file

  • PrimarySMTPAddress of the mailbox
  • DisplayName of the mailbox
  • Rule priority (for a rule)
  • Rule description (for a rule)
  • Rule ID (for a rule)
  • Rule enabled status (for a rule)
  • Rule name (for a rule)
  • Rule ForwardTo address (for a rule, if exists)
  • Rule RedirectTo address (for a rule, if exists)
  • Rule ForwardAsAttachmentTo address (for a rule, if exists)
  • Mailbox DeliverToMailboxAndForward status (mailbox property, if exists)
  • Mailbox ForwardingSmtpAddress (mailbox property, if exists)
  • Mailbox ForwardingAddress (mailbox property, if exists)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.