2
0

Add specific attributes to be exported

This commit is contained in:
2026-02-26 22:11:24 +01:00
parent e89b692f6b
commit 0258197984

View File

@@ -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."