You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: runbook-dynamicgroup-mfa.ps1
+38-29Lines changed: 38 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,38 @@
1
-
<#
2
-
Azure Runbook - Dynamic Group - MFA State
3
-
4
-
This script is designed for an Azure Runbook to assign users to two Azure AD groups based on their MFA capability (capable / non-capable).
5
-
Before running the runbook, you need to set up an automation account with a managed identity.
6
-
7
-
The managed identity requires the following Graph Permissions:
8
-
- User.Read.All
9
-
- Group.Read.All
10
-
- Group.ReadWrite.All
11
-
- UserAuthenticationMethod.Read.All
12
-
13
-
The script requires the following modules:
14
-
- Microsoft.Graph.Authentication
15
-
- Microsoft.Graph.Groups
16
-
- Microsoft.Graph.Identity.SignIns
17
-
- Microsoft.Graph.Users
18
-
19
-
!!! Important: Define the variables for the two necessary groups in the Automation Variables as "dynamicmfa_groupid_capable" and "dynamicmfa_groupid_noncapable", or hardcode them in this script. !!!
This script is designed for an Azure Runbook to assign users to two Azure AD groups based on their MFA capability (capable / non-capable).
18
+
Before running the runbook, you need to set up an automation account with a managed identity.e).
19
+
20
+
The managed identity requires the following Graph Permissions:
21
+
- User.Read.All
22
+
- Group.Read.All
23
+
- Group.ReadWrite.All
24
+
- UserAuthenticationMethod.Read.All
25
+
26
+
The script requires the following modules:
27
+
- Microsoft.Graph.Authentication
28
+
- Microsoft.Graph.Groups
29
+
- Microsoft.Graph.Identity.SignIns
30
+
- Microsoft.Graph.Users
31
+
32
+
!!! Important: Define the variables for the two necessary groups in the Automation Variables as "dynamicmfa_groupid_capable" and "dynamicmfa_groupid_noncapable", or hardcode them in this script. !!!
33
+
34
+
#>
35
+
27
36
28
37
#variables (define them on the Automation Variables):
0 commit comments