GuíasGuides · Nivel 2Level 2

GPO: unidades de red e impresoras con preferencias, filtrado por grupo, gpresult y una unidad que no apareceGPO: network drives and printers with preferences, group filtering, gpresult and a drive that does not appear

Unidades de red e impresoras con preferencias de directiva de grupo, destino de nivel de elemento y filtrado de seguridad por grupo, filtros WMI, procesamiento de bucle invertido en dos líneas, gpupdate, gpresult /h y RSoP, y el ticket de la unidad que no aparece a un departamento.Network drives and printers with Group Policy Preferences, item-level targeting and security filtering by group, WMI filters, loopback processing in two lines, gpupdate, gpresult /h and RSoP, and the ticket about the drive one department cannot see.

Qué vas a conseguir

Que cada departamento vea sus unidades de red y sus impresoras al iniciar sesión sin scripts de inicio de sesión: una GPO de preferencias, el destino por grupo, la comprobación en el equipo con gpresult y un método para el ticket que más se repite, "a los de Finanzas no les aparece la unidad F:".

Antes de empezar

  • La consola Administración de directivas de grupo (GPMC), con RSAT en tu equipo de administración, y permisos delegados para crear y vincular GPO en las OU de usuarios.
  • La estructura de ejemplo: usuarios en OU=Usuarios,OU=Madrid,DC=contoso,DC=local, grupos globales GG-Finanzas y GG-Comercial, el servidor de ficheros srv-ficheros y el de impresión srv-impresion.
  • Los permisos de las carpetas compartidas ya dados al grupo: la GPO conecta la unidad, no da acceso.
  • Una OU o un grupo de prueba con un par de usuarios de verdad.

1. Directivas y preferencias

En una GPO hay dos mundos:

  • Directivas (Policies): Windows las impone, el usuario no puede cambiarlas y casi todas se retiran al quitar la GPO.
  • Preferencias (Preferences): Windows las configura y el usuario podría cambiarlas después. Unidades de red, impresoras, accesos directos, claves de registro y carpetas viven aquí.

Una GPO por función y con nombre claro, vinculada a la OU de los usuarios:

PowerShell · RSAT, módulo GroupPolicy
New-GPO -Name "USR-Unidades-Red" -Comment "Unidades por departamento con destino por grupo" | New-GPLink -Target "OU=Usuarios,OU=Madrid,DC=contoso,DC=local"New-GPO -Name "USR-Impresoras" | New-GPLink -Target "OU=Usuarios,OU=Madrid,DC=contoso,DC=local"

2. Unidades de red con preferencias

En la GPO USR-Unidades-Red, Configuración de usuario › Preferencias › Configuración de Windows › Asignaciones de unidad › Nuevo › Unidad asignada:

Nuevas propiedades de unidad · General
AcciónActualizar
Ubicación\\srv-ficheros\Finanzas$
Volver a conectar
Etiquetar comoFinanzas
Letra de unidadUsar: F
  • Actualizar crea la unidad si no existe y corrige lo que haya cambiado. Es la acción buena por defecto.
  • Reemplazar la borra y la vuelve a crear en cada aplicación, Crear solo la crea si no existe y Eliminar la quita (útil para retirar una letra vieja).
  • Dos preferencias de dos GPO con la misma letra: gana la GPO de mayor prioridad.

3. Destino de nivel de elemento

Una sola GPO con todas las unidades y, en cada una, a quién se aplica. Pestaña Común de la unidad:

Propiedades de F: · Común
Ejecutar en el contexto de seguridad del usuario que inició la sesión
Quitar este elemento cuando ya no se aplique
Destino de nivel de elemento
Destino...
Nuevo elementoGrupo de seguridad
GrupoCONTOSO\GG-Finanzas
Usuario en el grupo
  • Quitar este elemento cuando ya no se aplique: si el usuario sale de GG-Finanzas, la unidad desaparece en el siguiente inicio de sesión. Sin esta casilla, se queda.
  • El destino admite más condiciones (sitio de AD, intervalo de IP, nombre del equipo, unidad organizativa) combinadas con Y/O. Un grupo es lo más fácil de mantener.
  • La consulta se hace en el equipo del usuario: muchas condiciones complejas en muchos elementos alargan el inicio de sesión.

