Skip to content

Commit 6bcb0ab

Browse files
authored
Merge pull request #220512 from markwahl-msft/mwahl-em-pshadvanced
entitlement management: even more example psh
2 parents 538df16 + 0369053 commit 6bcb0ab

5 files changed

+71
-5
lines changed

articles/active-directory/governance/entitlement-management-access-package-auto-assignment-policy.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,42 @@ To create a policy for an access package, you need to start from the access pack
7070

7171
## Create an automatic assignment policy programmatically (Preview)
7272

73-
You can also create a policy using Microsoft Graph. A user in an appropriate role with an application that has the delegated `EntitlementManagement.ReadWrite.All` permission, or an application in a catalog role or with the `EntitlementManagement.ReadWrite.All` permission, can call the [create an accessPackageAssignmentPolicy](/graph/api/entitlementmanagement-post-assignmentpolicies?tabs=http&view=graph-rest-1.0&preserve-view=true) API. In your [request payload](/graph/api/resources/accesspackageassignmentpolicy?view=graph-rest-1.0&preserve-view=true), include the `displayName`, `description`, `specificAllowedTargets`, [`automaticRequestSettings`](/graph/api/resources/accesspackageautomaticrequestsettings?view=graph-rest-1.0&preserve-view=true) and `accessPackage` properties of the policy.
73+
There are two ways to create an access package assignment policy for automatic assignment programmatically, through Microsoft Graph and through the PowerShell cmdlets for Microsoft Graph.
74+
75+
### Creating an access package assignment policy through Graph
76+
77+
You can create a policy using Microsoft Graph. A user in an appropriate role with an application that has the delegated `EntitlementManagement.ReadWrite.All` permission, or an application in a catalog role or with the `EntitlementManagement.ReadWrite.All` permission, can call the [create an accessPackageAssignmentPolicy](/graph/api/entitlementmanagement-post-assignmentpolicies?tabs=http&view=graph-rest-1.0&preserve-view=true) API. In your [request payload](/graph/api/resources/accesspackageassignmentpolicy?view=graph-rest-1.0&preserve-view=true), include the `displayName`, `description`, `specificAllowedTargets`, [`automaticRequestSettings`](/graph/api/resources/accesspackageautomaticrequestsettings?view=graph-rest-1.0&preserve-view=true) and `accessPackage` properties of the policy.
78+
79+
### Creating an access package assignment policy through PowerShell
80+
81+
You can also create a policy in PowerShell with the cmdlets from the [Microsoft Graph PowerShell cmdlets for Identity Governance](https://www.powershellgallery.com/packages/Microsoft.Graph.Identity.Governance/) module version 1.16.0 or later.
82+
83+
This script below illustrates using the `v1.0` profile, to create a policy for automatic assignment to an access package. See [create an accessPackageAssignmentPolicy](/graph/api/entitlementmanagement-post-assignmentpolicies?tabs=http&view=graph-rest-v1.0&preserve-view=true) for more examples.
84+
85+
```powershell
86+
Connect-MgGraph -Scopes "EntitlementManagement.ReadWrite.All"
87+
Select-MgProfile -Name "v1.0"
88+
89+
$apid = "cdd5f06b-752a-4c9f-97a6-82f4eda6c76d"
90+
91+
$pparams = @{
92+
DisplayName = "Sales department users"
93+
Description = "All users from sales department"
94+
AllowedTargetScope = "specificDirectoryUsers"
95+
SpecificAllowedTargets = @( @{
96+
"@odata.type" = "#microsoft.graph.attributeRuleMembers"
97+
description = "All users from sales department"
98+
membershipRule = '(user.department -eq "Sales")'
99+
} )
100+
AutomaticRequestSettings = @{
101+
RequestAccessForAllowedTargets = $true
102+
}
103+
AccessPackage = @{
104+
Id = $apid
105+
}
106+
}
107+
New-MgEntitlementManagementAssignmentPolicy -BodyParameter $pparams
108+
```
74109

75110
## Next steps
76111

articles/active-directory/governance/entitlement-management-access-package-create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ $rparams = @{
197197
New-MgEntitlementManagementAccessPackageResourceRoleScope -AccessPackageId $ap.Id -BodyParameter $rparams
198198
```
199199

200-
Finally, create the policies. In this policy, only the administrator can assign access, and there are no access reviews. See [create an accessPackageAssignmentPolicy](/graph/api/entitlementmanagement-post-assignmentpolicies?tabs=http&view=graph-rest-beta&preserve-view=true) for more examples.
200+
Finally, create the policies. In this policy, only the administrator can assign access, and there are no access reviews. See [create an assignment policy through PowerShell](entitlement-management-access-package-request-policy.md#creating-an-access-package-assignment-policy-through-powershell) and [create an accessPackageAssignmentPolicy](/graph/api/entitlementmanagement-post-assignmentpolicies?tabs=http&view=graph-rest-beta&preserve-view=true) for more examples.
201201

202202
```powershell
203203

articles/active-directory/governance/entitlement-management-access-package-incompatible.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,28 @@ Follow these steps to change the list of incompatible groups or other access pac
6767

6868
1. If you wish to prevent users who have an existing group membership from requesting this access package, then select on **Add group** and select the group that the user would already be in.
6969

70-
### Configure incompatible access packages programmatically
70+
### Configure incompatible access packages programmatically through Graph
7171

72-
You can also configure the groups and other access packages that are incompatible with access package using Microsoft Graph. A user in an appropriate role with an application that has the delegated `EntitlementManagement.ReadWrite.All` permission, or an application with that application permission, can call the API to add, remove, and list the incompatible groups and access packages [of an access package](/graph/api/resources/accesspackage).
72+
You can configure the groups and other access packages that are incompatible with an access package using Microsoft Graph. A user in an appropriate role with an application that has the delegated `EntitlementManagement.ReadWrite.All` permission, or an application with that application permission, can call the API to add, remove, and list the incompatible groups and access packages [of an access package](/graph/api/resources/accesspackage).
7373

74+
### Configure incompatible access packages through Microsoft PowerShell
75+
76+
You can also configure the groups and other access packages that are incompatible with an access package in PowerShell with the cmdlets from the [Microsoft Graph PowerShell cmdlets for Identity Governance](https://www.powershellgallery.com/packages/Microsoft.Graph.Identity.Governance/) module version 1.16.0 or later.
77+
78+
This script below illustrates using the `v1.0` profile of Graph to create a relationship to indicate another access package as incompatible.
79+
80+
```powershell
81+
Connect-MgGraph -Scopes "EntitlementManagement.ReadWrite.All"
82+
Select-MgProfile -Name "v1.0"
83+
84+
$apid = "5925c3f7-ed14-4157-99d9-64353604697a"
85+
$otherapid = "cdd5f06b-752a-4c9f-97a6-82f4eda6c76d"
86+
87+
$params = @{
88+
"@odata.id" = "https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/accessPackages/" + $otherapid
89+
}
90+
New-MgEntitlementManagementAccessPackageIncompatibleAccessPackageByRef -AccessPackageId $apid -BodyParameter $params
91+
```
7492

7593
## View other access packages that are configured as incompatible with this one
7694

articles/active-directory/governance/entitlement-management-access-package-request-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ You can create a policy using Microsoft Graph. A user in an appropriate role wit
221221

222222
You can also create an access package in PowerShell with the cmdlets from the [Microsoft Graph PowerShell cmdlets for Identity Governance](https://www.powershellgallery.com/packages/Microsoft.Graph.Identity.Governance/) module version 1.16.0 or later.
223223

224-
This script below illustrates using the `beta` profile, to create a policy for direct assignment to an access package. In this policy, only the administrator can assign access, and there are no access reviews. See [create an accessPackageAssignmentPolicy](/graph/api/entitlementmanagement-post-assignmentpolicies?tabs=http&view=graph-rest-beta&preserve-view=true) for more examples.
224+
This script below illustrates using the `beta` profile, to create a policy for direct assignment to an access package. In this policy, only the administrator can assign access, and there are no access reviews. See [Create an automatic assignment policy](entitlement-management-access-package-auto-assignment-policy.md#creating-an-access-package-assignment-policy-through-powershell) for an example of how to create an automatic assignment policy, and [create an accessPackageAssignmentPolicy](/graph/api/entitlementmanagement-post-assignmentpolicies?tabs=http&view=graph-rest-beta&preserve-view=true) for more examples.
225225

226226
```powershell
227227
Connect-MgGraph -Scopes "EntitlementManagement.ReadWrite.All"

articles/active-directory/governance/entitlement-management-organization.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,19 @@ If you no longer have a relationship with an external Azure AD directory or doma
142142

143143
You can also create, list, update, and delete connected organizations using Microsoft Graph. A user in an appropriate role with an application that has the delegated `EntitlementManagement.ReadWrite.All` permission can call the API to manage [connectedOrganization](/graph/api/resources/connectedorganization) objects and set sponsors for them.
144144

145+
### Manage connected organizations through Microsoft PowerShell
146+
147+
You can also manage connected organizations in PowerShell with the cmdlets from the [Microsoft Graph PowerShell cmdlets for Identity Governance](https://www.powershellgallery.com/packages/Microsoft.Graph.Identity.Governance/) module version 1.16.0 or later.
148+
149+
This script below illustrates using the `v1.0` profile of Graph to retrieve all the connected organizations.
150+
151+
```powershell
152+
Connect-MgGraph -Scopes "EntitlementManagement.ReadWrite.All"
153+
Select-MgProfile -Name "v1.0"
154+
155+
$co = Get-MgEntitlementManagementConnectedOrganization -all
156+
```
157+
145158
## State properties of connected organizations
146159

147160
There are two different types of state properties for connected organizations in Microsoft Entra entitlement management currently, configured and proposed:

0 commit comments

Comments
 (0)