

$LicenseOptions = New-MsolLicenseOptions -AccountSkuId "$AccountSkuID" -DisabledPlans $DisabledServicesNew Now, you can easily generate Office 365 Password Expiry Reports. Press question mark to learn the rest of the keyboard shortcuts. Using this script, you can generate Press J to jump to the feed. $AccountSkuID = (Get-MsolAccountSku | Where. This All-in-One PowerShell Script allows you to generate 7 different password reports. PowerShell to Enable Multi-factor authentication in Office 365 Currently, there is no method to enable MFA using the PowerShell V2 module and we got to use the classic V1 Make sure you have Installed the Azure AD V1 PowerShell module. ValueFromPipelineByPropertyName=$true,HelpMessage="The users office 365 principalname", Office 365 user’s password management versus the Standard Domain Active directory is a little restricted. Use Office 365 PowerShell to disable access to services Note, before running the below command, you must connect to Azure Directory using the connect-msolservice cmdlet. Now doing the same for Exchange and the Office web apps.ĭisable-MsolUserServicePlan -ServicePlan OfficeWebApps -Verboseĭisable-MsolUserServicePlan -ServicePlan Exchange -Verbose The following command disables the Skype for Business Serviceĭisable-MsolUserServicePlan -ServicePlan SkypeforBusiness The below PowerShell function allows an Office 365 user administrator to disable individual services for a registered Office 365 user. When looking at the users settings within the Office 365 Admin portal, things look as following: One option, not only for security, but also for user convenience is Self Service Password Reset (SSPR). Self Service Password Reset in Office 365.
#Office 365 password reset powershell license#
When assigning an Office 365 E3 license to a user, the following service plans are enabled by default:įrom an end user perspective the user will see the following options when logging on to Office 365. Office 365 PowerShell Search for: Office365, Security. I don’t know what my password is and I don’t care.When assigning an Office 365 license to a user, by default several service plans are enabled.Line 97 can be un-remarked after getting a token to use the Refresh Token (and Line 96 commented out). To get a new Access Token using the stored Refresh Token (Line 18) call the Get-NewTokens function.Line 18 for where you want to store the Refresh Token.

You can then login and get an Access Token and a Refresh Token. If you’re not Global Admin get the script run initially by someone who has the Global Admin role or get them to assign the permission to the Azure AD Application you have created. As per the other script it enables the scopes required. Here is the modified script from my previous post here that uses oAuth to retrieve Azure Password Reset events.
#Office 365 password reset powershell registration#
User started security info registration for self-service password reset The Script User registered for self-service password reset If you have a cloud-only account or password writeback is enabled, then you can reset the user’s. If your organization is set up with AD Connect you can proceed to reset the user’s password in Active Directory and this will be replicated to Office 365. User completed security info registration for self-service password reset Also, to determine the password expiry date of specific user account, you can get the information of the last password change time stamp by using the command below in Azure AD PowerShell, and then calculate the expiry date based on the last password change time stamp. The first step of remediation is to reset the user’s password. Self-service password reset flow activity progress When assigning an Office 365 license to a user, by default several service plans are enabled. Self-serve password reset flow activity progress

Security info saved for self-service password reset The events from the table above associated with Azure Self Service Password Reset and Azure Change Password are Blocked from self-service password resetĬredentials Registered and Password Reset Status of User

Use Powershell to set the new passwords Here’s the Excel formula: This formula will create an 8 character password, with 4 letters and 4 numbers, similar to the temporary passwords that Office 365 initially creates. To retrieve the other events contained in the auditLog we just need to alter the event to retrieve events for and the timeframe of interest. Note: Each time you modify or change the file, it generates all new passwords, so be sure to save the CSV file. $passwordMgmtAuditData = Invoke-RestMethod -Method Get -Uri "$($DirectoryAuditURL)?` $filter=category eq `'UserManagement`' and activityDateTime ge T03:15:10.6837342Z and startswith(activityDisplayName%2C+`'Reset password`')" -Headers = "Bearer $($Global:accesstoken)"}