4. Filtrado de seguridad y filtros WMI

La otra forma es una GPO por departamento con filtrado de seguridad: en la pestaña Ámbito de la GPO, quitar Usuarios autentificados y añadir GG-Finanzas.

Desde la actualización de seguridad MS16-072, el equipo lee las GPO de usuario con su propia cuenta. Si quitas Usuarios autentificados del filtrado, en la pestaña Delegación tienen que quedar Usuarios autentificados o Equipos del dominio con permiso de Lectura (sin Aplicar directiva de grupo). Si no, la GPO no se aplica a nadie y gpresult no lo deja claro.

Un filtro WMI limita la GPO según una consulta que se evalúa en el equipo, por ejemplo solo puestos de trabajo y no servidores:

GPMC · Filtros WMI › Nuevo
NombreSolo puestos de trabajo
Espacio de nombresroot\CIMv2
ConsultaSELECT * FROM Win32_OperatingSystem WHERE ProductType = "1"
Guardar

Un filtro WMI se aplica a toda la GPO, se evalúa en cada actualización y una consulta mal escrita deja la GPO sin aplicar. Úsalos poco y con nombres que digan lo que filtran.

5. Impresoras

En la GPO USR-Impresoras, Configuración de usuario › Preferencias › Configuración del Panel de control › Impresoras › Nuevo › Impresora compartida:

Nuevas propiedades de impresora compartida · General
AcciónActualizar
Ruta de acceso compartida\\srv-impresion\MAD-P2-COLOR
Establecer esta impresora como predeterminada
Solo si no hay una impresora local

Con destino de nivel de elemento por grupo o por intervalo de IP de la planta, igual que las unidades.

  • Desde las actualizaciones de 2021 (PrintNightmare), instalar el controlador de una impresora compartida pide permisos de administrador por defecto. La preferencia falla en silencio si el controlador no está en el equipo. Lo práctico: controladores preinstalados en la imagen o por la herramienta de despliegue, o controladores de paquete con la directiva Point and Print de paquete: servidores aprobados apuntando a srv-impresion.
  • La instalación y la cola del servidor están en la guía de impresoras de red.

6. Bucle invertido, en dos líneas

En servidores de escritorio remoto, Citrix o equipos de kiosco, quieres que la configuración de usuario dependa del equipo y no de la OU del usuario. Configuración del equipo › Directivas › Plantillas administrativas › Sistema › Directiva de grupo › Configurar el modo de procesamiento de bucle invertido de la directiva de grupo de usuario: Combinar añade las GPO de usuario de la OU del equipo a las del usuario; Reemplazar usa solo las de la OU del equipo. Va en una GPO vinculada a la OU de esos servidores, nunca a la de los portátiles.

7. Comprobar en el equipo: gpupdate, gpresult y RSoP

PowerShell · sesión del usuario en PC-0533
gpupdate /forceActualizando directiva...La actualización de la directiva de equipo se completó correctamente.La actualización de la directiva de usuario se completó correctamente.gpresult /r /scope usergpresult /h C:\Temp\gp-PC-0533.html /f
  • gpresult /r lista las GPO aplicadas y las filtradas, con el motivo. El informe HTML de /h muestra cada preferencia y qué GPO la ganó.
  • Las unidades de red se procesan solo en primer plano, al iniciar sesión. Con la optimización de inicio rápido, un cambio puede necesitar dos inicios de sesión. La directiva Esperar siempre a la red durante el inicio del equipo y el inicio de sesión (Configuración del equipo › Plantillas administrativas › Sistema › Inicio de sesión) lo evita.
  • RSoP: rsop.msc todavía existe, pero no muestra las preferencias. Usa gpresult o el Asistente de resultados de directivas de grupo de GPMC, que lo saca desde tu equipo sin entrar en el del usuario. Desde PowerShell, Get-GPResultantSetOfPolicy -User CONTOSO\amorales -Computer PC-0533 -ReportType Html -Path C:\Temp\rsop.html.
  • Los errores de las preferencias quedan en el registro Aplicación con origen Group Policy Drive Maps o Group Policy Printers (evento 4098), y el procesamiento completo en Microsoft › Windows › GroupPolicy › Operational.

