GuíasGuides · Nivel 4Level 4

Microsoft 365: los roles de administración, PIM y las cuentas de emergenciaMicrosoft 365: admin roles, PIM and the emergency accounts

Inventariar quién es administrador hoy, pasar cada tarea al rol mínimo, dejar dos cuentas de emergencia bien guardadas, convertir el resto en asignaciones elegibles con PIM (MFA, justificación y aprobación), y las revisiones y alertas que lo mantienen así.Inventory who is an administrator today, move each task to the least-privileged role, keep two well-guarded emergency accounts, turn the rest into eligible assignments with PIM (MFA, justification and approval), and the reviews and alerts that keep it that way.

Qué vas a conseguir

Un tenant donde nadie es administrador global por costumbre. Cada técnico tiene el rol justo para su trabajo, lo activa cuando lo necesita durante un tiempo limitado y dejando rastro, y solo dos cuentas de emergencia tienen el rol de forma permanente. Si roban la contraseña de un técnico un martes cualquiera, el atacante no se lleva el tenant.

Antes de empezar

  • Licencias Microsoft Entra ID P2 (incluidas en Microsoft 365 E5 o en Entra ID Governance) para los usuarios que usarán PIM.
  • El rol Privileged Role Administrator para configurar PIM (y, al principio, un Global Administrator a mano).
  • El módulo Microsoft Graph PowerShell (guía de Graph del Nivel 3).
  • Una conversación previa con el equipo: va a cambiar cómo trabajan. Explicar el porqué ahorra muchas quejas.

1. Quién es administrador hoy

PowerShell · Microsoft Graph
Connect-MgGraph -Scopes "RoleManagement.Read.Directory","User.Read.All"Get-MgDirectoryRole | ForEach-Object { $r = $_; Get-MgDirectoryRoleMember -DirectoryRoleId $r.Id | ForEach-Object { [pscustomobject]@{ Rol = $r.DisplayName; Miembro = $_.AdditionalProperties.userPrincipalName } } } | Sort-Object Rol | Format-TableRol                          Miembro---                          -------Exchange Administrator       a.vidal@contoso.comGlobal Administrator         admin@contoso.onmicrosoft.comGlobal Administrator         j.serrano@contoso.comGlobal Administrator         m.ortega@contoso.comGlobal Administrator         p.ruiz@contoso.comGlobal Administrator         proveedor.soporte@contoso.comGlobal Administrator         s.navas@contoso.comUser Administrator           l.prado@contoso.com

Seis administradores globales, uno de ellos la cuenta de un proveedor y otro la cuenta con la que se creó el tenant. Es lo normal en un tenant de unos años, y es lo que vas a cambiar.

2. Cada tarea a su rol mínimo

Tarea habitualRol suficiente
Restablecer contraseñas de usuariosHelpdesk Administrator
Métodos de MFA de los usuariosAuthentication Administrator
Altas, bajas y gruposUser Administrator
LicenciasLicense Administrator
Buzones, reglas de transporteExchange Administrator
Teams, directivas de reunionesTeams Administrator
Dispositivos y directivas de IntuneIntune Administrator
Conditional AccessConditional Access Administrator
Leer todo sin cambiar nada (auditorías)Global Reader
Facturación y suscripcionesBilling Administrator

Con esta tabla, casi nadie necesita Global Administrator para su día a día. El proveedor tampoco: se le da un rol concreto mediante GDAP (relaciones de administración delegada con permisos granulares y caducidad) en lugar de una cuenta dentro del tenant.

