O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PowerShell for Office 365

Book Description

Learn the art of leveraging PowerShell to automate Office 365 repetitive tasks

About This Book

  • Master the fundamentals of PowerShell to automate Office 365 tasks.
  • Easily administer scenarios such as user management, reporting, cloud services, and many more.
  • A fast-paced guide that leverages PowerShell commands to increase your productivity.

Who This Book Is For

The book is aimed at sys admins who are administering office 365 tasks and looking forward to automate the manual tasks. They have no knowledge about PowerShell however basic understanding of PowerShell would be advantageous.

What You Will Learn

  • Understand the benefits of scripting and automation and get started using Powershell with Office 365
  • Explore various PowerShell packages and permissions required to manage Office 365 through PowerShell
  • Create, manage, and remove Office 365 accounts and licenses using PowerShell and the Azure AD
  • Learn about using powershell on other platforms and how to use Office 365 APIs through remoting
  • Work with Exchange Online and SharePoint Online using PowerShell
  • Automate your tasks and build easy-to-read reports using PowerShell

In Detail

While most common administrative tasks are available via the Office 365 admin center, many IT professionals are unaware of the real power that is available to them below the surface. This book aims to educate readers on how learning PowerShell for Office 365 can simplify repetitive and complex administrative tasks, and enable greater control than is available on the surface.

The book starts by teaching readers how to access Office 365 through PowerShell and then explains the PowerShell fundamentals required for automating Office 365 tasks.

You will then walk through common administrative cmdlets to manage accounts, licensing, and other scenarios such as automating the importing of multiple users,assigning licenses in Office 365, distribution groups, passwords, and so on.

Using practical examples, you will learn to enhance your current functionality by working with Exchange Online, and SharePoint Online using PowerShell. Finally, the book will help you effectively manage complex and repetitive tasks (such as license and account management) and build productive reports.

By the end of the book, you will have automated major repetitive tasks in Office 365 using PowerShell.

Style and approach

This step by step guide focuses on teaching the fundamentals of working with PowerShell for Office 365. It covers practical usage examples such as managing user accounts, licensing, and administering common Office 365 services. You will be able to leverage the processes laid out in the book so that you can move forward and explore other less common administrative tasks or functions.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the example code
      2. Downloading the color images of this book
      3. Errata
      4. Piracy
      5. Questions
  2. PowerShell Fundamentals
    1. Why do we need to learn PowerShell for Office 365?
    2. PowerShell is a cmdlet based language with verb-noun syntax
    3. How to pass parameters to cmdlets and storing results as a variable
      1. Parameters
    4. How to get help with PowerShell
      1. What is a module?
      2. What is a pipe?
    5. How PowerShell is an object-oriented language and how to work with objects
    6. Using the if and where statements
    7. Using the for and while loops
    8. Creating your first script
    9. Summary
  3. Managing Office 365 with PowerShell
    1. Admin roles for Office 365
    2. Installing and working with the Office 365 admin tools
      1. Installing Microsoft Online Service Sign-In Assistant
      2. Installing the Windows Azure Active Directory Module for PowerShell
      3. Verifying installation of the Office 365 admin tools
    3. Creating the first user account in PowerShell
      1. Ensuring user account permissions
      2. Checking license availability
      3. Creating a new user
    4. Summary
  4. Azure AD and Licensing Management
    1. Common administrative cmdlets that are used for managing accounts and licensing
    2. How to change the license for existing users
    3. Formatting data to be used for bulk account management
    4. How to reset account passwords
    5. How to update user account details
    6. Summary
  5. Managing SharePoint Online Using PowerShell
    1. A brief overview of the SharePoint APIs
      1. The SharePoint web services API
      2. The SharePoint server-side API and PowerShell API
      3. The client-side object model
      4. The REST API
      5. The SharePoint Online API
    2. Setting up your environment
      1. PowerShell execution policy
      2. SharePoint Online Management Shell
      3. Security requirements
    3. SharePoint Online scripting
      1. Scenario 1 - getting to know the API
      2. Scenario 2 - site collection information
      3. Scenario 3 - site collection maintenance
        1. Testing site health
      4. Scenario 4 - personal sites
      5. Scenario 5 - sharing and external access
        1. Guest access
      6. Scenario 6 - CSOM scripting using PowerShell
        1. Environment setup
        2. Connecting to SharePoint Online via CSOM
        3. CSOM queries
      7. Scenario 7 - the REST API in PowerShell
    4. Summary
  6. Managing Exchange Online Using PowerShell
    1. Connecting to Exchange Online
      1. Exploring the API
    2. Working with Exchange accounts
      1. Creating new mailboxes
        1. Scenario 1 - a new user mailbox
        2. Scenario 2 - an unlicensed existing user
        3. Scenario 3 - a licensed user without the Exchange service
        4. Scenario 4 - MailUser
        5. User photos
      2. Email forwarding
      3. Out-of-office reply
      4. Inbox rules
    3. User impersonation
      1. Installing Exchange Web Services
    4. Role-based access control
      1. Management roles
        1. Role groups
        2. Management role assignment
      2. RBAC scenario - creating a custom administrator
        1. First requirement - limiting access to PowerShell commands
        2. Second requirement - limiting access to a group of users
    5. Summary
  7. Script Automation
    1. PowerShell modules
      1. Module manifest
      2. Script modules
      3. Cmdlets
      4. Scheduled execution
        1. Scripting instrumentation - the next steps
    2. Code signing
      1. Setting up a signing infrastructure
      2. The PKI module
      3. Self-signed certificates
        1. Creating a CA certificate
        2. Querying certificate stores
        3. Exporting, importing, and publishing certificates
      4. Issuing certificates with a self-signed CA
    3. Active Directory Certificate Services
      1. Prerequisites
      2. Requesting and issuing certificates in AD CS
      3. Signing PowerShell scripts
        1. IncludeChain
        2. TimestampServer
    4. Summary
  8. Patterns and Practices PowerShell
    1. Why do we need to learn PnP PowerShell?
    2. Installing and working with PnP PowerShell cmdlets
      1. PowerShell Gallery
      2. Using Setup files/binaries
      3. Installation script
        1. Verifying the installation of the PnP PowerShell module for SharePoint Online
    3. Using Windows Credential Manager with PnP PowerShell
      1. An example of provisioning site collection using a standard template
    4. Summary
  9. OneDrive for Business
    1. Feature configuration
    2. Personal site management
    3. Data migration
      1. The CSOM API
      2. The SPO Migration API
      3. Office 365 Import service
        1. Creating an Azure Blob storage account
        2. Migrating data using Azure Blob storage
    4. Summary
  10. PowerShell Core
    1. Installing PowerShell Core
    2. Remoting on PowerShell Core
      1. WinRM remote management
      2. SSH Remote management
    3. Managing SharePoint with PowerShell Core
    4. Managing SharePoint Online from PowerShell Core
    5. Summary