8. El ticket: "a los de Finanzas no les aparece la unidad F:"

Martes, 9:10. Tres personas de Finanzas sin unidad F:. Comercial ve su unidad sin problemas. En orden:

  1. ¿Se aplica la GPO? En el equipo de una de ellas:
PowerShell · sesión de amorales en PC-0533
gpresult /r /scope userCONFIGURACIÓN DE USUARIO    Objetos de directiva de grupo aplicados        USR-Impresoras        Default Domain Policy    Los siguientes GPO no se aplicaron porque fueron filtrados        USR-Unidades-Red            Filtrado:  Denegado (Filtro WMI)

El motivo dice dónde mirar: Denegado (Seguridad) es el filtrado de seguridad o la delegación; Denegado (Filtro WMI), el filtro; Deshabilitado (Vínculo), el vínculo; No aplicado (vacío), la parte de usuario de la GPO no tiene nada.

  1. Filtro WMI: alguien vinculó a la GPO un filtro Solo portátiles y Finanzas ha recibido sobremesas. Pruébalo en el equipo: Get-CimInstance -Query 'SELECT * FROM Win32_SystemEnclosure WHERE ChassisTypes = 9 OR ChassisTypes = 10' sin resultado es "el filtro dice que no". Se quita el filtro o se corrige.
  2. Filtrado y grupo: si fuera Denegado (Seguridad), comprueba que el usuario está en el grupo en su sesión: whoami /groups | findstr GG-Finanzas. Si lo añadieron esta mañana, necesita cerrar sesión y volver a entrar. Si está, revisa la Delegación (punto 4).
  3. Orden de vínculos y prioridad: si la GPO se aplica pero F: apunta a otro sitio, otra GPO de más prioridad usa la misma letra. Get-GPInheritance -Target "OU=Usuarios,OU=Madrid,DC=contoso,DC=local" lista las GPO en orden de prioridad, incluidas las exigidas que vienen de arriba. El informe de gpresult /h dice qué GPO ganó la letra F:.
  4. Replicación de SYSVOL: si el cambio se hizo esta mañana y solo falla en una sede, el controlador de dominio de esa sede puede no tener la versión nueva. echo %LOGONSERVER% dice qué controlador usa el usuario. En GPMC, el dominio › pestaña Estado › Detectar ahora compara AD y SYSVOL en todos los controladores; (Get-GPO -Name "USR-Unidades-Red" -Server DC02).User muestra DSVersion y SysvolVersion, que deben coincidir. Si no, repadmin /replsummary y el registro Replicación DFS de ese controlador.

En este caso, el filtro WMI. Se quita, gpupdate /force, cierre e inicio de sesión, y F: aparece. En el ticket: equipo, salida de gpresult, causa, cambio en la GPO y quién lo aprobó.

Siguientes pasos

  • GPO de seguridad en el Nivel 3 usa las mismas herramientas (piloto, gpresult, marcha atrás) para las directivas que protegen el dominio.
  • La guía de Active Directory: delegación y auditoría explica cómo dar a soporte permiso para editar estas GPO sin hacerle administrador del dominio.
  • Antes de cambiar una GPO en uso, Backup-GPO -Name "USR-Unidades-Red" -Path \\srv-gestion\GPO-Backups.

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

What you'll get

Every department sees its network drives and printers at sign-in with no logon scripts: one preferences GPO, targeting by group, checking on the device with gpresult, and a method for the ticket that comes back again and again, "Finance can't see the F: drive".

