Change from ADFS to Password Sync in Office 365

This blog post is reflecting how the process was made in early 2014, and has since then been replaced with built-in tools in ADConnect.

Some time ago Johan wrote a post about how to convert a federated domain to a standard domain in Office 365. Much has happened since, and one feature that has been added is to synchronize the passwords between on-premises Active Directory and Office 365.

An important reason to implement ADFS and federation is to keep all user passwords the same, to reduce support and Helpdesk calls. The drawback is that a high availability server (or even better, an ADFS farm distributed over several locations) is needed on-premises. If your internet connection is dropping, no-one will able to access Exchange or SharePoint even though it is located “in the Cloud”.

Now when Password Sync is available, some organizations choose to retire their ADFS servers to implement Password Sync instead. It is now possible to have the same password in all systems without those high availability servers.

The process to move to a non-federated state with Password Sync is similar to how Johan described the process, but to minimize the service interruption for your end-users there are a few things to think of. All steps below are performed on the server hosting the Azure Active Directory Sync tool.

  1. First of all you need to upgrade to the latest version of Azure Active Directory Sync tool. The upgrade process is simple; just uninstall the old version and install the new one. The installation may take a few minutes. Make sure that you check the Password Sync option during installation. End by running the Configuration Wizard.
  2. Check the Synchronization Service Manager (miisclient.exe) to make sure that the synchronization was successful. You may have to log off and log in again to be able to access Synchronization Service Manager.
  3. Time for PowerShell 🙂
    #Connect to MSOnline
    Import-Module MSOnline
    #Enter credentials
    #Set context and credentials
    Set-MsolADFSContext -Computer srv01
    #From here on the Office 365 services will be unavailable 
    #for the end-users until all passwords are in in sync.
    #This is where we change our federated domain to a standard domain.
    #This command generates a text file with new random passwords for all users.
    #In the next step we will replace these passwords with passwords synced from AD.
    Convert-MSOLDomainToStandard -DomainName "" -SkipUserConversion $false -PasswordFile C:\userpwd.txt
    #Make sure that all user passwords has ForceChangePassword flag set to False
    Get-MsolUser -Synchronized | Set-MsolUserPassword -ForceChangePassword $false
  4. Now all users are converted. A file with new temporary passwords for each user is saved to the path you specified, but we will not use it. Instead, we now have to initialize a full password sync.

To see the status of the password sync you should check the Application Log in Event Viewer for event id 657. When all passwords are synchronised the users will be able to access their services again. This will take a few minutes depending on the number of users in your environment.

/ Andreas


3 thoughts on “Change from ADFS to Password Sync in Office 365

  1. Pingback: Office 365: Migrating DirSync to new AD domain | Tailspintoys -

  2. varol1

    Good article. If, after you convert to PWSync, users are being prompted to change their passwords, you’ll need to run Get-MsolUser -All |? {$_.UserPrincipalName -like ‘*’} | Set-MsolUserPassword -ForceChangePassword $false. Since that creates new passwords for the users in the cloud, you’ll also have to force another full password sync on the DirSync server:
    1. In the registry, set the value of FullSyncRequired under HKLM\SOFTWARE\Microsoft\MSOLCoExistence\PasswordSync to 1.
    2. Restart the Forefront Identity Manager Synchronization Service, which also restarts the Windows Azure Active Directory Sync Service.
    3. Monitor the Event Viewer Application log. You should see a bunch of 650, 651, 656, and 657 events. When the sync has completed, you will see a 654 event.

    1. Andreas Lindahl Post author

      Thanks for your comment. You are correct regarding the ForceChangePassword flag, and I have updated the PowerShell code in my post to take care of this. The Full Password Sync is required, but if done in the correct order (as step 4-5), a single run is enough.

Comments are closed.