Repository navigation
Expand file tree
/
Copy pathInvoke-EntraAuthReport.ps1
More file actions
1601 lines (1420 loc) · 62.4 KB
/
Copy pathInvoke-EntraAuthReport.ps1
File metadata and controls
1601 lines (1420 loc) · 62.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<#PSScriptInfo
.VERSION 0.5.0
.GUID bbda77a3-7d1c-415e-9c28-7c934971599c
.AUTHOR Daniel Bradley
.COMPANYNAME ourcloudnetwork.co.uk
.COPYRIGHT
.TAGS
ourcloudnetwork
Microsoft Entra
Microsoft Graph
.LICENSEURI
.PROJECTURI
.ICONURI
.EXTERNALMODULEDEPENDENCIES
Microsoft.Graph.Authentication
.RELEASENOTES
v0.1 - Initial release
v0.2 - Fix output path issues
v0.3 - Added export functionality, examples and increased registration details report size to 20,000.
v0.4 - Added limit, skipGuest, skipDetailedPhoneInfo and openBrowser parameters.
v0.5 - Improved overall performance and UX with high number of users.
#>
<#
.DESCRIPTION
This script, created by Daniel Bradley at ourcloudnetwork.co.uk, generates a report on the authentication methods registered by users in your Microsoft 365 tenant. The report includes information on the number of users, the percentage of users with strong authentication methods, the percentage of users who are passwordless capable, and more. The script uses the Microsoft Graph API to retrieve the necessary data and the report is built with HTML, CSS and JS.
.PARAMETER outpath
Specified the output path of the report file.
.PARAMETER limit
Defines how many userRegistrationDetails records to fetch.
.PARAMETER skipGuest
Skip all the users of type 'guest'.
.PARAMETER skipDetailedPhoneInfo
Skip the request for detailed Mobile authentication methods.
.PARAMETER openBrowser
If true, opens the generated report in the browser.
.EXAMPLE
PS> Invoke-EntraAuthReport -outpath "C:\Reports\EntraAuthReport.html"
#>
#Params
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$outpath,
[Parameter(Mandatory = $false)]
[int]$limit = 20000,
[Parameter(Mandatory = $false)]
[switch]$skipGuest = $false,
[Parameter(Mandatory = $false)]
[switch]$skipDetailedPhoneInfo = $false,
[Parameter(Mandatory = $false)]
[switch]$openBrowser = $false
)
# Check Microsoft Graph connection
$state = Get-MgContext
# Define required permissions properly as an array of strings
$requiredPerms = @("Policy.Read.All", "Organization.Read.All", "AuditLog.Read.All", "UserAuthenticationMethod.Read.All", "RoleAssignmentSchedule.Read.Directory", "RoleEligibilitySchedule.Read.Directory")
# Check if we're connected and have all required permissions
$hasAllPerms = $false
if ($state) {
$missingPerms = @()
foreach ($perm in $requiredPerms) {
if ($state.Scopes -notcontains $perm) {
$missingPerms += $perm
}
}
if ($missingPerms.Count -eq 0) {
$hasAllPerms = $true
Write-output "Connected to Microsoft Graph with all required permissions"
}
else {
Write-output "Missing required permissions: $($missingPerms -join ', ')"
Write-output "Reconnecting with all required permissions..."
}
}
else {
Write-output "Not connected to Microsoft Graph. Connecting now..."
}
# Connect if we need to
if (-not $hasAllPerms) {
try {
Connect-MgGraph -Scopes $requiredPerms -ErrorAction Stop -NoWelcome
Write-output "Successfully connected to Microsoft Graph"
}
catch {
Write-Error "Failed to connect to Microsoft Graph: $_"
exit
}
}
#Check tenant level license plan
$items = @("AAD_PREMIUM_P2", "AAD_PREMIUM", "AAD_BASIC")
$Skus = Invoke-MgGraphRequest -Uri "Beta/subscribedSkus" -OutputType PSObject | Select -Expand Value
foreach ($item in $items) {
$Search = $skus | ? { $_.ServicePlans.servicePlanName -contains "$item" }
if ($Search) {
$licenseplan = $item
break
}
ElseIf ((!$Search) -and ($item -eq "AAD_BASIC")) {
$licenseplan = $item
break
}
}
#Get organisation name
$organisationName = (Invoke-MgGraphRequest -Uri "v1.0/organization" -OutputType PSObject | Select -Expand value).DisplayName
#Return an array of authentication methods including whether they are enabled or not and for which users
Function Get-AuthenticationMethods {
$policies = Invoke-MgGraphRequest -Uri "beta/policies/authenticationmethodspolicy" -OutputType PSObject | Select -Expand authenticationMethodConfigurations
$policiesReport = [System.Collections.Generic.List[Object]]::new()
forEach ($policy in $policies) {
$obj = [PSCustomObject][ordered]@{
"Type" = if ($policy.displayName) { "Custom" }else { "Built-in" }
"DisplayName" = if ($policy.displayName) { $policy.displayName }else { $policy.id }
"State" = $policy.state
"Aliases" = ($policy.includeTargets.id -join [environment]::NewLine)
}
$policiesReport.Add($obj)
}
return $policiesReport
}
Function Get-UserRegistrationDetails {
#Lists all users and their user mfa registration details including their default method
$userRegistrations = Invoke-MgGraphRequest -Uri "Beta/reports/authenticationMethods/userRegistrationDetails?`$top=$limit&`$orderby=userPrincipalName" -OutputType PSObject | Select -Expand Value
if ($skipGuest) {
$userRegistrations = $userRegistrations | Where-Object { $_.userType -ne "guest" }
}
$usersWithMobileMethods = $userRegistrations | Where-Object { $_.methodsRegistered -contains "mobilePhone" } | Select-Object id, userPrincipalName, methodsRegistered
Foreach ($user in $usersWithMobileMethods) {
$methodsFromReport = $user.methodsRegistered
$methodsToReplace = @()
$methodsToReplace += $methodsFromReport | Where-Object { $_ -ne "mobilePhone" }
$methodsToReplace += "Voice Call"
if (-not $skipDetailedPhoneInfo) {
$Methods = Invoke-MgGraphRequest -uri "/beta/users/$($user.id)/authentication/methods" -OutputType PSObject | WHere { $_."@odata.type" -eq '#microsoft.graph.phoneAuthenticationMethod'}
if ($Methods.smsSignInState -eq "ready") {
$methodsToReplace += "SMS"
}
}
$user.methodsRegistered = $methodsToReplace
}
return $userRegistrations
}
Function Get-PrivilegedUserRegistrationDetails {
[CmdletBinding()]
param (
[Parameter()]
$userRegistrations
)
If ($licenseplan -eq "AAD_PREMIUM_P2") {
#Get all members (eligible and assigned) of PIM roles
$EligiblePIMRoles = Invoke-MgGraphRequest -Uri "beta/roleManagement/directory/roleEligibilitySchedules?`$expand=*" -OutputType PSObject | Select -Expand Value
$AssignedPIMRoles = Invoke-MgGraphRequest -Uri "beta/roleManagement/directory/roleAssignmentSchedules?`$expand=*" -OutputType PSObject | Select -Expand Value
$DirectoryRoles = $EligiblePIMRoles + $AssignedPIMRoles
$DirectoryRoleUsers = $DirectoryRoles | Where { $_.Principal.'@odata.type' -eq "#microsoft.graph.user" }
$RoleMembers = $DirectoryRoleUsers.Principal.userPrincipalName | Select-Object -Unique
}
else {
#Get all members or directory roles
$DirectoryRoles = Invoke-MgGraphRequest -Uri "/beta/directoryRoles?" -OutputType PSObject | Select -Expand Value
$RoleMembers = $DirectoryRoles | ForEach-Object { Invoke-MgGraphRequest -uri "/beta/directoryRoles/$($_.id)/members" -OutputType PSObject | Select -Expand Value } | where { $_.'@odata.type' -eq "#microsoft.graph.user" } | Select-Object -expand userPrincipalName -Unique
}
$PrivilegedUserRegistrationDetails = $userRegistrationsReport | where { $RoleMembers -contains $_.userPrincipalName }
Return $PrivilegedUserRegistrationDetails
}
###Method types array
$AllMethods = @(
[pscustomobject]@{type='microsoftAuthenticatorPasswordless';Name='Microsoft Authenticator Passwordless';Strength='Strong'}
[pscustomobject]@{type='fido2SecurityKey';AltName='Fido2';Name='Fido2 Security Key';Strength='Strong'}
[pscustomobject]@{type='passKeyDeviceBound';AltName='Fido2';Name='Device Bound Passkey';Strength='Strong'}
[pscustomobject]@{type='passKeyDeviceBoundAuthenticator';AltName='Fido2';Name='Microsoft Authenticator Passkey';Strength='Strong'}
[pscustomobject]@{type='passKeyDeviceBoundWindowsHello';AltName='Fido2';Name='Windows Hello Passkey';Strength='Strong'}
[pscustomobject]@{type='microsoftAuthenticatorPush';AltName='MicrosoftAuthenticator';Name='Microsoft Authenticator App';Strength='Strong'}
[pscustomobject]@{type='softwareOneTimePasscode';AltName='SoftwareOath';Name='Software OTP';Strength='Strong'}
[pscustomobject]@{type='hardwareOneTimePasscode';AltName='HardwareOath';Name='Hardware OTP';Strength='Strong'}
[pscustomobject]@{type='windowsHelloForBusiness';AltName='windowsHelloForBusiness';Name='Windows Hello for Business';Strength='Strong'}
[pscustomobject]@{type='temporaryAccessPass';AltName='TemporaryAccessPass';Name='Temporary Access Pass';Strength='Strong'}
[pscustomobject]@{type='macOsSecureEnclaveKey';Name='MacOS Secure Enclave Key';Strength='Strong'}
[pscustomobject]@{type='SMS';AltName='SMS';Name='SMS';Strength='Weak'}
[pscustomobject]@{type='Voice Call';AltName='voice';Name='Voice Call';Strength='Weak'}
[pscustomobject]@{type='email';AltName='Email';Name='Email';Strength='Weak'}
[pscustomobject]@{type='alternateMobilePhone';AltName='Voice';Name='Alternative Mobile Phone';Strength='Weak'}
[pscustomobject]@{type='securityQuestion';AltName='Security Questions';Name='Security Questions';Strength='Weak'}
)
$strongMethodTypes = $AllMethods | Where-Object { $_.Strength -eq 'Strong' } | Select-Object -ExpandProperty type
$weakMethodTypes = $AllMethods | Where-Object { $_.Strength -eq 'Weak' }
###Get authentication methods info
#Get user registration details
Write-output "Fetching users registration details..."
$userRegistrationsReport = Get-UserRegistrationDetails
#Get authentication methods
Write-output "Fetching authentication methods..."
$authenticationMethods = Get-AuthenticationMethods
#Get disabled and enabled authentication methods
$disabledAuthenticationMethods = $authenticationMethods | where { $_.State -eq "Disabled" }
$enabledAuthenticationMethods = $authenticationMethods | where { $_.State -eq "Enabled" }
#Get methods enabled and disabled by policy
$MethodsDisabledByPolicy = $AllMethods | Where { $_.AltName -in $disabledAuthenticationMethods.DisplayName }
$MethodsEnabledByPolicy = $AllMethods | Where { $_.AltName -in $enabledAuthenticationMethods.DisplayName }
#get weak authentication methods and count
$enabledWeakAuthenticationMethods = $MethodsEnabledByPolicy | where { $_.Strength -eq "Weak" }
###Calculate totals
#Total number of users
$totalUsersCount = $userRegistrationsReport.Count
### Calculate MFA capable info
Write-output "Analyzing MFA info..."
$totalMFACapableUsers = $userRegistrationsReport | where { $_.isMfaCapable -eq $true }
$totalMFACapableUsersCount = $totalMFACapableUsers.Count
#Calculate percentage of MFA capable users
$MfaCapablePercentage = 0
if ($totalUsersCount -gt 0) {
$MfaCapablePercentage = [math]::Round(($totalMFACapableUsersCount / $totalUsersCount) * 100, 2)
}
###Calculate passwordless info
Write-output "Analyzing passwordless info..."
$totalPasswordlessUsers = $userRegistrationsReport | where { $_.isPasswordlessCapable -eq $true }
$totalPasswordlessUsersCount = $totalPasswordlessUsers.Count
#Calculate percentage of passwordless capable users
$passwordlessCapablePercentage = 0
if ($totalUsersCount -gt 0) {
$passwordlessCapablePercentage = [math]::Round(($totalPasswordlessUsersCount / $totalUsersCount) * 100, 2)
}
###Calculate strong authentication method info
# Filter users who have registered strong authentication methods
Write-output "Analyzing users who have registered strong authentication methods..."
$usersWithStrongMethods = $userRegistrationsReport | Where-Object {
$user = $_
# Check if any of the user's registered methods are in the strongMethodTypes list
if ($user.methodsRegistered) {
foreach ($method in $user.methodsRegistered) {
if ($strongMethodTypes -contains $method) {
return $true
}
}
}
return $false
}
#Calculate counts and percentages
$totalStrongAuthUsersCount = $usersWithStrongMethods.Count
$strongAuthPercentage = 0
if ($totalUsersCount -gt 0) {
$strongAuthPercentage = [math]::Round(($totalStrongAuthUsersCount / $totalUsersCount) * 100, 2)
}
###Calculate weak authentication method info
# Filter users who have ONLY weak authentication methods registered
Write-output "Analyzing users who have ONLY weak authentication methods registered..."
$usersWithWeakMethods = $userRegistrationsReport | Where-Object {
$user = $_
# Check if any of the user's registered methods are in the weakMethodTypes list
if ($user.methodsRegistered) {
foreach ($method in $user.methodsRegistered) {
if ($weakMethodTypes.type -contains $method) {
return $true
}
}
}
return $false
}
###Calculate users with both strong AND weak methods
Write-output "Analyzing users with both strong AND weak methods..."
$usersWithBothMethodTypes = $usersWithStrongMethods | Where-Object {
$user = $_
# Check if this user is also in the weak methods list by comparing UPN
$usersWithWeakMethods.userPrincipalName -contains $user.userPrincipalName
}
# Calculate counts and percentages
$totalBothMethodTypesCount = $usersWithBothMethodTypes.Count
$bothMethodsPercentage = 0
if ($totalUsersCount -gt 0) {
$bothMethodsPercentage = [math]::Round(($totalBothMethodTypesCount / $totalUsersCount) * 100, 2)
}
### Calculate privileged users not using phish resistant methods
Write-output "Analyzing privileged users not using phish resistant methods..."
$PrivilegedUsersRegistrationDetails = Get-PrivilegedUserRegistrationDetails -userRegistrations $userRegistrationsReport
$PrivilegedUsersNotUsingPhishResistantMethods = $PrivilegedUsersRegistrationDetails | where { $_.methodsRegistered -notcontains "fido2SecurityKey" -and $_.methodsRegistered -notcontains "passKeyDeviceBound" -and $_.methodsRegistered -notcontains "passKeyDeviceBoundAuthenticator" }
# Count of privileged users not using phish resistant methods
$PrivilegedUsersNotUsingPhishResistantMethodsCount = $PrivilegedUsersNotUsingPhishResistantMethods.Count
function Minify-HTML {
param([string]$html)
$codeBlocks = @()
$pattern = '(<pre.*?>.*?</pre>|<code.*?>.*?</code>)'
$html = [regex]::Replace($html, $pattern, {
param($match)
$codeBlocks += $match.Value
return "CODE_BLOCK_PLACEHOLDER_$($codeBlocks.Count - 1)"
}, [System.Text.RegularExpressions.RegexOptions]::Singleline)
$html = $html -replace '<!--(?!\[if)(.*?)-->', ''
$html = $html -replace '>\s+<', '><'
$html = $html -replace '\s{2,}', ' '
$html = $html -replace '\s+>', '>'
$html = $html -replace '>\s+', '>'
$html = $html -replace '\s+/>', '/>'
for ($i = 0; $i -lt $codeBlocks.Count; $i++) {
$html = $html -replace "CODE_BLOCK_PLACEHOLDER_$i", $codeBlocks[$i]
}
return $html.Trim()
}
## Generate HTML report
Write-output "Generating HTML report..."
Function Generate-EntraAuthReport {
param(
[Parameter(Mandatory = $true)]
[array]$UserRegistrations,
[Parameter(Mandatory = $true)]
[array]$MethodTypes,
[Parameter(Mandatory = $false)]
[string]$OutputPath = "C:\GitHub\Private\Reports\EntraAuthenticationReport.html"
)
# Define Auth methods headers
$authMethodsHeaders = $MethodTypes | ForEach-Object {
$cssClass = if ($_.Strength -eq "Strong") { "strong-method" } else { "weak-method" }
$dataAttributes = ""
# Check if this method is disabled by policy
$isDisabled = $MethodsDisabledByPolicy.Name -contains $_.Name
if ($isDisabled) {
$dataAttributes = "data-disabled=`"true`""
}
return "<th class=`"$($cssClass) diagonal-header`" $($dataAttributes)><div>$($_.Name)</div></th>"
} | Out-String
# Process only relevant data
$tableData = $UserRegistrations | ForEach-Object {
$hasStrongMethods = $false
$hasWeakMethods = $false
$isPrivileged = $false
$isSync = $false
$isExternal = $false
# Check if user has strong or weak methods
foreach ($method in $_.methodsRegistered) {
if ($strongMethodTypes -contains $method) {
$hasStrongMethods = $true
}
if ($weakMethodTypes.type -contains $method) {
$hasWeakMethods = $true
}
}
# Check if user is privileged
if ($PrivilegedUsersRegistrationDetails.userPrincipalName -contains $_.userPrincipalName) {
$isPrivileged = $true
}
# Check if user is a sync user
if (($_.userPrincipalName -like "Sync_*") -or ($_.userPrincipalName -like "ADToAADSyncServiceAccount*")) {
$isSyncUser = $true
}
# Check if user is an external user
if ($_.userPrincipalName -like "*#EXT#*") {
$isExternal = $true
}
[PSCustomObject]@{
userPrincipalName = $_.userPrincipalName
methodsRegistered = $_.methodsRegistered
defaultMfaMethod = $_.defaultMfaMethod
hasStrongMethods = $hasStrongMethods
hasWeakMethods = $hasWeakMethods
isPasswordlessCapable = $_.isPasswordlessCapable
isMfaCapable = $_.isMfaCapable
isPrivileged = $isPrivileged
isSync = $isSync
isExternal = $isExternal
}
}
# Convert to JSON
$userRegistrationsJson = $tableData | ConvertTo-Json -Compress
$methodTypesJson = $MethodTypes | ConvertTo-Json -Compress
$backtick = [char]96
# Create HTML header
$html = [System.Text.StringBuilder]::new()
[void]$html.AppendLine(@"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Microsoft Entra Authentication Methods Report</title>
<style>
body {
font-family: 'Segoe UI', Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
color: #333;
}
.header-container {
background: linear-gradient(135deg, #0078D4 0%, #106EBE 100%);
color: white;
padding: 25px 40px;
margin-bottom: 30px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.header-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
h1 {
font-size: 28px;
font-weight: 600;
margin: 0;
letter-spacing: -0.5px;
}
.header-subtitle {
font-size: 14px;
font-weight: 400;
margin-top: 0px;
margin-bottom: 10px;
opacity: 0.9;
}
.author-info {
margin-top: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.3);
padding-top: 10px;
display: flex;
align-items: center;
font-size: 13px;
}
.author-label {
opacity: 0.8;
margin-right: 6px;
}
.author-links {
display: flex;
align-items: center;
}
.author-link {
color: white;
text-decoration: none;
display: inline-flex;
align-items: center;
border: 1px solid rgba(255, 255, 255, 0.5);
padding: 4px 10px;
border-radius: 4px;
margin-right: 10px;
transition: all 0.2s ease;
background-color: rgba(255, 255, 255, 0.1);
}
.author-link:hover {
background-color: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.7);
}
.author-link svg {
margin-right: 5px;
}
.report-info {
text-align: right;
font-size: 14px;
}
.report-date {
font-weight: 500;
margin-top: 5px;
}
.content-container {
max-width: 1550px;
margin: 0 auto;
padding: 0 20px 40px;
}
/* Progress bar styling */
.progress-container {
width: 100%;
background-color: white;
border-radius: 8px;
padding: 20px;
margin-bottom: 30px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
box-sizing: border-box; /* Add this to include padding in the width calculation */
}
.progress-title {
font-size: 16px;
font-weight: 600;
margin-bottom: 15px;
color: #333;
}
.progress-bar-container {
height: 30px;
width: 100%;
background-color: #e0e0e0;
border-radius: 15px;
overflow: hidden;
position: relative;
}
.progress-bar {
height: 100%;
background: linear-gradient(135deg, #0078D4 0%, #57A773 100%);
border-radius: 15px;
transition: width 1s ease-in-out;
}
.progress-text {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}
.progress-info {
display: flex;
justify-content: space-between;
margin-top: 10px;
font-size: 14px;
color: #666;
}
.progress-legend {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-top: 15px;
gap: 20px;
}
.legend-item {
display: flex;
align-items: center;
font-size: 13px;
}
.legend-color {
width: 15px;
height: 15px;
margin-right: 5px;
border-radius: 2px;
}
.summary-stats {
display: flex;
flex-wrap: wrap;
margin-bottom: 30px;
gap: 20px;
}
.stat-card {
background-color: white;
border-radius: 8px;
padding: 20px;
flex: 1;
min-width: 200px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.stat-title {
font-size: 14px;
color: #666;
margin-bottom: 10px;
}
.stat-value {
font-size: 24px;
font-weight: bold;
color: #0078D4;
}
.stat-percentage {
font-size: 14px;
color: #666;
}
table {
width: 100%;
border-collapse: collapse;
background-color: white;
border-radius: 8px;
overflow: hidden;
box-shadow: none; /* Remove duplicate shadow */
margin-bottom: 0; /* Remove margin from table as container has margin */
table-layout: fixed; /* Add fixed table layout for better column width control */
}
th {
background-color: #0078D4;
color: white;
text-align: center;
padding: 10px 5px;
font-weight: 600;
position: sticky;
top: 0;
z-index: 10;
font-size: 12px;
height: auto; /* Auto height instead of fixed 80px */
overflow: hidden;
text-overflow: ellipsis;
white-space: normal; /* Allow text to wrap */
hyphens: auto; /* Enable hyphenation */
word-break: break-word;
}
/* Remove diagonal styling and simplify headers */
th.diagonal-header {
position: relative;
text-align: center;
padding: 10px 5px;
}
th.diagonal-header > div {
position: static; /* Regular positioning instead of absolute */
transform: none; /* Remove rotation */
width: auto;
white-space: normal; /* Allow text to wrap */
font-size: 11px;
padding: 0;
}
th.strong-method {
background-color: #57A773;
}
th.weak-method {
background-color: #EE6352;
}
td {
padding: 10px 15px;
border-bottom: 1px solid #eee;
overflow: hidden;
text-overflow: ellipsis; /* Add ellipsis for overflowing cell content */
white-space: nowrap; /* Prevent text wrapping in cells */
text-align: center; /* Center cell content */
}
td:first-child {
text-align: left; /* Left align the UPN column */
}
tr:last-child td {
border-bottom: none;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
tr:hover {
background-color: #f1f1f1;
}
/* Style for the table container to enable horizontal scrolling on small screens */
.table-container {
width: 100%; /* Reset to 100% from 120% */
overflow-x: auto;
margin-bottom: 30px;
margin-left: 0; /* Reset margin-left from -120px */
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
border-radius: 8px;
position: relative; /* Keep relative positioning */
}
#expand-button {
padding: 8px 15px;
background-color: #eee;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
transition: all 0.2s;
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: 0;
}
#expand-button:hover {
background-color: #ddd;
}
#expand-button svg {
width: 16px;
height: 16px;
margin-right: 5px;
}
/* Add tooltip capability for truncated text */
td[title], th[title] {
cursor: pointer;
}
/* Media query for responsive design */
@media (max-width: 768px) {
.table-container {
margin-bottom: 20px;
}
}
.method-registered {
color: #107C10;
text-align: center;
font-weight: bold;
}
.method-not-registered {
color: #D83B01;
text-align: center;
}
.strong-method {
background-color:#57A773; /* Darker green background */
}
.weak-method {
background-color: #EE6352; /* Darker red/pink background */
}
.search-container {
margin-bottom: 20px;
}
#searchBox {
padding: 10px;
width: 300px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.filter-container {
display: flex;
margin-bottom: 20px;
gap: 15px;
flex-wrap: wrap;
}
.filter-button {
padding: 8px 15px;
background-color: #eee;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
transition: all 0.2s;
}
.filter-button:hover {
background-color: #ddd;
}
.filter-button.active {
background-color: #0078D4;
color: white;
}
.pagination-container {
padding: 10px;
display: flex;
justify-content: flex-end;
align-items: center;
gap: 15px;
}
.footer {
text-align: center;
padding: 20px;
color: #666;
font-size: 12px;
}
.checkmark {
color: #0a5a0a; /* Darker green for checkmarks */
font-size: 18px;
font-weight: bold;
}
.x-mark {
color: #b92e02; /* Darker red for x-marks */
font-size: 18px;
font-weight: bold;
}
.switch-container {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 30px;
margin-right: 10px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 30px;
}
.slider:before {
position: absolute;
content: "";
height: 22px;
width: 22px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #0078D4;
}
input:checked + .slider:before {
transform: translateX(30px);
}
.switch-label {
font-size: 14px;
}
/* Remove the old button style */
.hide-disabled-btn {
display: none;
}
/* Style for switch group container */
.switches-group {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 20px;
}
/* Modal styles for fullscreen table */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
z-index: 1000;
overflow: auto;
}
.modal-content {
background-color: white;
margin: 2% auto;
padding: 20px;
width: 95%;
max-width: none;
border-radius: 8px;
position: relative;
}
#close-modal-button {
color: #666;
position: absolute;
top: 15px;
right: 15px;
font-size: 28px;
font-weight: bold;
cursor: pointer;
z-index: 1001;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background-color: #f0f0f0;
transition: all 0.2s ease;
}
#close-modal-button:hover {
background-color: #e0e0e0;
color: #333;
}
/* Fullscreen table styles */
.fullscreen-table-container {
width: 100%;
overflow-x: auto;
}
.fullscreen-table-container table {
width: 100%;
table-layout: auto; /* Override fixed layout for fullscreen */
}
.fullscreen-table-container th,
.fullscreen-table-container td {
white-space: normal; /* Allow text wrapping in fullscreen mode */
}
body.modal-open {
overflow: hidden; /* Prevent scrolling of background when modal is open */
}
#export-csv-button {
padding: 8px 15px;
background-color: #eee;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
transition: all 0.2s;
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: auto; /* Push to right side of filter container */
margin-right: 10px; /* Add space between export and expand buttons */
}
#export-csv-button:hover {
background-color: #ddd;
}
#export-csv-button svg {
width: 16px;
height: 16px;
margin-right: 5px;
}
/* Add space to separate buttons from filter buttons */
.button-group {
margin-left: auto;
display: flex;
}
/* Update filter container to use flexbox properly */
.filter-container {
display: flex;
margin-bottom: 20px;
gap: 15px;
flex-wrap: wrap;
align-items: center;
}
</style>
<!-- Add FileSaver.js for better file saving experience -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
</head>
<body>
<div class="header-container">
<div class="header-content">
<div>
<h1>Microsoft Entra Authentication Methods Report</h1>
<div class="header-subtitle">Overview of authentication methods registered by users</div>
<div class="author-info">
<span class="author-label">Created by:</span>
<div class="author-links">
<a href="https://www.linkedin.com/in/danielbradley2/" class="author-link" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="white">
<path d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"/>
</svg>
Daniel Bradley
</a>
<a href="https://ourcloudnetwork.com" class="author-link" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="white">
<path d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/>
</svg>
ourcloudnetwork.com
</a>
</div>
</div>
</div>
<div class="report-info">
<div class="report-date">Generated: $(Get-Date -Format "MMMM d, yyyy")</div>