Script Samples

In this section, you will have access to a collection of PowerShell scripts that including ones that help you establish a connection to your Office 365 evnironment, automate repetitive tasks such as adding multiple users and exporting a list of users.


Please note that the sample scripts that you download may require edits such as adding your domain name. In addition, you can easily customize the scripts so that they can better meet your needs.

Connect remotely to your Skype for Business Online service.

Downloaded 875 times.  (0)

Assign a license to a user, using the Set-MsolUserLicense command, and review available licenses.

Downloaded 0 times.  (10)

Connect remotely to your SharePoint Online service.

Downloaded 812 times.  (2)

A bulk password change can be useful to change generic logins on a regular basis. By designating a group of users by a department you can bulk reset passwords based on that department name.

We have demonstrated how to bulk set the password for a group of users.

Downloaded 0 times.  (0)

Bulk Assign Licenses script to perform the following; Show you the list of available licenses, their SKU codes, and the quantity remaining for assignment. Display a list of unlicensed users for validation before making licensing changes. Retrieve a list of all unlicensed users located in the United States (based on user property information), and assigns to the 'US' usage location for Office 365. Will assign the EnterprisePack license to all unlicensed users, with a usage location of 'US', in the Contoso domain.

Downloaded 0 times.  (2)

By default each SharePoint site is created from a standard template (eg. STS#0) is created with three membership groups, Owners, Members, and Visitors; with Full Control, Contribute, and View-only site permissions respectively.

Downloaded 0 times.  (0)

This command will export a list of all users in the “Volunteers” department to a CSV file. It is a good idea to review the names contained in the CSV file to ensure you have identified the correct users.

Downloaded 0 times.  (1)

This script will demonstrate how to generate a report, save it to a CSV file, which provides a list of all the users who have not logged in for at least 30 days.  With this information you can then take the appropriate action to remove unused mailboxes.

Downloaded 0 times.  (5)

Import a large number of users using a pre-prepared CSV file with detailed field information

Downloaded 0 times.  (2)

To view the list of available licenses, their SKU codes, and the quantity remaining for assignment, run the following command.

Downloaded 0 times.  (2)

To export the results of the non-licensed users into a CSV file run the following command. 

Downloaded 0 times.  (0)

Getting Connected to Office 365 Cloud services to administer Office 365 Cloud services using PowerShell

Downloaded 2756 times.  (2)

Deny anonymous Skype for Business users entrance to meetings and removes the ‘lobby’ function from meetings.

Downloaded 0 times.  (1)

The Get-Help command displays information about Windows PowerShell concepts, including commands, functions, CIM commands, workflows, providers, aliases and scripts.

Downloaded 0 times.  (0)

This script will export the list of distribution groups in your Office 365 organization into a CSV file.

Downloaded 737 times.  (0)