-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3090 from Borgquite/patch-1
Create AU ScopedRoleMembership example
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...icrosoft365DSC/Examples/Resources/AADAdministrativeUnit/2-CreateNewAdministrativeUnit.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<# | ||
This example is used to test new resources and showcase the usage of new resources being worked on. | ||
It is not meant to use as a production baseline. | ||
#> | ||
|
||
Configuration Example | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[PSCredential] | ||
$credsGlobalAdmin | ||
) | ||
|
||
Import-DscResource -ModuleName Microsoft365DSC | ||
|
||
Configuration Example | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[PSCredential] | ||
$credsGlobalAdmin | ||
) | ||
|
||
Import-DscResource -ModuleName Microsoft365DSC | ||
|
||
node localhost | ||
{ | ||
AADGroup 'TestGroup' | ||
{ | ||
DisplayName = 'TestGroup' | ||
MailNickname = 'TestGroup' | ||
SecurityEnabled = $true | ||
MailEnabled = $false | ||
IsAssignableToRole = $true | ||
Ensure = "Present" | ||
Credential = $credsGlobalAdmin | ||
} | ||
AADAdministrativeUnit 'TestUnit' | ||
{ | ||
DisplayName = 'Test-Unit' | ||
ScopedRoleMembers = @( | ||
MSFT_MicrosoftGraphScopedRoleMembership | ||
{ | ||
RoleName = "User Administrator" | ||
RoleMemberInfo = MSFT_MicrosoftGraphIdentity | ||
{ | ||
Identity = "TestGroup" | ||
Type = "Group" | ||
} | ||
} | ||
) | ||
Ensure = 'Present' | ||
Credential = $credsGlobalAdmin | ||
DependsOn = "[AADGroup]TestGroup" | ||
} | ||
} | ||
} |