共用方式為


從 Azure Stack Hub 清除入口網站用戶數據

Azure Stack Hub作員可以在 Azure Stack Hub 使用者要求時視需要清除入口網站用戶數據。 身為 Azure Stack Hub 使用者,您可以藉由釘選磚塊及變更平臺的儀表板配置來自訂化您的平臺。 使用者也可以變更主題,並調整預設語言以符合個人喜好設定。

入口網站使用者資料包括 Azure Stack Hub 使用者入口網站中的我的最愛和最近存取的資源。 本文說明如何清除入口網站用戶數據。

只有在刪除使用者訂用帳戶之後,才能移除入口網站用戶設定。

注意

遵循本文中的指引之後,某些用戶數據仍可存在於事件記錄的系統區段中。 此資料可以保留數天,直到紀錄自動轉換為止。

先決條件

注意

如果您嘗試刪除從來賓目錄(多租戶)邀請的使用者的入口網站用戶資訊,則必須在該目錄中擁有讀取權限。 如需詳細資訊,請參閱本文稍後的 CSP 案例

使用使用者主體名稱清除入口網站使用者資料

此案例假設預設提供者訂用帳戶和使用者是相同目錄的一部分,或您擁有使用者所在目錄的讀取許可權。

在繼續之前,請務必 從 GitHub 下載最新版的 Azure Stack Hub 工具

針對此程序,請使用可以與 Azure Stack Hub 管理 Resource Manager 端點通訊的電腦。

  1. 開啟提升許可權的 Windows PowerShell 工作階段(以系統管理員身分執行)、移至 AzureStack-Tools-az 目錄中的根資料夾,然後匯入所需的 PowerShell 模組:

    Import-Module .\DatacenterIntegration\Portal\PortalUserDataUtilities.psm1
    
  2. 執行下列命令。 請務必以符合您環境的值取代佔位元:

    ## The following Azure Resource Manager endpoint is for the ASDK. If you are in a multinode environment, contact your operator or service provider to get the endpoint.
    
    $adminARMEndpoint = "https://adminmanagement.local.azurestack.external"
    
    ## Replace the following value with the Azure Stack Hub directory tenant ID.
    $azureStackDirectoryTenantId = "f5025bf2-547f-4b49-9693-6420c1d5e4ca"
    
    ## Replace the following value with the user directory tenant ID.
    $userDirectoryTenantId = " 7ddf3648-9671-47fd-b63d-eecd82ed040e"
    
    ## Replace the following value with name of the user principal whose portal user data is to be cleared.
    $userPrincipalName = "myaccount@contoso.onmicrosoft.com"
    
    Clear-AzsUserDataWithUserPrincipalName -AzsAdminArmEndpoint $adminARMEndpoint `
     -AzsAdminDirectoryTenantId $azureStackDirectoryTenantId `
     -UserPrincipalName $userPrincipalName `
     -DirectoryTenantId $userDirectoryTenantId
    

    注意

    azureStackDirectoryTenantId 是選擇性的。 如果您未指定此值,腳本會在 Azure Stack Hub 中註冊的所有租用戶目錄中搜尋用戶主體名稱,然後清除所有相符使用者的入口網站數據。

清除來賓目錄中的入口網站用戶數據

在此案例中,Azure Stack Hub作員無法存取使用者所在的客體目錄。 當您是雲端解決方案提供者 (CSP) 時,這是常見的案例。

若要讓 Azure Stack Hub作員移除入口網站用戶數據,至少需要使用者物件識別碼。

用戶必須查詢物件標識碼,並將其提供給 Azure Stack Hub作員。 作員無法存取使用者所在的目錄。

使用者擷取用戶物件標識碼

  1. 開啟提升許可權的 Windows PowerShell 工作階段(以系統管理員身分執行),移至 azureStack-Tools-az 目錄中的根資料夾,然後匯入必要的 PowerShell 模組。

    Import-Module .\DatacenterIntegration\Portal\PortalUserDataUtilities.psm1
    
  2. 執行下列命令。 請務必以符合您環境的值取代佔位元。

    ## The following Azure Resource Manager endpoint is for the ASDK. If you are in a multinode environment, contact your operator or service provider to get the endpoint.
    $userARMEndpoint = "https://management.local.azurestack.external"
    
    ## Replace the following value with the directory tenant ID, which contains the user account.
    $userDirectoryTenantId = "3160cbf5-c227-49dd-8654-86e924c0b72f"
    
    ## Replace the following value with the name of the user principal whose portal user data is to be cleared.
    $userPrincipleName = "myaccount@contoso.onmicrosoft.com"
    
    Get-UserObjectId -DirectoryTenantId $userDirectoryTenantId `
     -AzsArmEndpoint $userARMEndpoint `
     -UserPricinpalName $userPrincipleName
    

    注意

    身為使用者,您必須將先前腳本輸出的用戶物件識別碼提供給 Azure Stack Hub作員。

Azure Stack Hub作員會移除入口網站用戶數據

以 Azure Stack Hub 作員身分接收使用者物件識別碼之後,請執行下列命令來移除入口網站用戶數據:

  1. 開啟提升許可權的 Windows PowerShell 工作階段(以系統管理員身分執行),移至 azureStack-Tools-az 目錄中的根資料夾,然後匯入必要的 PowerShell 模組。

    Import-Module .\DatacenterIntegration\Portal\PortalUserDataUtilities.psm1
    
  2. 執行下列命令,確定您調整 參數以符合您的環境:

    ## The following Azure Resource Manager endpoint is for the ASDK. If you are in a multinode environment, contact your operator or service provider to get the endpoint.
    $AzsAdminARMEndpoint = "https://adminmanagement.local.azurestack.external"
    
    ## Replace the following value with the Azure Stack Hub directory tenant ID.
    $AzsAdminDirectoryTenantId = "f5025bf2-547f-4b49-9693-6420c1d5e4ca"
    
    ## Replace the following value with the directory tenant ID of the user to clear.
    $DirectoryTenantId = "3160cbf5-c227-49dd-8654-86e924c0b72f"
    
    ## Replace the following value with the name of the user principal whose portal user data is to be cleared.
    $userObjectID = "s-1-*******"
    Clear-AzsUserDataWithUserObject -AzsAdminArmEndpoint $AzsAdminARMEndpoint `
     -AzsAdminDirectoryTenantId $AzsAdminDirectoryTenantId `
     -DirectoryTenantID $DirectoryTenantId `
     -UserObjectID $userObjectID `
    

後續步驟

  • 向 Azure 註冊 Azure Stack Hub,並在 Azure Stack Hub Marketplace 填入 專案以提供您的使用者。