Live Chat Software by Kayako
 News Categories
(19)Microsoft Technet (2)StarWind (4)TechRepublic (3)ComuterTips (1)SolarWinds (1)Xangati (1)MyVirtualCloud.net (27)VMware (8)NVIDIA (9)VDI (1)pfsense vRouter (3)VEEAM (3)Google (2)RemoteFX (1)developers.google.com (1)MailCleaner (1)Udemy (1)AUGI (2)AECbytes Architecture Engineering Constrution (7)VMGuru (2)AUTODESK (1)storageioblog.com (1)Atlantis Blog (11)AT.COM (2)community.spiceworks.com (1)archdaily.com (14)techtarget.com (2)hadoop360 (3)bigdatastudio (1)virtualizetips.com (1)blogs.vmware.com (3)VECITA (1)vecom.vn (1)Palo Alto Networks (4)itnews.com.au (2)serverwatch.com (1)Nhịp Cầu đầu tư (3)VnEconomy (1)Reuters (1)Tom Tunguz (1)Medium.com (1)Esri (1)www.specommerce.com (1)tweet (1)Tesla (1)fool.com (6)ITCNews (1)businessinsider.com (1)hbr.org Harvard Business Review (1)Haravan (2)techcrunch.com (1)vn.trendmicro.com (3)thangletoan.wordpress.com (3)IBM (1)www.droidmen.com (2)blog.parallels.com (1)betanews.com (8)searchvmware.techtarget.com (1)www.bctes.com (1)www.linux.com (4)blog.capterra.com (1)theelearningcoach.com (1)www.examgeneral.com (1)www.wetutoringnation.com (1)chamilo.org/ (1)www.formalms.org (1)chalkup.co (1)www.mindonsite.com (5)moodle.org (4)moodle.croydon.ac.uk (1)opensource.com (1)1tech.eu (1)remote-learner.net (1)paradisosolutions.com (2)sourceforge.net (13)searchbusinessanalytics.techtarget.com (1)nscs.gov.sg (1)virten.net (1)fastest.com.vn (1)elearninglearning.com (2)www.computerweekly.com (1)youtube.com (3)computer.howstuffworks.com (2)techz.vn (2)techsignin.com (1)itworld.com (13)searchsecurity.techtarget.com (1)makeuseof.com (1)nikse.dk (1)4kdownload.com (1)thegioididong.com (1)itcentralstation.com (1)www.dddmag.com (1)Engenius (1)networkcomputing.com (1)woshub.com (1)hainam121.wordpress.com (1)www.lucidchart.com (1)www.mof.gov.vn (3)www.servethehome.com (6)www.analyticsvidhya.com
RSS Feed
News
Dec
10
Manage Office 365 Users Passwords using PowerShell
Posted by Thang Le Toan on 10 December 2017 11:25 PM

In the current article, we will review how to use PowerShell commands for managing user password in Office 365 environment.

Office 365 user’s password management versus the “standard” Domain Active Directory is a little restricted.

