Azure Stack Hub オペレーターは、Azure Stack Hub ユーザーが要求したときに、ポータルのユーザー データをオンデマンドでクリアできます。 Azure Stack Hub ユーザーは、タイルをピン留めしてダッシュボードのレイアウトを変更することで、ポータルをカスタマイズできます。 ユーザーは、テーマを変更し、個人の好みに合わせて既定の言語を調整することもできます。
ポータル ユーザー データには、Azure Stack Hub ユーザー ポータルでお気に入りと最近アクセスしたリソースが含まれます。 この記事では、ポータルのユーザー データをクリアする方法について説明します。
ポータルのユーザー設定の削除は、ユーザー サブスクリプションが削除された後にのみ行う必要があります。
注
この記事のガイダンスに従った後も、一部のユーザー データはイベント ログのシステム セクションに引き続き存在できます。 このデータは、ログが自動的にロールオーバーされるまで数日間保持できます。
[前提条件]
- PowerShell for Azure Stack Hub をインストールします。
- GitHub から最新の Azure Stack Hub ツールをダウンロードします。
- ユーザー アカウントは引き続きディレクトリに存在する必要があります。
- 管理者 Resource Manager エンドポイントにアクセスするための Azure Stack Hub 管理者資格情報。
注
ゲスト ディレクトリ (マルチテナント) から招待されたユーザーからポータル ユーザー情報を削除する場合は、そのディレクトリで読み取りアクセス許可が必要です。 詳細については、 この記事の後半の CSP シナリオを参照してください。
ユーザー プリンシパル名を使用してポータルのユーザー データをクリアする
このシナリオでは、既定のプロバイダー サブスクリプションとユーザーが同じディレクトリに属しているか、ユーザーが存在するディレクトリへの読み取りアクセス権があることを前提としています。
続行する前 に、GitHub から最新バージョンの Azure Stack Hub ツールをダウンロード してください。
この手順では、Azure Stack Hub の管理者 Resource Manager エンドポイントと通信できるコンピューターを使用します。
管理者特権の Windows PowerShell セッション (管理者として実行) を開き、 AzureStack-Tools-az ディレクトリのルート フォルダーに移動し、必要な PowerShell モジュールをインポートします。
Import-Module .\DatacenterIntegration\Portal\PortalUserDataUtilities.psm1
次のコマンドを実行します。 プレースホルダーは、実際の環境に一致する値に置き換えてください。
## 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 オペレーターがポータルのユーザー データを削除するには、少なくともユーザー オブジェクト ID が必要です。
ユーザーはオブジェクト ID のクエリを実行し、Azure Stack Hub オペレーターに提供する必要があります。 オペレーターは、ユーザーが存在するディレクトリにアクセスできません。
ユーザーがユーザー オブジェクト ID を取得する
管理者特権の Windows PowerShell セッションを開き (管理者として実行)、 AzureStack-Tools-az ディレクトリのルート フォルダーに移動し、必要な PowerShell モジュールをインポートします。
Import-Module .\DatacenterIntegration\Portal\PortalUserDataUtilities.psm1
次のコマンドを実行します。 プレースホルダーは、実際の環境に一致する値に置き換えてください。
## 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
注
ユーザーは、前のスクリプトの出力であるユーザー オブジェクト ID を Azure Stack Hub オペレーターに指定する必要があります。
Azure Stack Hub オペレーターがポータルのユーザー データを削除する
Azure Stack Hub オペレーターとしてユーザー オブジェクト ID を受け取った後、次のコマンドを実行してポータルのユーザー データを削除します。
管理者特権の Windows PowerShell セッションを開き (管理者として実行)、 AzureStack-Tools-az ディレクトリのルート フォルダーに移動し、必要な PowerShell モジュールをインポートします。
Import-Module .\DatacenterIntegration\Portal\PortalUserDataUtilities.psm1
次のコマンドを実行して、環境に合わせてパラメーターを調整します。
## 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 Stack Hub を Azure に登録 し、ユーザーに提供する項目 を Azure Stack Hub Marketplace に設定します。