Unable to run the Graph command in Powershell

Jane doe 0 Reputation points
2024-03-24T15:37:03.8566667+00:00

I'm unable to run the command for

EnforceCloudPasswordPolicyForPasswordSyncedUsers

Getting this Error PFA.

$OnPremSync = Get-MgDirectoryOnPremiseSynchronization

$OnPremSync.Features.CloudPasswordPolicyForPasswordSyncedUsersEnabled = $true

Update-MgDirectoryOnPremiseSynchronization `

-OnPremisesDirectorySynchronizationId $OnPremSync.Id `

-Features $OnPremSync.Features

User's image

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,581 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,850 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,050 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,459 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 10,360 Reputation points MVP
    2024-03-24T16:02:00.8266667+00:00

    Install Microsoft.Graph.Identity.DirectoryManagement module


    hth

    Marcin

    0 comments No comments