Skip to content

Commit 0830d87

Browse files
authored
Update cannot-manage-objects.md
1 parent bb72f85 commit 0830d87

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

support/entra/entra-id/user-prov-sync/cannot-manage-objects.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Resolves an issue that you can't manage or remove objects created t
44
ms.date: 08/30/2021
55
ms.reviewer:
66
ms.service: entra-id
7-
ms.custom: sap:Microsoft Entra Connect Sync, has-azure-ad-ps-ref
7+
ms.custom: sap:Microsoft Entra Connect Sync, no-azure-ad-ps-ref
88
---
99
# Can't manage or remove objects that were synchronized through the Azure Active Directory Sync tool
1010

@@ -34,27 +34,30 @@ This issue may occur if one or more of the following conditions are true:
3434

3535
You want to manage objects in Office 365, Azure, or Intune and you no longer want to use directory synchronization.
3636

37-
[!INCLUDE [Azure AD PowerShell deprecation note](~/../support/reusable-content/msgraph-powershell/includes/aad-powershell-deprecation-note.md)]
38-
39-
1. If you're not running Windows 10, install the 64-bit version of the Microsoft Online Services Sign-in Assistant: [Microsoft Online Services Sign-in Assistant for IT Professionals RTW](https://download.microsoft.com/download/7/1/E/71EF1D05-A42C-4A1F-8162-96494B5E615C/msoidcli_32bit.msi).
40-
1. Install the Microsoft Azure Active Directory module for Windows PowerShell:
41-
42-
1. Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).
43-
2. Run the `Install-Module MSOnline` command.
44-
45-
1. Disable directory synchronization by running the following command:
37+
1. Make sure that [Microsoft Graph PowerShell is installed](/powershell/microsoftgraph/installation).
38+
2. Use the `Connect-MgGraph` command to sign in with the required scopes such as `Organization.ReadWrite.All`. For more information, see [Get started with the Microsoft Graph PowerShell SDK](/powershell/microsoftgraph/get-started).
39+
1. Disable directory synchronization by running the [update-mgorganization](/powershell/module/microsoft.graph.identity.directorymanagement/update-mgorganization) command.
4640

4741
```powershell
48-
Set-MsolDirSyncEnabled -EnableDirSync $false
42+
43+
$organizationId = (Get-MgOrganization).Id
44+
45+
# Store the False value for the DirSyncEnabled Attribute
46+
$params = @{
47+
onPremisesSyncEnabled = $False
48+
}
49+
50+
# Perform the update
51+
Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params
4952
```
5053
51-
1. Check that directory synchronization was fully disabled by using the Windows PowerShell. To do it, run the following command periodically:
54+
1. Check that directory synchronization was fully disabled. To do it, run the following command:
5255
5356
```powershell
54-
(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled
57+
Get-MgOrganization | Select OnPremisesSyncEnabled
5558
```
5659
57-
This command will return **True** or **False**. Continue to run this command periodically until it returns **False**, and then go to the next step.
60+
This command will return **True** or ***False**. Continue to run this command periodically until it returns **False**, and then go to the next step.
5861
5962
It may take 72 hours for deactivation to be completed. The time depends on the number of objects that are in your cloud service subscription account.
6063

0 commit comments

Comments
 (0)