UPN 變更如何影響 OneDrive URL 和 OneDrive 功能How UPN changes affect the OneDrive URL and OneDrive features

使用者主要名稱 (UPN) 由兩個部分組成,首碼 (使用者帳戶名稱) 和尾碼 (DNS 功能變數名稱) 。A User Principal Name (UPN) is made up of two parts, the prefix (user account name) and the suffix (DNS domain name). 例如:For example:


在此情況下,首碼為 "user1",尾碼為 "contoso.com"。In this case, the prefix is "user1" and the suffix is "contoso.com."

您可以變更使用者的使用者名稱或設定不同的電子郵件別名,以變更 Microsoft 365 系統管理中心 中的使用者 UPN。You can change a user's UPN in the Microsoft 365 admin center by changing the user's username or by setting a different email alias as primary. 您也可以變更使用者在 AZURE AD 系統管理中心 中的 UPN,方法是變更使用者的使用者名稱。You can also change a user's UPN in the Azure AD admin center by changing their username. 您可以 使用 Microsoft PowerShell變更 UPN。And you can change a UPN by using Microsoft PowerShell.


使用者的 UPN (用於簽署) 和電子郵件地址可能會不同。A user's UPN (used for signing in) and email address can be different. 如果您只需要為使用者新增新的電子郵件地址,您可以在不變更 UPN 的情況下新增別名。If you just need to add a new email address for a user, you can add an alias without changing the UPN.

UPN 類型的變更Types of UPN changes

您可以透過變更前置詞、尾碼或兩者來變更 UPN:You can change a UPN by changing the prefix, suffix, or both:

  • 變更前置詞。Changing the prefix. 例如,如果某人的名稱變更,您可以變更其帳戶名稱:For example, if a person's name changed, you might change their account name:

    user1@contoso.com 至 user2@contoso.comuser1@contoso.com to user2@contoso.com

  • 變更尾碼。Changing the suffix. 例如,如果人員變更了部門,您可以變更其網域:For example, If a person changed divisions, you might change their domain:

    user1@contoso.com 至 user1@contososuites.comuser1@contoso.com to user1@contososuites.com


UPN 變更可能需要數個小時才能透過您的環境傳播。UPN changes can take several hours to propagate through your environment.

OneDrive URLOneDrive URL

使用者的 OneDrive URL 是以其 UPN 為基礎:A user's OneDrive URL is based on their UPN:


(,user1_contoso_com 會對應至 user1@contoso.com) (where user1_contoso_com corresponds with user1@contoso.com)


如果使用者的 UPN 包含底線,它就會出現在結果 OneDrive URL 中。If the user's UPN contains an underscore, it will be present in the resultant OneDrive URL.

在此情況下,如果您已將前置詞變更為使用者2和尾碼為 contososuites.com,使用者的 OneDrive URL 會變更為:In this case, if you changed the prefix to user2 and the suffix to contososuites.com, the user's OneDrive URL would change to:


在您變更 UPN 後,任何儲存至使用者 OneDrive ((例如桌面快捷方式或瀏覽器的我的最愛) )的連結將不再運作,而且必須更新。After you change a UPN, any saved links to the user's OneDrive (such as desktop shortcuts or browser favorites) will no longer work and will need to be updated.


