Skip to content

Commit 06b0cb3

Browse files
authored
Update directory-delete-howto.md
Adding additional warnings around verifying your PowerShell module session context before deleting all service principals.
1 parent ae3984d commit 06b0cb3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

articles/active-directory/enterprise-users/directory-delete-howto.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,14 @@ A few enterprise applications can't be deleted in the Azure portal and might blo
132132
>
133133
> Before you proceed, verify that you're connected to the tenant that you want to delete with the MSOnline module. We recommend that you run the `Get-MsolDomain` command to confirm that you're connected to the correct tenant ID and `onmicrosoft.com` domain.
134134
135-
5. Run the following command to set the tenant context:
135+
5. Run the following commands to set the tenant context. DO NOT skip these steps or you run the risk of deleting enterprise apps from the wrong teant.
136136

137+
`Clear-AzContext -Scope CurrentUser`
137138
`Connect-AzAccount -Tenant \<object id of the tenant you are attempting to delete\>`
139+
`Get-AzContext`
138140

139141
>[!WARNING]
140-
> Before you proceed, verify that you're connected to the tenant that you want to delete with the Az PowerShell module. We recommend that you run the `Get-AzContext` command to check the connected tenant ID and `onmicrosoft.com` domain.
142+
> Before you proceed, verify that you're connected to the tenant that you want to delete with the Az PowerShell module. We recommend that you run the `Get-AzContext` command to check the connected tenant ID and `onmicrosoft.com` domain. Do NOT skip the above steps or you run the risk of deleting enterprise apps from the wrong tenant.
141143
142144
6. Run the following command to remove any enterprise apps that you can't delete:
143145

0 commit comments

Comments
 (0)