Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[BUG] Get-PnPUser -WithRightsAssignedDetailed - The property or field 'Email' has not been initialized

Abierto
#5,477 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp, powershell
Área
cli

Línea de trabajo

Reproduce the issue with Get-PnPUser -WithRightsAssignedDetailed using the connection and module versions described. Start by reading src/Commands/Base/PnPConnectedCmdlet.cs and PnPSharePointCmdlet.cs from the reported stack trace, then trace the Get-PnPUser path. Done means the command returns valid users without failing when an entry lacks an initialized Email property.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Issue
Expected behavior

List of all users with rights assigned

Actual behavior

Error message:
Get-PnPUser: The property or field 'Email' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.

Steps to reproduce behavior

$global:con = Connect-PnPOnline -Url $BaseUrl -CertificateBase64Encoded $global:base64 -CertificatePassword $global:certpass -ClientId $global:clientId -Tenant $aadDomain -TenantAdminUrl $spTenantAdminUrl -ReturnConnection -ErrorAction Stop
$users = Get-PnPUser -WithRightsAssignedDetailed -Connection $con

Get-PnPException:
Message : The property or field 'Email' has not been initialized. It has not been requested or the request has not been executed. It may need to be
explicitly requested.
Stacktrace : at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in D:\a\powershell\powershell\src\Commands\Base\PnPConnectedCmdlet.cs:line
104
at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in D:\a\powershell\powershell\src\Commands\Base\PnPSharePointCmdlet.cs:line 165
at System.Management.Automation.CommandProcessor.ProcessRecord()
ScriptLineNumber : 1

This is likely due to data from outdated objects, as the error does not occur on all pages. However, in this case, the module should continue to operate stably and simply ignore the faulty entries instead of failing to provide any data.

What is the version of the Cmdlet module you are running?

PnP.Powershell 3.4.1 and 2.12.0

Which operating system/environment are you running PnP PowerShell on?
  • [ X] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
Lenguaje dominante
C#
Estrellas
905
Forks
409
Merge medio
2 d 9 h
PR fusionados (30 d)
10

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pnp/powershell

Todos los issues de pnp/powershell

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.