Skip to content

Commit 188cfe0

Browse files
committed
Script to gather MFA details of MFA users.
1 parent bea5e03 commit 188cfe0

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

MSO/Get-MFAEnabledUser.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Connect-MsolService
2+
3+
Get-MsolUser -EnabledFilter EnabledOnly -All | ForEach-Object {
4+
$AuthMethods = $_.StrongAuthenticationMethods
5+
$DefaultMethod = ($AuthMethods | Where-Object -Property IsDefault -EQ $true).MethodType
6+
7+
New-Object -TypeName psobject -Property @{
8+
UserPrincipalName = $_.UserPrincipalName
9+
RelyingParty = $_.StrongAuthenticationRequirements.RelyingParty
10+
RememberDevicesNotIssuedBefore = $_.StrongAuthenticationRequirements.RememberDevicesNotIssuedBefore
11+
State = $_.StrongAuthenticationRequirements.State
12+
DefaultMethod = $DefaultMethod
13+
MethodType1 = $AuthMethods[0].MethodType
14+
MethodType2 = $AuthMethods[1].MethodType
15+
MethodType3 = $AuthMethods[2].MethodType
16+
MethodType4 = $AuthMethods[3].MethodType
17+
}
18+
} | Export-Csv -Path ~\Downloads\MfaUsers.csv -NoTypeInformation

MSO/Remove-OneDriveIRM.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# These 3 lines get the Documents site from SPO for the specified user
2-
$webUrl = "https://company-my.sharepoint.com/personal/company
2+
$webUrl = "https://company-my.sharepoint.com/personal/company"
33
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
4-
$list = $clientContext.Web.Lists.GetByTitle(Documents")
4+
$list = $clientContext.Web.Lists.GetByTitle("Documents")
55

66
# reset the value to the default settings
77
$list.InformationRightsManagementSettings.Reset()

0 commit comments

Comments
 (0)