Welcome to my journey of continuous discovery. Enjoy your visit.

Ugli Scripting
Ugli Scripting
  • Home
  • Blog
  • .PY
    • Python 2.7 on Windows
    • Python 2.7 on Ubuntu
    • Python 2.7 IDE Set up
    • Run Python Script via CLI
    • Adding Python Packages
    • Basic REST API
  • .PS1
    • Install AD Module Win 10
    • Connecting to MSO and EOP
    • Storing Script Variables
    • Storing Secure Strings
    • Storing User Credentials
    • Basic REST API
  • Sample Integrations
    • Isolate SEP Clients
    • Force Password Change
    • o365 Account Remediation
    • Threat Response Lists
    • Endpoint Scripts
  • SITQ Lab
    • Lab Resources
    • AD Lab Account Imports
    • DLP Sample
  • More
    • Home
    • Blog
    • .PY
      • Python 2.7 on Windows
      • Python 2.7 on Ubuntu
      • Python 2.7 IDE Set up
      • Run Python Script via CLI
      • Adding Python Packages
      • Basic REST API
    • .PS1
      • Install AD Module Win 10
      • Connecting to MSO and EOP
      • Storing Script Variables
      • Storing Secure Strings
      • Storing User Credentials
      • Basic REST API
    • Sample Integrations
      • Isolate SEP Clients
      • Force Password Change
      • o365 Account Remediation
      • Threat Response Lists
      • Endpoint Scripts
    • SITQ Lab
      • Lab Resources
      • AD Lab Account Imports
      • DLP Sample

  • Home
  • Blog
  • .PY
    • Python 2.7 on Windows
    • Python 2.7 on Ubuntu
    • Python 2.7 IDE Set up
    • Run Python Script via CLI
    • Adding Python Packages
    • Basic REST API
  • .PS1
    • Install AD Module Win 10
    • Connecting to MSO and EOP
    • Storing Script Variables
    • Storing Secure Strings
    • Storing User Credentials
    • Basic REST API
  • Sample Integrations
    • Isolate SEP Clients
    • Force Password Change
    • o365 Account Remediation
    • Threat Response Lists
    • Endpoint Scripts
  • SITQ Lab
    • Lab Resources
    • AD Lab Account Imports
    • DLP Sample

Connecting to Azure AD (MSO), Exchange Online and EOP

connect-mso.ps1

As you being to test new commands and methods, it will be handy to run individual commands directly versus via a script.  


With Office 365 there are three different services; Azure AD (AAD, a.k.a. MS Online), Exchange Online and Exchange Online Protection (EOP)


The connect-o365-all-services.ps1 will prompt you for you online credentials and store them encrypted, so you wont need to enter them again.  It then connects you to all three services.

Script Concepts

This script is a good example of how to accept command line parameters (lines 6-12) and the Convert-To/From-SecureString to securely store the credentials for later use (lines 17-29).

Scripts on github

Copyright © 2018 Ugli Scripting - All Rights Reserved.

  • Blog
  • CV

Powered by GoDaddy