Before you start

  • The Group Policy Management console (GPMC), with RSAT on your admin machine, and delegated permissions to create and link GPOs on the user OUs.
  • The example layout: users in OU=Users,OU=Madrid,DC=contoso,DC=local, global groups GG-Finance and GG-Sales, the file server srv-files and the print server srv-print.
  • Share permissions already granted to the group: the GPO maps the drive, it does not grant access.
  • A test OU or group with a couple of real users.

1. Policies and preferences

A GPO has two worlds:

  • Policies: Windows enforces them, the user cannot change them, and almost all are removed when the GPO goes.
  • Preferences: Windows configures them and the user could change them afterwards. Network drives, printers, shortcuts, registry keys and folders live here.

One GPO per function with a clear name, linked to the users' OU:

PowerShell · RSAT, GroupPolicy module
New-GPO -Name "USR-Network-Drives" -Comment "Drives per department targeted by group" | New-GPLink -Target "OU=Users,OU=Madrid,DC=contoso,DC=local"New-GPO -Name "USR-Printers" | New-GPLink -Target "OU=Users,OU=Madrid,DC=contoso,DC=local"

2. Network drives with preferences

In the USR-Network-Drives GPO, User Configuration › Preferences › Windows Settings › Drive Maps › New › Mapped Drive:

New Drive Properties · General
ActionUpdate
Location\\srv-files\Finance$
Reconnect
Label asFinance
Drive LetterUse: F
  • Update creates the drive if it is missing and fixes whatever has changed. It is the right default action.
  • Replace deletes and recreates it on every refresh, Create only creates it if it does not exist, and Delete removes it (useful to retire an old letter).
  • Two preferences from two GPOs with the same letter: the GPO with higher precedence wins.

3. Item-level targeting

A single GPO with all the drives and, on each one, who it applies to. The drive's Common tab:

F: Properties · Common
Run in logged-on user's security context
Remove this item when it is no longer applied
Item-level targeting
Targeting...
New ItemSecurity Group
GroupCONTOSO\GG-Finance
User in group
  • Remove this item when it is no longer applied: if the user leaves GG-Finance, the drive disappears at the next sign-in. Without this box, it stays.
  • Targeting supports more conditions (AD site, IP address range, computer name, organizational unit) combined with AND/OR. A group is the easiest to maintain.
  • The check runs on the user's device: lots of complex conditions on lots of items make sign-in slower.

4. Security filtering and WMI filters

The other way is one GPO per department with security filtering: on the GPO's Scope tab, remove Authenticated Users and add GG-Finance.

Since security update MS16-072, the computer reads user GPOs with its own account. If you remove Authenticated Users from filtering, the Delegation tab must still have Authenticated Users or Domain Computers with Read permission (without Apply group policy). Otherwise the GPO applies to nobody and gpresult does not make it obvious.

A WMI filter limits the GPO according to a query evaluated on the device, for example workstations only and no servers:

GPMC · WMI Filters › New
NameWorkstations only
Namespaceroot\CIMv2
QuerySELECT * FROM Win32_OperatingSystem WHERE ProductType = "1"
Save

A WMI filter applies to the whole GPO, is evaluated on every refresh, and a badly written query leaves the GPO unapplied. Use them sparingly and with names that say what they filter.

5. Printers

In the USR-Printers GPO, User Configuration › Preferences › Control Panel Settings › Printers › New › Shared Printer:

New Shared Printer Properties · General
ActionUpdate
Share path\\srv-print\MAD-F2-COLOUR
Set this printer as the default printer
Only if a local printer is not present

With item-level targeting by group or by the floor's IP range, the same as drives.

  • Since the 2021 updates (PrintNightmare), installing a shared printer's driver needs administrator rights by default. The preference fails silently if the driver is not on the device. In practice: drivers preinstalled in the image or by your deployment tool, or package drivers with the Package Point and print - Approved servers policy pointing to srv-print.
  • The server side and the queue are in the network printers guide.

6. Loopback, in two lines