在 Windows 和 Mac) 上的 sync 應用程式 (會在 UPN 變更之後,自動切換為與新的 OneDrive 位置同步。The sync app (on both Windows and Mac) will automatically switch to sync with the new OneDrive location after a UPN change. 在透過您的環境傳播 UPN 變更時,使用者可能會在 OneDrive 同步處理應用程式中看到「一或多個文件庫無法同步處理」的錯誤。While the UPN change is propagating through your environment, users may see an error in the OneDrive sync app that "One or more libraries could not be synced." 如果他們按一下以取得詳細資訊,他們會看到「您沒有同步處理此程式庫的許可權。」If they click for more information, they will see "You don't have permission to sync this library." 看到此錯誤的使用者應該重新開機同步應用程式。Users who see this error should restart the sync app. 當 UPN 變更已完全傳播,且同步處理應用程式已更新,以使用使用者的新 OneDrive URL 時,將會消失此錯誤。The error will go away when the UPN change has been fully propagated and the sync app is updated to use the user's new OneDrive URL.


OneDrive URL 變更不會影響同步處理的小組網站。Synced team sites are not impacted by the OneDrive URL change.


在 UPN 變更後,使用者將需要關閉並重新開啟 OneDrive 中儲存的 OneNote 筆記本。After a UPN change, users will need to close and reopen their OneNote notebooks stored in OneDrive.

在 Windows OneNote 中關閉筆記本Close a notebook in OneNote for Windows

在 Windows OneNote 中開啟筆記本Open a notebook in OneNote for Windows

最近使用的檔案清單Recent files lists

在 UPN 變更後,使用者將需要流覽以在其新位置中重新開啟作用中 OneDrive 檔案。After a UPN change, users will need to browse to re-open active OneDrive files in their new location. Office 應用程式和 Windows) 中任何檔案 ((包括瀏覽器的我的最愛、桌面快捷方式及「最近」清單)都無法運作。Any links to the files (including browser favorites, desktop shortcuts, and "Recent" lists in Office apps and Windows) will no longer work.

共用 OneDrive 檔案Shared OneDrive files

如果使用者與其他人共用 OneDrive 檔案,在 UPN 變更後,連結將不再運作。If a user shared OneDrive files with others, the links will no longer work after a UPN change. 使用者將需要重新共用檔案。The user will need to re-share the files.

Office Backstage 檢視Office Backstage View

在 UPN 變更之後,雖然 Office 仍會如預期般運作,但使用者的原始 UPN 仍會繼續顯示在 Office Backstage 檢視中。After a UPN change, although Office will continue to work as expected, the user's original UPN will continue to be displayed in the Office Backstage View. 若要更新 Office Backstage 檢視以顯示已變更的 UPN,使用者將需要登出,然後使用 Office 用戶端登入。To update the Office Backstage View to display the changed UPN, the user will need to sign out and then sign in using the Office client.

搜尋和 DelveSearch and Delve

在 UPN 變更之後,可能需要一段時間,才能將新 OneDrive URL 上的檔案編制索引。After a UPN change, it might take a while for files at the new OneDrive URL to be indexed. 在這段時間內,搜尋結果 OneDrive 和 SharePoint 會使用舊的 URL。During this time, search results in OneDrive and SharePoint will use the old URL. 使用者可以複製 URL、將其貼到網址列,然後更新新 UPN 的部分。Users can copy the URL, paste it in the address bar, and then update the portion for the new UPN.

在 UPN 變更之後,Delve 也會連結到舊的 OneDrive URLs 一段時間。Delve will also link to old OneDrive URLs for a period of time after a UPN change. 當新的位置發生活動時,就會開始顯示新的連結。As activity occurs in the new location, the new links will start appearing.

SharePoint 自動化的工作流程和自訂SharePoint automated workflows and customizations

以 Power 自動化或 SharePoint 2013 工作流程建立的任何自動化工作流程,以及在 UPN 變更後,參考 OneDrive URL 將無法運作。Any automated workflows that were created with Power Automate or SharePoint 2013 workflows and refer to a OneDrive URL will not work after a UPN change. 同樣地,在 UPN 變更後,必須更新參考 OneDrive URL 的任何 SharePoint 應用程式 (包括 Power Apps) 。Similarly, any SharePoint apps (including Power Apps) that reference a OneDrive URL will need to be updated after a UPN change.


  • 如果您要變更組織內的許多 Upn,請成批變更 UPN,以管理系統上的負載。If you're changing many UPNs within your organization, make the UPN changes in batches to manage the load on the system.

  • 如有可能,請在週末或非峰時段套用變更,以允許變更傳播,而不會影響使用者的工作。If possible, apply changes before a weekend or during non-peak hours to allow time for the change to propagate and not interfere with your users' work.

另請參閱See also

混合身分識別中 UserPrincipalName 屬性人口的資訊Info about UserPrincipalName attribute population in hybrid identity