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.
11,445 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,244 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,328 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,629 questions
{count} votes

1 answer

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

    Install Microsoft.Graph.Identity.DirectoryManagement module


    hth

    Marcin

    0 comments No comments