Skip to content

Commit

Permalink
Merge pull request #3090 from Borgquite/patch-1
Browse files Browse the repository at this point in the history
Create AU ScopedRoleMembership example
  • Loading branch information
NikCharlebois authored Mar 29, 2023
2 parents 76e9dd8 + 6b5f34f commit a7d8d04
Showing 1 changed file with 59 additions and 0 deletions.
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"
}
}
}

0 comments on commit a7d8d04

Please sign in to comment.