(https://o365info.com/manage-office-365-users-password-using/)

For example – configure password policy parameters such as – Enforce password history, Minimum password length, Password must meet complexity requirements cannot be configured by the Office 365 administrator.

At the current time, the options that related to Office 365 users password management are – reset the user password and setting the number of a maximum number of days or password expiration (the default is 90 days).

So, what are the options that are available for Office 365 user’s password management?
In this, the article will review a couple of options. Some of the options can manage by using the Office 365 Web interface and some task only by using PowerShell.

Step 1: Download and install required components

Before we can start the remote PowerShell session to Office 365, we need to download the required cmdlets. Additional pre-requirement is to: install the: Office 365 sign in assistant.

You can find the required software component using the following links:

1. Microsoft Online Services Sign-In Assistant
You can download the Microsoft Online Services Sign-In Assistant by using the following link:
Microsoft Online Services Sign-In Assistant for IT Professionals RTW

Choose the download option

Download the Microsoft Online Services Sign-In Assistant -01.jpg

Choose the right version for your OS (most of the modern OS are 64-bit version).

Download the Microsoft Online Services Sign-In Assistant -02.jpg

2. Office 365Powershell

You can download the indows Azure Active Directory Module for Windows PowerShell by using the following link:
Windows Azure Active Directory Module for Windows PowerShell

Click on the link named:  Azure Active Directory Module for Windows PowerShell (64-bit version)

 

Install the Azure AD Module.jpg
After the installation of PowerShell cmdlets, we will find a new icon on the desktop named: Microsoft Online Services Module for Windows PowerShell.
(An additional option is to use: start menu > All Programs > Microsoft online servicesMicrosoft online service module for Windows PowerShell

 

Microsoft Online Services Module for Windows PowerShell

 

The Microsoft Online Services Module for Windows PowerShell shortcut includes a command the will imports Office 365 cmdlets to the PowerShell console.

 

Technically we don’t have to use this shortcut. We can manually import the 365 cmdlets to the PowerShell console by using the command: Import-Module MSOnline

 

Import  Office  365  cmdlets to  the PowerShell console-03

Step 2: First time configurations

I must admit that the First-time configurations is a little a bit “Naggers” but, after creating the required settings, the next time will be easier. The PowerShell remote connection requires the following configuration settings:

1 – Run as Administrator

To be able to change the PowerShell Execution Policy, we need to run PowerShell console, by using the option: Run as administrator.

Run as administrator-01

Right click on the Microsoft Online Services Module for Windows PowerShell icon and chose the option: Run as administrator.
Run as administrator-02

2 – Setting the PowerShell Execution Policy

PowerShell security policy (“Execution policy”) can be defined by using one of the following options (modes): Restricted, AllSigned, RemoteSigned, and Unrestricted.
(The default mode is: Restricted).
To change the Execution policy open the Microsoft Online Services Module for Windows PowerShell and type the command:

Set-ExecutionPolicy Unrestricted

Set-ExecutionPolicy RemoteSigned-04

To execute PowerShell command, we use the “ENTER” key.

Step 3: Connect to Office 365 by using Remote PowerShell

Open the Microsoft Online Services Module for Windows PowerShell and Type (or copy and paste) the following command:

Connect-MsolService

A pop out windows will appear. Type your credentials by using the UPN (user Principal name) format. For example: admin@o365info.com

Connect-MsolService-05

Note – the user name should have global administrator rights in the Office 365 environment.

1. Set Password never expired

Set Password never expired for Office 365 user

PowerShell command Syntax

PowerShell command Example

Disable Password never expired option for a Office 365 user

PowerShell command Syntax

PowerShell command Example

Set Password never expired for ALL Office 365 users (Bulk Mode)

PowerShell command Syntax

Re-enable Password expired ( the default) for ALL Office 365 users (Bulk Mode)

PowerShell command Syntax

2. Set Password

Set a Predefined Password for Office 365 user

PowerShell command Syntax

PowerShell command Example

Set a Predefined Password for all Office 365 users (Bulk mode)

PowerShell command Syntax

PowerShell command Example

Set a Predefined Password for Office 365 users imported from a CSV File

Step 1: Export Office 365 users account
PowerShell command Syntax

Step 2: Set a Predefined Password

Example: Step 1: Export Office 365 users account

Predefined Password-CSV

PowerShell command Example

Create new Office 365 user and set a unique temporary password by import the information from CSV file

temp password

You can download a sample CSV file – Password.csv

PowerShell command Example

Provisioning Office 365 user and export information from Active Directory

In case that you need to export Active Directory on-Premise user account based on a specific parameter, you can use the PowerShell cmdlets named – get-aduser (you will need to use PowerShell console from DC or import the Active Directory cmdlets to the existing PowerShell console
For example:

Example 1 – display or export, all of the Active Directory users that located in a specific OU.

 

In our particular scenario, the domain name is – o365info.com and the specific OU is – Test

Display information about – all of the Active Directory users that located in a specific OU

PowerShell command Example

Export to a CSV file information about – all of the Active Directory users that are located in a specific OU + choose a specific data fields.

Example 2 – display + export information about Active Directory users from a specific department.

The PowerShell command syntax is:

An example to a scenario in which we want to export information only about Active Directory users that belong to the marketing department could be

Set a Temporary Password for a specific user

PowerShell command Syntax

PowerShell command Example

Set a Temporary Password for all Office 365 users (Bulk Mode)

PowerShell command Syntax

PowerShell command Example

3. Office 365 Password Policy

Set Office 365 Password Policy

PowerShell command Syntax

PowerShell command Example

4. Display Password settings

Display Password settings for all Office 365 users

PowerShell command Syntax

Display information about Office 365 Password Policy

PowerShell command Syntax

PowerShell command Example

5. Download Manage password PowerShell menu script

Manage Office 365 Users Passwords using PowerShell | Office 365

You can read more detailed information about the PowerShell commands that are used in the script in the article: Manage Office 365 Users Passwords using PowerShell | Office 365
Manage Office 365 Users Passwords using PowerShell


Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Kayako