From 0258197984013c101033b859c08c2197760aff98 Mon Sep 17 00:00:00 2001 From: Danny de Kooker Date: Thu, 26 Feb 2026 22:11:24 +0100 Subject: [PATCH] Add specific attributes to be exported --- Azure/User-Management/Export-EntraActiveUsers.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Azure/User-Management/Export-EntraActiveUsers.ps1 b/Azure/User-Management/Export-EntraActiveUsers.ps1 index 3b176e0..908abdb 100644 --- a/Azure/User-Management/Export-EntraActiveUsers.ps1 +++ b/Azure/User-Management/Export-EntraActiveUsers.ps1 @@ -52,7 +52,9 @@ function Export-EntraActiveUsers { $UserFilter = "accountEnabled eq true" # Using -All to ensure we bypass the default page size limits - $Users = Get-MgUser -Filter $UserFilter -Property "*" -All -ErrorAction Stop + $Users = Get-MgUser -All -Filter $UserFilter ` + -Property Id, UserPrincipalName, GivenName, Surname, DisplayName, Mail, MobilePhone, CompanyName, JobTitle, EmployeeId, FaxNumber, OfficeLocation -ErrorAction Stop | ` + Select-Object Id, UserPrincipalName, GivenName, Surname, DisplayName, Mail, MobilePhone, CompanyName, JobTitle, EmployeeId, FaxNumber, OfficeLocation if ($null -eq $Users -or $Users.Count -eq 0) { Write-Warning "No active users found in the tenant."