Hybrid identity and access to Microsoft 365
Synchronising Active Directory with Entra ID, sign-in methods (PHS, PTA, federation), passwords and MFA, the Conditional Access baseline set, and administrative roles with PIM. A coherent hybrid identity model without unnecessary dependence on on-premises servers.
Hybrid identity links Active Directory accounts with Entra ID and Microsoft 365, so access to cloud services is decided by four areas: the synchronisation tool and scope, the place where the password is verified, the password and MFA policy, and administrative permissions in the tenant. A mistake in any of them affects the others: an unverified UPN suffix changes the sign-in name, an outage of on-premises servers stops sign-in, a Conditional Access policy without exclusions locks out administrators, and a Global Administrator role granted “to make it work” gives full control of the tenant. This document describes all four areas as one model.
Synchronisation: Connect Sync and Cloud Sync
Microsoft Entra Connect Sync (formerly Azure AD Connect) is a server with a synchronisation engine and a local SQL database, with a 30-minute cycle. High availability comes from a second server in staging mode, which imports data but exports nothing. Microsoft Entra Cloud Sync works the other way round: a lightweight agent reads Active Directory and talks to the cloud only through outbound connections, configuration is handled by a service in Entra ID, users synchronise every 10 to 20 minutes, and for high availability Microsoft recommends three agents.
The differences that matter when choosing are collected in the Microsoft decision guide:
| Area | Connect Sync | Cloud Sync |
|---|---|---|
| High availability | one active server and a staging server | multiple agents |
| Disconnected forests | no | yes |
| Scale | no limit per domain | 150,000 objects per domain |
| Group size | up to 250,000 members | up to 50,000 members |
| Synchronisation rules | advanced (Synchronization Rules Editor) | attribute expression builder |
| Cross-forest references | yes | no |
| Group provisioning from Entra ID to AD (apart from the older Group Writeback V1) | no | yes, requires Entra ID P1 |
Connect Sync is free of charge, and Microsoft Entra Connect Health requires Entra ID P1. Microsoft calls Cloud Sync the strategic direction and states that new features appear there first, so a new deployment starts with Cloud Sync unless it needs something from the Connect Sync column.
An existing Connect Sync deployment has to be upgraded to version 2.6.84.0 or later and configured with application-based authentication by 7 April 2027 (as of October 2026), because after that date synchronisation stops working without it. The migration wizard (Transition to Cloud Sync) handles only narrow environments; beyond its limits the options are manual migration or staying on Connect Sync. The two tools cannot export the same objects at the same time, so the wizard switches Connect Sync to staging mode and recommends a two-week verification period.
Scope, UPN and source anchor
The synchronisation scope is defined by organisational units. It covers the OU with employee accounts, for example OU=Employees,OU=Accounts,DC=corp,DC=example,DC=com. Service and administrative accounts stay outside the scope, and disabled accounts are moved to a separate unit, because an OU-based scope does not distinguish account state.
Entra ID keeps a UPN suffix only from a verified domain in the tenant. If the suffix is not verified (including .local or a single-label domain), the whole UPN is replaced with <MailNickName>@<initial domain> in the onmicrosoft.com domain, and the value is recalculated only after the UPN is changed on-premises or the list of verified domains changes. The fix lies on the AD side: adding example.com as an alternative suffix, verifying the domain in the tenant and changing the UPN of the accounts in scope. The UPN should equal the primary SMTP address from proxyAddresses.
The source anchor (sourceAnchor) is an immutable identifier linking an object in AD with an object in Entra ID, visible in the cloud as onPremisesImmutableId. Connect Sync (from version 1.1.524.0) uses ms-DS-ConsistencyGuid for users and objectGUID for other objects. The anchor is chosen at installation, although an existing deployment can be switched from objectGUID to ms-DS-ConsistencyGuid (from version 1.1.552.0). After an object is exported its anchor cannot be changed, and a second server, including a staging one, must use the same one. Cloud Sync uses ms-DS-ConsistencyGuid by default with a fallback to objectGUID and does not allow the anchor to be changed.
Matching accounts that already exist in the cloud
When a new object from AD reaches a tenant that has manually created accounts, Entra ID looks for an existing counterpart. Hard match compares sourceAnchor with onPremisesImmutableId (users only). Soft match compares the primary SMTP address with proxyAddresses, and when SoftMatchOnUpnEnabled is set, also userPrincipalName.
After a match the cloud account is managed on-premises, and every attribute that has a value in AD is overwritten, together with the password when password hash synchronisation is enabled. Values that exist only in the cloud are lost, so they have to be filled in AD before synchronisation. The documentation recommends blocking both kinds of matching and lifting the block only for the duration of the procedure that needs it:
Connect-MgGraph -Scopes 'OnPremDirectorySynchronization.ReadWrite.All'
$sync = Get-MgDirectoryOnPremiseSynchronization
$sync.Features | Select-Object BlockSoftMatchEnabled, BlockCloudObjectTakeoverThroughHardMatchEnabled, SoftMatchOnUpnEnabled
$sync.Features.BlockSoftMatchEnabled = $true
$sync.Features.BlockCloudObjectTakeoverThroughHardMatchEnabled = $true
Update-MgDirectoryOnPremiseSynchronization -OnPremisesDirectorySynchronizationId $sync.Id -Features $sync.Features
With the blocks enabled, an object that is supposed to join a cloud account ends with a synchronisation error, so for the duration of the matching the relevant flag is set to $false and afterwards back to $true. Blocking soft match has a side effect: new hybrid-joined devices report the InvalidSoftMatch error. Hard match is performed by writing into ms-DS-ConsistencyGuid in AD the value that corresponds to the cloud account’s onPremisesImmutableId; both sides written in Base64 must be identical.
Sign-in methods: PHS, PTA and federation
The sign-in method works independently of the choice of synchronisation tool. It is decided by one question: who verifies the password. Password hash synchronisation (PHS), pass-through authentication (PTA) and federation (AD FS) differ in infrastructure requirements, behaviour during an outage and maintenance cost.
With PHS, Entra Connect fetches the password hashes of changed accounts from the domain controller every two minutes, processes them further and sends them to Entra ID. Neither the password nor the original MD4 hash reaches the cloud, only the result of further hashing, which cannot be used in a pass-the-hash attack against the domain. Entra ID verifies the password, so no on-premises servers take part in sign-in.
With PTA, Entra ID encrypts the password with the public keys of the registered agents and places the request in the tenant’s queue. An agent picks it up, verifies the password in AD and returns the result over an outbound channel. With federation, Entra ID redirects the user to its own AD FS servers, which also requires proxy servers in the perimeter network and a certificate.
| PHS | PTA | |
|---|---|---|
| Where the password is verified | Entra ID | AD, through an agent |
| On-premises servers other than synchronisation | none | agents (3 recommended) |
| When on-premises servers fail | sign-in works | sign-in does not work |
| Account disabled in AD | up to 30 minutes’ delay | immediately |
| Locked-out account, expired password, logon hours | not supported | supported |
| Leaked credential detection | yes | only with additional PHS |
PHS, PTA and Seamless SSO do not require a paid Entra ID licence. Licences come into play only for features layered on top of sign-in, such as Conditional Access (P1) or risk policies (P2).
Account states and agent requirements
PHS carries the password, but not every account state. The locked-out and expired-password states are not synchronised, disabling an account reaches the cloud with a delay of up to 30 minutes, and the accountExpires attribute is not synchronised. A synchronised account has a non-expiring password in the cloud by default. If passwords are to expire in the cloud as well, the CloudPasswordPolicyForPasswordSyncedUsersEnabled feature is enabled, preferably before PHS is started, so that the first synchronisation does not set the DisablePasswordExpiration value on the accounts.
With PTA the agent receives the full result from AD, so disabled and locked-out accounts, expired passwords and logon hours are honoured at sign-in time. For that reason smart lockout is configured in Entra ID, so that an attack from the internet does not lock accounts in AD. Microsoft recommends at least three agents on separate servers close to the domain controllers, with outbound traffic on ports 80 and 443 and without TLS inspection. Installation on Server Core and cloning a machine that hosts an agent are not supported.
PHS always enabled
Microsoft recommends PHS regardless of the chosen method and gives three reasons, two of which are covered here. The first is an outage: organisations that had PHS alongside federation or PTA were back at work within hours of switching the method, while the others rebuilt their on-premises infrastructure over weeks (a description of cases, not a statistic). The switch is not automatic and requires an Entra Connect server and a cloud administrative account, because accounts from AD cannot sign in to the portal during an outage.
The second reason is leak detection. The “Leaked credentials” detection in ID Protection requires PHS for on-premises passwords, is available in Entra ID Free and P1, and always carries high risk. Full reports and risk-based policies require P2.
Seamless single sign-on (Seamless SSO) signs the user in without a password on a domain-joined computer. It works with PHS and PTA, and when it fails the user sees the ordinary password screen. The feature creates the computer account AZUREADSSOACC, whose Kerberos key no device changes, so Microsoft recommends manual rotation at least every 30 days with the Update-AzureADSSOForest command, once per forest.
Choosing a method and moving off federation
Without special requirements PHS is chosen: the least infrastructure, and sign-in works without on-premises servers. A requirement for immediate enforcement of account state, lockouts and logon hours points to PTA with PHS as a fallback. A third-party MFA provider does not force federation: external authentication methods satisfy the MFA requirement of Conditional Access policies, but do not work with authentication strength. Federation remains for a requirement that cannot be met without AD FS, for example signing in with the sAMAccountName, and its maintenance cost is the highest.
Microsoft recommends PHS as the target method when moving from federation to cloud authentication. Before the first step the federation configuration is saved as the basis for a rollback. The move consists of enabling PHS, staged rollout for pilot groups and converting domains to managed, one by one, in a maintenance window. Staged rollout is not an end state, because Microsoft discourages permanently mixing methods, and applications that depend on AD FS are migrated before it is switched off.
Passwords: NIST guidance and its translation to AD
The standards on which the classic password policy was based (a minimum of eight characters, an upper-case letter, a digit, a special character, a change every 90 days, a ban on reusing the last 24 passwords) abandoned it long ago. A forced change produces predictable variants (Spring2026!, then Summer2026!), and an account with such a password and no second factor is taken over in the first password spraying attack, that is, checking a few popular passwords against all accounts in an organisation. The reference point is the NIST SP 800-63B guidance, version 4:
| Previous rule | Current recommendation | Reason |
|---|---|---|
| minimum 8 characters and required complexity | minimum 15 characters when the password is the only factor, 8 with MFA; no requirements on character types | composition rules produce predictable patterns, length gives resistance |
| change every 30–90 days | change only on evidence of compromise | a forced change produces successive versions of the same password |
| no checking of password content | comparison against a banned list: popular, dictionary, organisation-related, known from breaches | attackers start from the same lists |
| short length limit, pasting forbidden | at least 64 characters, pasting allowed | passphrases and password managers |
| security questions and hints | none | answers are easy to find from public sources |
The password policy for domain accounts comes from a Group Policy object linked to the root of the domain, usually the Default Domain Policy, in Computer Configuration › Policies › Windows Settings › Security Settings › Account Policies › Password Policy. The same settings linked to an organisational unit affect only local computer accounts, not domain accounts.
The classic policy limits the minimum length to 14 characters. Newer versions of Windows Server allow this limit to be exceeded with the “Relax minimum password length limits” setting in the same branch, and the “Minimum password length audit” setting collects, in the domain controllers’ event log, information about passwords set that are shorter than the planned minimum. All domain controllers must support this mechanism, so the rollout starts with an audit, which Microsoft recommends running for three to six months.
A longer minimum for selected accounts is provided by a fine-grained password policy. It applies to users and global security groups; a policy assigned directly to a user wins over those assigned through groups, and Precedence decides only between policies at the same level (the lower value wins). The minimum length is not subject to the 14-character limit, and the requirements apply from the next password change of the group members. An example policy for administrators, created with New-ADFineGrainedPasswordPolicy and assigned to a group with Add-ADFineGrainedPasswordPolicySubject, has Precedence 10, a 20-character minimum, complexity enabled, a history of 24 passwords, a minimum password age of 1 day, a maximum of 365 days, and lockout after 10 attempts for 15 minutes (with an observation window of 15 minutes as well). Complexity stays enabled until the banned password list is deployed, because in AD alone it is the built-in mechanism that rejects a password containing the account name. Expiry after a year, despite the NIST recommendation of no periodic change, is a transitional stage until the banned list, MFA and detection of exposed credentials are in place; disabling expiry without those elements is a weakening, not a modernisation.
Microsoft Entra Password Protection for AD DS consists of an agent on every domain controller, which initiates the download of lists from Entra ID, and a proxy service that relays those requests. A new password is compared with the global list of weak passwords and with the organisation’s own list (up to 1,000 entries: company name, products, city, sports team names), after normalisation of typical substitutions, so P@ssw0rd is treated like password. The service requires an Entra ID P1 licence or higher and has an audit mode, with which the rollout starts. The list works when a password is changed or reset, not at sign-in, so existing weak passwords remain until the next change.
The policy does not cover accounts with PasswordNeverExpires set, and a service account whose password was set eight years ago usually has it stored in several scripts. Such accounts are found with Search-ADAccount -PasswordNeverExpires -UsersOnly. Each of them that can be a group managed service account (gMSA) should be one, because the domain generates and changes its password automatically; existing gMSAs are shown by Get-ADServiceAccount -Filter *. User accounts with an SPN are additionally exposed to Kerberoasting, and replacing them with a gMSA removes that risk.
Conditional Access: the baseline set
Conditional Access acts after the first authentication factor and decides whether to allow, require an additional check or deny. It requires Entra ID P1 (also included in Microsoft 365 Business Premium), and risk-based policies require P2. Deployment rests on a baseline set, an assessment of impact in report-only mode before each enablement, and exclusions that have an owner.
Security defaults and managed policies
Security defaults are available in Entra ID Free. They enforce MFA registration for all users, MFA for administrative roles and for access to Azure Resource Manager, and block legacy authentication and the device code flow. They cannot be customised, and moving to Conditional Access requires turning them off (Entra ID, Overview, Properties, Manage security defaults). Microsoft enables them on its own in new tenants.
After they are turned off, Microsoft provides managed policies that recreate their protection. They are created automatically in report-only mode and are enabled after at least 30 days (in some tenants sooner, as indicated by the notifications and the policy details) if the administrator does not touch them; the notification arrives two weeks earlier. Their state and exclusions can be changed, but not their name, and they cannot be deleted. The existing ones need to be known, so that requirements are not duplicated.
The policy set
Microsoft recommends policies from the “Secure foundation” category in the templates as the basis, and deploying them together. The set below contains three of them that do not require device management (CA002–CA004) and three from other categories: phishing-resistant MFA for administrators (Protect administrator, Emerging threats) and two risk policies (Zero Trust, Remote work). It omits MFA for Azure management and for administrative portals, which are also part of “Secure foundation”:
| Policy | Users | Apps and conditions | Control | Licence |
|---|---|---|---|---|
CA001-Admins-PhishResistantMFA | built-in directory roles | all resources | Phishing-resistant MFA | P1 |
CA002-AllUsers-RequireMFA | all users | all resources | Multifactor authentication | P1 |
CA003-AllUsers-BlockLegacyAuth | all users | Exchange ActiveSync clients and Other clients | block access | P1 |
CA004-AllUsers-SecurityInfoRegistration | all users except guests | the Register security information action | selected authentication strength | P1 |
CA010-AllUsers-SignInRisk | all users | sign-in risk | MFA | P2 |
CA011-AllUsers-UserRisk | all users | user risk | password change | P2 |
The name gives the number, scope and effect according to the pattern CA<number>-<scope>-<effect>, so that the list in the portal sorts itself.
Authentication strength is a built-in set of allowed methods: Multifactor authentication, Passwordless MFA and Phishing-resistant MFA. For administrators the last one is chosen, but only after they have registered suitable methods, for example a FIDO2 key; otherwise the policy closes the portal to them. Registration is helped by a Temporary Access Pass. External authentication methods do not yet work with authentication strength.
CA001 covers only built-in roles, and the reference point is the list of fourteen roles from the managed MFA policy for administrators. Roles scoped to an administrative unit and custom roles need a separate policy. CA003 blocks what does not support MFA: according to Microsoft, over 99 per cent of password spray attacks use legacy protocols. Before it is enabled, the clients that use them have to be found, for example printers that send mail or scripts reading a mailbox over IMAP. CA004 protects the moment of method registration, because someone who knows the password could otherwise register their own phone; from 6 July 2026 it also applies to registering Windows Hello for Business and Platform SSO on macOS. The All users option also covers B2B guests, who can be selected separately and covered by a distinct policy.
MFA methods
Administrators receive phishing-resistant methods, enforced by the built-in “Phishing-resistant MFA” authentication strength (requires Entra ID P1). The methods differ in resistance, convenience and cost:
| Method | Phishing resistance | Convenience | Cost |
|---|---|---|---|
| SMS, voice call | no: number takeover, a code that can be retyped on a fake page | medium | none or SMS charges |
| One-time code from an app (TOTP) | no: the code can be retyped on a fake page | medium | none |
| Push notification with number matching | no: protects against notification flooding, but not against an intermediary page | high | none |
| Passkey in an authenticator app | yes | high | no additional hardware |
| Windows Hello for Business | yes | very high on one’s own computer | TPM module, deployment project |
| FIDO2 hardware key | yes | high | purchase of keys, ideally two per person |
| Certificate, smart card | yes | medium | PKI infrastructure, cards and readers |
In an adversary-in-the-middle attack (the attacker acting as an intermediary), the intermediary page passes the password, code and push approval on to the real service and takes over the session after sign-in. Phishing-resistant methods are bound to the real server: FIDO2 and passkeys sign the challenge with a key tied to the domain, so a signature generated for a fake domain is useless, and certificate authentication relies on the TLS channel and verification of the server certificate.
Report-only mode before each enablement
Every policy is created in the Report-only state: the system evaluates it at each sign-in and records the result, but enforces nothing. The result has four variants: Success, Failure, User action required and Not applied. “User action required” means the policy would require an interactive check, for example MFA, which report-only mode does not perform.
Report-only mode does not evaluate policies scoped to user actions, so CA004 is tested on a pilot group. Policies that require a compliant device can, in report-only mode, trigger a certificate selection prompt on macOS, iOS and Android, so those platforms are excluded until the pilot. Four tools support the assessment:
- Policy impact in the policy view shows the effect on interactive sign-ins from the last 24 hours, 7 days or a month; it requires the Security Reader role.
- The sign-in log contains the Conditional Access and Report-only tabs with the result of each policy.
- The Conditional Access insights and reporting workbook summarises results for selected users, applications and a period of up to 90 days; it requires P1 and a Log Analytics workspace with sign-in logs.
- What If simulates the sign-in of a given user or service principal.
The results of a specific policy are extracted by a query against the workspace (the value names are given in the Microsoft Graph documentation):
SigninLogs
| where TimeGenerated > ago(14d)
| mv-expand policy = todynamic(ConditionalAccessPolicies)
| where policy.displayName == "CA002-AllUsers-RequireMFA"
| where tostring(policy.result) in ("reportOnlyFailure", "reportOnlyInterrupted")
| summarize signins = count() by UserPrincipalName, AppDisplayName, result = tostring(policy.result)
| order by signins desc
reportOnlyInterrupted entries also include ordinary sign-ins of users who would simply have completed MFA. A policy is enabled after a period that covers all sign-in patterns, for example two weeks, once the results are explained: a sign-in that MFA cannot handle is an account to exclude, a client to fix or a user without a registered method.
Exclusions and policy export
Every exclusion is a gap, so it should be short, named and have an owner.
- Emergency accounts. Microsoft recommends excluding them from policies that block or restrict sign-in, through a dedicated group with fixed membership. The exclusion is in the policy from day one, not added after administrators are locked out.
- The synchronisation account and service accounts. In policies that cover all users, the Directory Synchronization Accounts directory role is excluded, as its accounts do not register MFA. Service accounts that are ordinary cloud users cannot complete MFA, so they need an exclusion or replacement with a managed identity. Service principals are covered by separate Conditional Access for workload identities (Workload Identities Premium licence).
- The rest in one group. A printer, a contractor account during registration or a user with a broken phone go into the
GG-CA-Exclusionsgroup. The group has an owner, every entry has a justification and an end date, and a monthly review removes expired ones.
Change history comes from saving each policy to a separate JSON file in a repository: the Get-MgIdentityConditionalAccessPolicy -All cmdlet (scope Policy.Read.All) returns the policies, which go to files through ConvertTo-Json -Depth 10. The difference between exports shows what changed, and the audit log filtered by the Conditional Access service shows who did it. The same cmdlet reads the state, change date and number of exclusions of each policy: an enabledForReportingButNotEnforced state older than a few weeks means a policy that protects nothing, and a blocking policy with no exclusion at all has no emergency exit.
Administrative roles in Entra ID
Microsoft recommends assigning the Global Administrator role to fewer than five people, and a typical tenant has many more: support accounts that received the role “to reset passwords”, accounts synchronised from Active Directory and accounts of people who changed department. Any of them can turn off Conditional Access policies and change permissions in the tenant, and taking over the on-premises domain means taking over the synchronised accounts in the cloud. Global Administrator is a role for emergencies, not for daily work.
Built-in roles instead of Global Administrator
Entra ID has many built-in roles, and using them requires no licence. Microsoft maintains a table of least-privileged roles for tasks. Typical tasks of a hybrid administrator:
| Task | Role instead of Global Administrator | Notes |
|---|---|---|
| Reset the password of a user without a role | Password Administrator | Helpdesk Administrator does the same |
| A user’s authentication methods | Authentication Administrator | for accounts with roles: Privileged Authentication Administrator |
| Accounts and groups | User Administrator | groups only: Groups Administrator |
| Enterprise applications and consent | Cloud Application Administrator | does not approve Microsoft Graph application permissions |
| Conditional Access | Conditional Access Administrator | policies are covered by the baseline set above |
| Synchronisation, PTA, Seamless SSO | Hybrid Identity Administrator | |
| Reading all configuration | Global Reader | changes nothing |
| Assigning roles | Privileged Role Administrator | can grant a role to itself |
From five Global Administrator assignments the overview page in the admin centre shows a warning card. The second threshold applies to all roles labelled PRIVILEGED: fewer than ten assignments. A practical split is two emergency accounts with the role permanently assigned, and one or two people with an eligible assignment in PIM for tasks that a narrower role does not cover. Privileged Role Administrator counts as Global Administrator, because it grants any role.
Entra ID roles should be held only by accounts created in the cloud; the OU=Admin unit stays outside synchronisation. A person therefore has two accounts: the daily one with a mailbox, and an administrative account in the tenant’s domain, without a mail licence, ideally with a FIDO2 key.
Scope: administrative units, groups and custom roles
An administrative unit is a container for users, groups and devices that narrows the scope of a role: Helpdesk Administrator scoped to AU-Sales resets passwords only for accounts in that unit. Creating units works in Entra ID Free, but every administrator with a role scoped to a unit needs a P1 licence. Rules that tend to surprise during deployment:
- A group added to a unit brings itself into scope, not its members; department accounts have to be added directly or by a dynamic rule (every member of a dynamic unit then requires a P1 licence).
- Units cannot be nested, and a resource can belong to at most 30 units.
- Only some roles can be assigned in a unit’s scope (including Helpdesk, Password, Authentication, User, Groups and License Administrator), as well as custom roles. Roles that reset passwords within a unit’s scope act only on users without administrative roles.
- A restricted management unit protects objects from every administrator without an assignment in its scope, including Global Administrator; it is set only at creation.
Roles are more conveniently assigned to groups than to people. The group has to be created with the isAssignableToRole property set to true, which requires a P1 licence. The property is immutable, so an existing group cannot be converted, membership has to be assigned (no dynamic rules or nesting), and on-premises AD groups cannot receive Entra roles. When no built-in role fits, a custom role is composed from the permissions available for such roles, for example rotating the secrets of one application without the right to change its permissions (the microsoft.directory/applications/credentials/update permission scoped to the application object); a tenant can have 100 such roles.
PIM: an eligible assignment instead of a standing one
PIM requires a Microsoft Entra ID P2 or Microsoft Entra ID Governance licence for users with eligible or time-bound assignments, approvers and participants of access reviews. An eligible assignment gives only the right to activate: the administrator provides a justification, passes authentication and receives the role for a set time. Role settings are defined separately for each role:
| Setting | Value for privileged roles | Notes |
|---|---|---|
| Activation maximum duration | e.g. 2–4 h | range 1–24 h |
| On activation, require | Conditional Access authentication context | MFA alone may not prompt again if the session already contains it |
| Require justification on activation | yes | |
| Require approval to activate | yes for Global Administrator and Privileged Role Administrator | at least two approvers recommended |
| Expire eligible assignment after | e.g. 12 months | |
| Allow permanent active assignment | no | exception: emergency accounts |
The authentication context ties activation to a Conditional Access policy, for example with a phishing-resistant authentication strength and the “Every time” sign-in frequency. The policy has to be created and enabled before the context is selected in PIM, because a policy in report-only mode enforces nothing. Whoever manages Conditional Access can weaken the activation requirements, so Conditional Access Administrator also belongs in PIM. The script creates a group and assigns it an eligible role scoped to a unit for one year:
# Changes configuration. Requires the Privileged Role Administrator role, P1 (group) and P2 (PIM)
# Group members have to be added separately; the eligible assignment applies to the group itself
Connect-MgGraph -Scopes 'Group.ReadWrite.All', 'RoleManagement.ReadWrite.Directory',
'RoleEligibilitySchedule.ReadWrite.Directory', 'AdministrativeUnit.Read.All'
$group = New-MgGroup -DisplayName 'GG-Entra-Helpdesk' -MailEnabled:$false -SecurityEnabled `
-MailNickname 'gg-entra-helpdesk' -IsAssignableToRole:$true
$role = Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Helpdesk Administrator'"
$au = Get-MgDirectoryAdministrativeUnit -Filter "displayName eq 'AU-Sales'"
New-MgRoleManagementDirectoryRoleEligibilityScheduleRequest -BodyParameter @{
action = 'adminAssign'
justification = 'Sales department helpdesk'
roleDefinitionId = $role.Id
directoryScopeId = "/administrativeUnits/$($au.Id)"
principalId = $group.Id
scheduleInfo = @{
startDateTime = (Get-Date).ToUniversalTime()
expiration = @{ type = 'afterDateTime'; endDateTime = (Get-Date).AddYears(1).ToUniversalTime() }
}
}
Three alerts are reviewed in the Alerts tab: “Roles are being assigned outside of Privileged Identity Management”, “There are too many Global Administrators” and “Potential stale accounts in a privileged role”. Periodic verification of assignments is provided by access reviews in PIM, available with a P2 or Governance licence; some newer review features require Microsoft Entra ID Governance or Microsoft Entra Suite. When the P2 or Governance licence expires, PIM removes eligible assignments and active time-bound assignments become permanent: administrators lose the ability to activate, and former temporary permissions remain indefinitely.
Entra ID roles and Azure RBAC roles
These are two separate permission systems: Entra ID roles concern users, groups, applications and tenant settings, while Azure RBAC roles concern subscriptions and resources. Global Administrator has no access to Azure resources by default. The “Access management for Azure resources” switch grants it the User Access Administrator role in all subscriptions of the tenant, so using it is an event to document and revert.
Decisions and alternatives
| Area | Approach | When it makes sense | Limitation |
|---|---|---|---|
| Synchronisation | Cloud Sync | new deployment, disconnected forests, no advanced rules | limits of 150,000 objects per domain and 50,000 group members; simpler attribute rules |
| Synchronisation | Connect Sync | advanced rules, large groups, cross-forest references, scale above the Cloud Sync limits | a server with a SQL database and a staging server; upgrade and application-based authentication required by 7 April 2027 |
| Sign-in | PHS | default choice without special requirements | account disabling delayed by up to 30 minutes; lockouts and logon hours not honoured |
| Sign-in | PTA with PHS as a fallback | immediate enforcement of account state, lockouts and logon hours | dependence on agents (at least 3) and domain controllers; during an outage sign-in requires a manual switch to PHS |
| Sign-in | Federation (AD FS) | a requirement that cannot be met in the cloud, e.g. signing in with the sAMAccountName | highest maintenance cost: AD FS servers, proxies, certificates |
| Protection | Security defaults | a tenant without P1 licences | cannot be customised, turned off before Conditional Access is deployed |
| Protection | Conditional Access with the baseline set | a tenant with P1, exclusions and role-specific policies needed | requires report-only mode, exclusions with an owner and a review |
| Roles | Standing assignment | emergency accounts only | standing permissions increase the impact of an account takeover |
| Roles | Eligible assignment in PIM | administrative accounts, tasks that require Global Administrator | requires P2 or Governance; licence expiry removes eligible assignments |
Implementation
- Synchronisation: the tool is chosen according to the comparison, and before the start the domain with the UPN suffix is verified in the tenant, the UPN is set equal to the primary SMTP address and the scope is limited to the unit with employee accounts. Check: the list of objects in scope contains no service or administrative accounts, and accounts in the cloud have no sign-in names in the onmicrosoft.com domain.
- Account matching: before the first synchronisation it is established which accounts already exist in the cloud, their attributes are filled in AD and both matching blocks are enabled; for the duration of the matching procedure the relevant block is set to
$false. Check: no objects taken over by accident, synchronisation errors only for accounts deliberately deferred. - Sign-in method: PHS is enabled before any change of method, smart lockout is configured and, with PTA, three agents. When moving off federation: the configuration is saved, staged rollout is run for pilot groups, and domains are converted to managed one at a time in a maintenance window. Check: pilot users’ sign-in works with the connection to on-premises servers cut.
- Passwords: a “Minimum password length audit” for three to six months, a reading of the default domain policy (
Get-ADDefaultDomainPasswordPolicy) for a minimum length of 15 characters and a lockout threshold, a fine-grained policy for administrators, and Entra Password Protection in audit mode and then in enforcement mode. Check: the list of accounts withPasswordNeverExpiresis known and justified. - Conditional Access: security defaults are turned off after the managed policies are checked, baseline policies are created in report-only mode with the emergency accounts, the Directory Synchronization Accounts role and the
GG-CA-Exclusionsgroup excluded, results are assessed in the log, workbook and What If, and the policies are enabled after a period covering all sign-in patterns. Check: administrators have phishing-resistant methods registered beforeCA001is enabled, and legacy-protocol clients were identified beforeCA003. - Roles: an inventory of accounts with roles (cloud account, no synchronisation from AD, sign-in within the last 90 days, MFA registered), tasks moved to narrow roles, groups with
isAssignableToRole, administrative units, and finally eligible assignments in PIM with activation settings and designated approvers. Check: apart from emergency accounts there are no standing Global Administrator assignments, and PIM alerts are empty.
Limitations and pitfalls
- Sign-in method in staging mode. The sign-in method choice in the Entra Connect wizard is a tenant setting: choosing an option other than PTA on a staging server disables PTA across the whole tenant and overwrites the primary server’s setting. The sign-in method is not changed on a staging server.
- Two tools exporting the same objects. A switched-off but not uninstalled Connect Sync server, if started by accident, can overwrite attributes with old values every cycle. After migration it is uninstalled completely.
- Hard match on administrative accounts. Microsoft strongly discourages linking on-premises accounts with administrative accounts in the cloud. From 1 July 2026 Entra ID may block hard match on an account with an assigned or eligible privileged role and on an account with
onPremisesObjectIdentifierset; cloud-managed accounts with writeback enabled are excluded from this protection, and a temporary workaround is available until it is fixed. The protection works on the cloud side, so it also applies to Cloud Sync, and administrative accounts are created separately in the cloud. - Exclusions in policy templates. Templates of user-targeted policies exclude only the account that creates them. Emergency accounts, the synchronisation account and the exclusion group are added after the policy is created, still in report-only mode.
- Tenant lockout through PIM. When all Privileged Role Administrators and Global Administrators have only eligible assignments, activation requires approval and no approvers are designated, nobody can activate a role. The safeguard is emergency accounts with a standing assignment and explicitly designated approvers.
Sources
- Choose the right authentication method for hybrid identity (Entra ID)
- Connect Sync and Cloud Sync decision guide
- Upgrading Entra Connect Sync
- Entra Connect design concepts (sourceAnchor)
- NIST SP 800-63B
- Conditional Access managed policies
- Least privileged roles by task
- Entra ID Governance and PIM licensing