取得組織中所有使用者 OneDrive URLs 的清單Get a list of all user OneDrive URLs in your organization

本文適用于 Microsoft 365 中的全球性和 SharePoint 系統管理員。This article is for global and SharePoint admins in Microsoft 365.

在您的組織中查看 OneDrive 使用者與 URLs 的清單View the list of OneDrive users and URLs in your organization

  1. https://admin.microsoft.com 全域或 SharePoint 管理員身分登入。 (如果您看到一則訊息表明您沒有存取此頁面的許可權,則您的組織中沒有 Microsoft 365 系統管理員許可權。 ) Sign in to https://admin.microsoft.com as a global or SharePoint admin. (If you see a message that you don't have permission to access the page, you don't have Microsoft 365 admin permissions in your organization.)

    注意

    如果您有 Office 365 Germany,請登入 https://portal.office.de。如果您有 21Vianet 運作的 Office 365 (中國),請登入 https://login.partner.microsoftonline.cn/。然後選取 [管理] 圖格以開啟系統管理中心。If you have Office 365 Germany, sign in at https://portal.office.de. If you have Office 365 operated by 21Vianet (China), sign in at https://login.partner.microsoftonline.cn/. Then select the Admin tile to open the admin center.

  2. 在左窗格中,選取 [ 報告 > 使用量]。In the left pane, select Reports > Usage. (您可能需要選取 [ 全部顯示 ] 以查看 [報告] 選項。 ) (You might need to select Show all to see the Reports option.)

  3. 選取 [ OneDrive 檔] 磚,或選取 [ 選取報表 > OneDrive 使用量]。Select the OneDrive files tile, or select Select a report > OneDrive usage.

    注意

    如果您在報告中看到 guid,而不是 URLs 和名稱,請在左窗格中,選取 [設定 > 服務 & 增益集],然後選取 [報告]。If you see GUIDs in the report instead of URLs and names, in the left pane, select Settings > Services & add-ins, and then select Reports. 清除方塊 顯示匿名識別碼,而不是所有報告中的名稱Clear the box Display anonymous identifiers instead of names in all reports.

  4. 在表格的右下方,選取 [ 匯出]。In the upper right of the table at the bottom, select Export.

使用 Microsoft 建立組織中所有 OneDrive URLs 的清單 PowerShellCreate a list of all the OneDrive URLs in your organization using Microsoft PowerShell

您在這些步驟中建立的清單會儲存至文字檔。The list you create in these steps will be saved to a text file.

  1. 下載最新的 SharePoint Online 管理命令介面Download the latest SharePoint Online Management Shell.

    注意

    如果您安裝的是舊版 SharePoint Online 管理命令介面,請移至 [新增或移除程式],並解除安裝 [SharePoint Online 管理命令介面]。If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell."
    在下載中心頁面上,選擇您的語言,然後按一下 [下載] 按鈕。On the Download Center page, select your language and then click the Download button. 系統會請您選擇下載 x64 或 x86 .msi 檔案。You'll be asked to choose between downloading a x64 and x86 .msi file. 如果您執行的是 64 位元版本的 Windows,請下載 x64 檔案;或如果您執行的是 32 位元版本,請下載 x86 檔案。Download the x64 file if you're running the 64-bit version of Windows or the x86 file if you're running the 32-bit version. 如果您不知道,請參閱我正在執行哪個版本的 Windows 作業系統?If you don't know, see Which version of Windows operating system am I running?. 下載檔案之後,請執行檔案,並按照安裝精靈中的步驟進行。After the file downloads, run it and follow the steps in the Setup Wizard.

  2. 將下列文字儲存至 PowerShell 檔。Save the following text to a PowerShell file. 例如,您可以將它儲存到名為 OneDriveSites.ps1 的檔案。For example, you could save it to a file named OneDriveSites.ps1.

    $TenantUrl = Read-Host "Enter the SharePoint admin center URL"
    $LogFile = [Environment]::GetFolderPath("Desktop") + "\OneDriveSites.log"
    Connect-SPOService -Url $TenantUrl
    Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | Select -ExpandProperty Url | Out-File $LogFile -Force
    Write-Host "Done! File saved as $($LogFile)."
    
  3. 開啟 SharePoint 線上管理命令介面。Open the SharePoint Online Management Shell. 流覽至已儲存並執行腳本的目錄:Navigate to the directory where the script has been saved and run:

    PS C:\>.\OneDriveSites.ps1
    

    注意

    如果您收到無法執行指令碼的錯誤訊息,您可能需要變更執行原則。If you get an error message about being unable to run scripts, you might need to change your execution policies. 如需詳細資訊,請參閱關於執行原則For info, see About Execution Policies.

  4. 腳本會提示您輸入 SharePoint 管理中心 URL。The script will prompt you for the SharePoint admin center URL. 例如," https://contoso-admin.sharepoint.com " 是 Contoso SharePoint admin CENTER URL。For example, "https://contoso-admin.sharepoint.com" is the Contoso SharePoint admin center URL.

  5. 系統會提示您登入。You will then be prompted to sign in. 使用 SharePoint 系統管理員或全域管理員帳戶。Use a SharePoint admin or global admin account.

在腳本成功完成之後,會在腳本中 $LogFile 變數所指定的位置中建立文字檔。After the script successfully completes, a text file is created in the location specified by the $LogFile variable in the script. 此檔案包含您組織中所有 OneDrive Url 的清單。This file contains a list of all OneDrive Urls in your organization. 下列文字提供如何格式化此檔案中的 Url 清單的範例。The following text provides an example of how the list of Urls in this file should be formatted.

                                                     
https://contoso-my.sharepoint.com/personal/annb_contoso_onmicrosoft_com/
https://contoso-my.sharepoint.com/personal/carolt_contoso_onmicrosoft_com/
https://contoso-my.sharepoint.com/personal/esterv_contoso_onmicrosoft_com/  
https://contoso-my.sharepoint.com/personal/hollyh_contoso_onmicrosoft_com/

詳細資訊More information

當您有使用者 OneDrive 的 URL 之後,您可以使用 Get-SPOSite 指令程式取得該使用者的詳細資訊,並使用 Set-SPOSite Cmdlet 變更設定。Once you have the URL for a user's OneDrive, you can get more info about it by using the Get-SPOSite cmdlet, and change settings by using the Set-SPOSite cmdlet.