3. Las dos cuentas de emergencia

  • Dos cuentas solo en la nube con el dominio onmicrosoft.com (brk-admin-01, brk-admin-02), sin licencia, sin buzón, sin dependencia de AD local ni de un proveedor de identidad federado.
  • Son las únicas con Global Administrator permanente (activo).
  • Excluidas de todas las políticas de Conditional Access (guía de Conditional Access del Nivel 3), salvo de una propia que exija su método de autenticación.
  • Microsoft exige MFA para entrar en los portales de administración, también a estas cuentas: cada una tiene una llave FIDO2 (passkey) guardada en una caja fuerte, distinta para cada cuenta, y la contraseña larga en un sobre en otra ubicación.
  • Cada inicio de sesión con ellas genera una alerta inmediata (guía de Microsoft Sentinel). Se prueban cada tres meses, con un cambio registrado, para saber que funcionan.

4. PIM: elegible en lugar de permanente

Entra admin center · PIM · Configuración del rol
Gobierno de identidadesPrivileged Identity ManagementRoles de Microsoft EntraConfiguraciónGlobal Administrator
Duración máxima de la activación2 horas
Al activar, requerirContexto de autenticación de Conditional Access (c1 · MFA resistente a phishing)
Requerir justificación al activarSí
Requerir información del ticket al activarSí
Requerir aprobación para activarSí · Aprobadores: sg-pim-aprobadores
Permitir asignación elegible permanenteNo · Caducar asignaciones elegibles tras: 6 meses
Notificacionesal activar, aviso a sg-pim-aprobadores y al equipo de seguridad
Actualizar

Se configuran así los roles más sensibles (Global Administrator, Privileged Role Administrator, Security Administrator, Conditional Access Administrator). Para roles de menos impacto (Helpdesk, License) basta con MFA y justificación, sin aprobación: si cada reseteo de contraseña espera a un aprobador, la gente buscará atajos.

Después, en Asignaciones › Agregar asignaciones › Elegible, cada técnico recibe sus roles como elegibles y se retiran las asignaciones activas que tenía.

El técnico activa el rol desde Mis roles cuando lo necesita, o con PowerShell:

PowerShell · activar un rol elegible
$me = (Get-MgUser -UserId "m.ortega@contoso.com").Id$rol = (Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Exchange Administrator'").Id$params = @{ Action = "selfActivate"; PrincipalId = $me; RoleDefinitionId = $rol; DirectoryScopeId = "/"; Justification = "CHG-1042 regla de transporte"; ScheduleInfo = @{ StartDateTime = (Get-Date); Expiration = @{ Type = "AfterDuration"; Duration = "PT2H" } } }New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest -BodyParameter $params | Format-List Status, ActionStatus : ProvisionedAction : selfActivate

Consejo: el contexto de autenticación de Conditional Access (en "Al activar, requerir") es más fuerte que el simple "MFA de Azure": exige que la activación se haga con una llave FIDO2 o Windows Hello, no con un SMS que se puede interceptar.

5. El ticket: "no me deja activar el rol"

Lo que ve el técnicoCausaQué haces
No aparece el rol en *Mis roles*La asignación elegible caducó (6 meses)Se renueva tras revisar que sigue haciéndole falta
"Pendiente de aprobación"El rol requiere aprobaciónEl aprobador lo ve en *Aprobar solicitudes*; si es urgente, el teléfono
Error de autenticación al activarNo cumple el contexto de autenticación (sin llave FIDO2 registrada)Registrar el método en *Mi información de seguridad*
Activado pero el portal dice que no tiene permisoEl token anterior no lleva el rolCerrar sesión y volver a entrar en el portal (o esperar unos minutos)

6. Revisiones y alertas

  • Revisiones de acceso trimestrales de los roles privilegiados (*PIM › Revisiones de acceso*): cada técnico confirma que sigue necesitando sus roles, o su responsable lo decide; si nadie responde, se retira el acceso.
  • Alertas de PIM que revisas cada semana: *Demasiados administradores globales*, *Se asignan roles fuera de Privileged Identity Management*, *Los administradores no usan sus roles privilegiados*.
  • Historial de auditoría de PIM: quién activó qué, cuándo, con qué justificación y qué ticket. Es lo que te pedirá un auditor de ISO 27001.

7. Lo que revisas cada mes

  • Número de Global Administrator activos: dos (las de emergencia). Si hay más, alguien se asignó el rol fuera de PIM.
  • Activaciones sin número de ticket válido o con justificaciones vacías ("necesario", "trabajo").
  • Las cuentas de emergencia: sin inicios de sesión salvo las pruebas, llaves en su sitio.
  • Las relaciones GDAP de los proveedores: roles concedidos y fecha de caducidad.

Siguientes pasos

  • PIM para grupos: grupos con acceso a recursos (por ejemplo, propietarios de una suscripción) que también se activan bajo demanda.
  • PIM para recursos de Azure: los roles de suscripción y grupo de recursos con el mismo modelo.
  • Unidades administrativas: un técnico de una sede administra solo los usuarios de su sede.
  • Estaciones de trabajo con acceso privilegiado (PAW) para las tareas de Global Administrator.

¿Falta algo o en tu entorno es distinto? Escríbeme y lo corrijo.

What you'll get

A tenant where nobody is a global administrator out of habit. Each technician has just the role their work needs, activates it when they need it for a limited time and leaving a trail, and only two emergency accounts hold the role permanently. If a technician's password is stolen on any given Tuesday, the attacker doesn't walk away with the tenant.

Before you start

  • Microsoft Entra ID P2 licences (included in Microsoft 365 E5 or Entra ID Governance) for the users who will use PIM.
  • The Privileged Role Administrator role to configure PIM (and, at the start, a Global Administrator at hand).
  • The Microsoft Graph PowerShell module (Level 3 Graph guide).
  • A conversation with the team first: the way they work is going to change. Explaining why saves a lot of complaints.

1. Who is an administrator today

PowerShell · Microsoft Graph
Connect-MgGraph -Scopes "RoleManagement.Read.Directory","User.Read.All"Get-MgDirectoryRole | ForEach-Object { $r = $_; Get-MgDirectoryRoleMember -DirectoryRoleId $r.Id | ForEach-Object { [pscustomobject]@{ Role = $r.DisplayName; Member = $_.AdditionalProperties.userPrincipalName } } } | Sort-Object Role | Format-TableRole                         Member----                         ------Exchange Administrator       a.vidal@contoso.comGlobal Administrator         admin@contoso.onmicrosoft.comGlobal Administrator         j.serrano@contoso.comGlobal Administrator         m.ortega@contoso.comGlobal Administrator         p.ruiz@contoso.comGlobal Administrator         supplier.support@contoso.comGlobal Administrator         s.navas@contoso.comUser Administrator           l.prado@contoso.com

Six global administrators, one of them a supplier's account and another the account the tenant was created with. That is normal in a tenant a few years old, and it is what you are going to change.

2. Every task to its least-privileged role

Common taskRole that is enough
Reset user passwordsHelpdesk Administrator
Users' MFA methodsAuthentication Administrator
Joiners, leavers and groupsUser Administrator
LicencesLicense Administrator
Mailboxes, transport rulesExchange Administrator
Teams, meeting policiesTeams Administrator
Intune devices and policiesIntune Administrator
Conditional AccessConditional Access Administrator
Read everything without changing anything (audits)Global Reader
Billing and subscriptionsBilling Administrator

With this table, almost nobody needs Global Administrator for their daily work. Neither does the supplier: they get a specific role through GDAP (granular delegated admin privileges, with expiry) instead of an account inside the tenant.

3. The two emergency accounts

  • Two cloud-only accounts on the onmicrosoft.com domain (brk-admin-01, brk-admin-02), with no licence, no mailbox and no dependency on on-premises AD or a federated identity provider.
  • They are the only ones with permanent (active) Global Administrator.
  • Excluded from every Conditional Access policy (Level 3 Conditional Access guide), except one of their own that requires their authentication method.
  • Microsoft requires MFA to sign in to the admin portals, for these accounts too: each one has a FIDO2 security key (passkey) kept in a safe, a different one per account, and the long password in a sealed envelope in another location.
  • Every sign-in with them raises an immediate alert (Microsoft Sentinel guide). They are tested every three months, with a logged change, so you know they work.

4. PIM: eligible instead of permanent

Entra admin center · PIM · Role settings
Identity governancePrivileged Identity ManagementMicrosoft Entra rolesSettingsGlobal Administrator
Activation maximum duration2 hours
On activation, requireConditional Access authentication context (c1 · phishing-resistant MFA)
Require justification on activationYes
Require ticket information on activationYes
Require approval to activateYes · Approvers: sg-pim-approvers
Allow permanent eligible assignmentNo · Expire eligible assignments after: 6 months
Notificationson activation, notify sg-pim-approvers and the security team
Update

The most sensitive roles are set up like this (Global Administrator, Privileged Role Administrator, Security Administrator, Conditional Access Administrator). For lower-impact roles (Helpdesk, License) MFA and justification are enough, without approval: if every password reset waits for an approver, people will look for shortcuts.

Then, in Assignments › Add assignments › Eligible, each technician gets their roles as eligible and their active assignments are removed.

The technician activates the role from My roles when needed, or with PowerShell:

PowerShell · activate an eligible role
$me = (Get-MgUser -UserId "m.ortega@contoso.com").Id$role = (Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Exchange Administrator'").Id$params = @{ Action = "selfActivate"; PrincipalId = $me; RoleDefinitionId = $role; DirectoryScopeId = "/"; Justification = "CHG-1042 transport rule"; ScheduleInfo = @{ StartDateTime = (Get-Date); Expiration = @{ Type = "AfterDuration"; Duration = "PT2H" } } }New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest -BodyParameter $params | Format-List Status, ActionStatus : ProvisionedAction : selfActivate

Tip: the Conditional Access authentication context (in "On activation, require") is stronger than plain "Azure MFA": it requires the activation to be done with a FIDO2 key or Windows Hello, not with a text message that can be intercepted.

5. The ticket: "it won't let me activate the role"

What the technician seesCauseWhat you do
The role isn't in *My roles*The eligible assignment expired (6 months)Renew it after checking they still need it
"Pending approval"The role requires approvalThe approver sees it in *Approve requests*; if urgent, the phone
Authentication error on activationThe authentication context isn't met (no FIDO2 key registered)Register the method in *My security info*
Activated but the portal says no permissionThe previous token doesn't carry the roleSign out of the portal and back in (or wait a few minutes)

6. Reviews and alerts

  • Quarterly access reviews of privileged roles (*PIM › Access reviews*): each technician confirms they still need their roles, or their manager decides; if nobody answers, access is removed.
  • PIM alerts you review every week: *There are too many global administrators*, *Roles are being assigned outside of Privileged Identity Management*, *Administrators aren't using their privileged roles*.
  • The PIM audit history: who activated what, when, with what justification and which ticket. It is what an ISO 27001 auditor will ask you for.

7. What you review each month

  • The number of active Global Administrators: two (the emergency ones). If there are more, someone was assigned the role outside PIM.
  • Activations without a valid ticket number or with empty justifications ("needed", "work").
  • The emergency accounts: no sign-ins except the tests, keys where they should be.
  • The suppliers' GDAP relationships: roles granted and expiry date.

Next steps

  • PIM for Groups: groups with access to resources (for example, owners of a subscription) that are also activated on demand.
  • PIM for Azure resources: subscription and resource group roles under the same model.
  • Administrative units: a site technician administers only that site's users.
  • Privileged access workstations (PAW) for Global Administrator tasks.

Is something missing, or different in your environment? Get in touch and I'll fix it.

Tech Career Lab · newsletter

¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.

Apúntate y llévate las 33 ideasSign up and get the 33 ideas →