Book Image

PowerShell for Office 365

By : Martin Machado
Book Image

PowerShell for Office 365

By: Martin Machado

Overview of this book

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 Offi ce 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 Offi ce 365 through PowerShell and then explains the PowerShell fundamentals required for automating Offi ce 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.
Table of Contents (16 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Preface

PowerShell for Office 365 is a powerful tool that is used to perform common administrative tasks. However, there is much more that it can do. PowerShell for Office 365 helps automate repetitive and complex administrative tasks, which can greatly increase the speed and efficiency of your business. This book will walk you through all the aspects of PowerShell for Office 365 and enable you to get greater control over it and extract more from Office 365.

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.

What this book covers

Chapter 1, PowerShell Fundamentals, covers the basics of working with PowerShell. We will cover topics from command structures, to logical syntax.

Chapter 2, Managing Office 365 with PowerShell, explains the various PowerShell packages and permissions required to manage Office 365 through PowerShell.

Chapter 3, Azure AD and Licensing Management, gives an overview on how to use basic PowerShell skills discussed in previous chapter to create, manage, and remove Office 365 accounts and licenses. This chapter also addresses group management.

Chapter 4, Managing SharePoint Online using PowerShell, focuses on tips and tricks working with SharePoint Online with PowerShell.

Chapter 5, Managing Exchange Online using PowerShell, focuses on tips and tricks working with Exchange Online using PowerShell with practical examples.

Chapter 6, Script Automation, explains taking a script and turning it into an automated process. This can be useful for repetitive tasks such as license and account management.

Chapter 7, Patterns and Practices PowerShell, explores Office 365 PnP PowerShell to manage artifacts in SharePoint Online.

Chapter 8, OneDrive For Business, explains OneDrive, which is another key component for the digital workplace. Individuals can safely keep/sync content on the cloud, making it available anywhere while businesses can manage and retain content securely. In this chapter, we go over common provisioning and management scenarios.

Chapter 9, PowerShell Core, ends this book by covering how to use PowerShell on other platforms. It also explains how to use Office 365 APIs through remoting.

What you need for this book

A basic understanding of PowerShell.

Who this book is for

The book is aimed at sys admins administering office 365 tasks and looking forward to automating manual tasks. They need not have knowledge of PowerShell; however, a basic understanding of PowerShell would be advantageous.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The Get-Credential cmdlet does not tell us whether the username and password are correct or not."

A block of code is set as follows:

$i=0
do
{

   $var = $set[$i]

}
while ($i -ge $Set.Count)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

$i=0
do
{

$var = $set[$i]

}
while ($i -ge $Set.Count)

Any command-line input or output is written as follows:

Get-MsolUser -UserPrincipalName "valid Office 365 work or school user name"

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "When creating the account, make sure you check the Password never expires setting."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support, and register to have the files e-mailed directly to you. You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/PowerShell-for-Office-365. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/PowerShellforOffice365_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title. To view the previously submitted errata, go to https://www.packtpub.com/books/content/support, and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at [email protected] with a link to the suspected pirated material. We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.