On remote desktop servers, Citrix or kiosk devices, you want the user settings to depend on the computer and not on the user's OU. Computer Configuration › Policies › Administrative Templates › System › Group Policy › Configure user Group Policy loopback processing mode: Merge adds the user GPOs from the computer's OU to the user's own; Replace uses only those from the computer's OU. It goes in a GPO linked to those servers' OU, never to the laptops'.

7. Checking on the device: gpupdate, gpresult and RSoP

PowerShell · user's session on PC-0533
gpupdate /forceUpdating policy...Computer Policy update has completed successfully.User Policy update has completed successfully.gpresult /r /scope usergpresult /h C:\Temp\gp-PC-0533.html /f
  • gpresult /r lists the applied GPOs and the filtered ones, with the reason. The /h HTML report shows every preference and which GPO won it.
  • Network drives are processed in the foreground only, at sign-in. With fast logon optimisation, a change can take two sign-ins. The policy Always wait for the network at computer startup and logon (Computer Configuration › Administrative Templates › System › Logon) avoids it.
  • RSoP: rsop.msc still exists, but it does not show preferences. Use gpresult or the GPMC Group Policy Results Wizard, which gets it from your machine without touching the user's. From PowerShell, Get-GPResultantSetOfPolicy -User CONTOSO\amorales -Computer PC-0533 -ReportType Html -Path C:\Temp\rsop.html.
  • Preference errors land in the Application log with source Group Policy Drive Maps or Group Policy Printers (event 4098), and the full processing in Microsoft › Windows › GroupPolicy › Operational.

8. The ticket: "Finance can't see the F: drive"

Tuesday, 9:10. Three people in Finance with no F: drive. Sales sees its drive fine. In order:

  1. Is the GPO applied? On one of their devices:
PowerShell · amorales's session on PC-0533
gpresult /r /scope userUSER SETTINGS    Applied Group Policy Objects        USR-Printers        Default Domain Policy    The following GPOs were not applied because they were filtered out        USR-Network-Drives            Filtering:  Denied (WMI Filter)

The reason tells you where to look: Denied (Security) is security filtering or delegation; Denied (WMI Filter), the filter; Disabled (Link), the link; Not Applied (Empty), the GPO's user side has nothing in it.

  1. WMI filter: someone attached a Laptops only filter to the GPO and Finance has received desktops. Test it on the device: Get-CimInstance -Query 'SELECT * FROM Win32_SystemEnclosure WHERE ChassisTypes = 9 OR ChassisTypes = 10' returning nothing is "the filter says no". Remove the filter or fix it.
  2. Filtering and group: if it were Denied (Security), check that the user is in the group in their session: whoami /groups | findstr GG-Finance. If they were added this morning, they need to sign out and back in. If they are, check the Delegation (step 4).
  3. Link order and precedence: if the GPO applies but F: points somewhere else, another GPO with higher precedence uses the same letter. Get-GPInheritance -Target "OU=Users,OU=Madrid,DC=contoso,DC=local" lists the GPOs in precedence order, including enforced ones coming from above. The gpresult /h report says which GPO won the F: letter.
  4. SYSVOL replication: if the change was made this morning and it only fails at one site, that site's domain controller may not have the new version. echo %LOGONSERVER% tells you which DC the user is using. In GPMC, the domain › Status tab › Detect Now compares AD and SYSVOL on every DC; (Get-GPO -Name "USR-Network-Drives" -Server DC02).User shows DSVersion and SysvolVersion, which must match. If not, repadmin /replsummary and that DC's DFS Replication log.

In this case, the WMI filter. It is removed, gpupdate /force, sign out and in, and F: appears. In the ticket: device, gpresult output, cause, GPO change and who approved it.

Next steps

  • Security GPOs at Level 3 uses the same tools (pilot, gpresult, rollback) for the policies that protect the domain.
  • The Active Directory: delegation and auditing guide explains how to let support edit these GPOs without making them domain admins.
  • Before changing a live GPO, Backup-GPO -Name "USR-Network-Drives" -Path \\srv-mgmt\GPO-Backups.

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 →