Add specific attributes to be exported
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user