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

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 69,460 Reputation points MVP Volunteer Moderator
    2024-03-24T16:02:00.8266667+00:00

    Install Microsoft.Graph.Identity.DirectoryManagement module


    hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.