Compare commits
No commits in common. "74a83e7444b994f159cf7214263d1b8114c954bb" and "6c306c19f75c02283b63e5ac947bb86d3be9ce7f" have entirely different histories.
74a83e7444
...
6c306c19f7
@ -18,5 +18,5 @@ foreach ($mailbox in $mailboxes) {
|
||||
$processCount++
|
||||
$percentComplete = (($processCount / $totalMailboxes) * 100)
|
||||
Write-Progress -Activity "Applying calendar permissions" -Status "Processing $calendarPath" -PercentComplete $percentComplete
|
||||
Set-MailboxFolderPermission -Identity $calendarPath -User $upn -AccessRights $calendarPermission -SharingPermissionFlags None
|
||||
Add-MailboxFolderPermission -Identity $calendarPath -User $upn -AccessRights $calendarPermission -SharingPermissionFlags Delegate
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
# Import the Microsoft Graph module
|
||||
Import-Module Microsoft.Graph
|
||||
|
||||
# Connect to Microsoft Graph
|
||||
Connect-MgGraph -Scopes "User.Read.All", "UserAuthenticationMethod.Read.All"
|
||||
|
||||
# Get all users
|
||||
$users = Get-MgUser -All -Property Id, UserPrincipalName, DisplayName, AccountEnabled
|
||||
|
||||
$totalUsers = $users.Count
|
||||
$processCount = 0
|
||||
|
||||
# Initialize an array to store user information
|
||||
$userInfo = @()
|
||||
|
||||
Write-Progress -Activity "Getting User Details" -Status "Starting" -PercentComplete 0
|
||||
|
||||
foreach ($user in $users) {
|
||||
$processCount++
|
||||
$percentComplete = (($processCount / $totalUsers) * 100)
|
||||
Write-Progress -Activity "Getting User Details" -Status "Processing $processCount/$totalUsers - $($user.UserPrincipalName)" -PercentComplete $percentComplete
|
||||
|
||||
# Get MFA methods for the user
|
||||
$mfaMethods = Get-MgUserAuthenticationMethod -UserId $user.Id
|
||||
|
||||
# Check if any MFA method is registered
|
||||
$mfaRegistered = $mfaMethods.Count -gt 0
|
||||
|
||||
# Get user licenses
|
||||
$licenses = Get-MgUserLicenseDetail -UserId $user.Id
|
||||
|
||||
# Create a custom object for each user
|
||||
$userObject = [PSCustomObject]@{
|
||||
UserPrincipalName = $user.UserPrincipalName
|
||||
DisplayName = $user.DisplayName
|
||||
AccountEnabled = $user.AccountEnabled
|
||||
MFARegistered = $mfaRegistered
|
||||
MFAMethods = ($mfaMethods.AdditionalProperties.'@odata.type' -join ', ').Replace('#microsoft.graph.', '')
|
||||
Licenses = ($licenses.SkuPartNumber -join ', ')
|
||||
}
|
||||
|
||||
# Add the user object to the array
|
||||
$userInfo += $userObject
|
||||
}
|
||||
|
||||
# Export the results to a CSV file
|
||||
$userInfo | Export-Csv -Path "EntraIDUsersMFAReport.csv" -NoTypeInformation
|
||||
|
||||
# Disconnect from Microsoft Graph
|
||||
Disconnect-MgGraph
|
||||
|
||||
Write-Host "Report generated: EntraIDUsersMFAReport.csv"
|
||||
Loading…
Reference in New Issue
Block a user