Get the Password Hash Sync setting for Entra Cloud Sync using Microsoft Graph and PowerShell
# Determines whether password hash sync is enabled for the job. This only applies to "User and group sync" jobs.
function Get-IsPasswordHashSyncEnabled {
param (
$Job
)
$schema = Get-MgServicePrincipalSynchronizationJobSchema -ServicePrincipalId $configuration.Id -SynchronizationJobId $Job.Id;
foreach ($objectMapping in $schema.SynchronizationRules[0].ObjectMappings)
{
if ($objectMapping.SourceObjectName -eq "user")
{
foreach ($attributeMapping in $objectMapping.AttributeMappings)
{
if ($attributeMapping.TargetAttributeName -eq "CredentialData")
{
return $true;
}
}
}
}
return $false;
}
Comments
Post a Comment