From 6b5f34f4dafc365a987da1e90cc15d67c00bb9d4 Mon Sep 17 00:00:00 2001 From: Chris Hill <53898223+Borgquite@users.noreply.github.com> Date: Fri, 24 Mar 2023 13:45:08 +0000 Subject: [PATCH] Create AU ScopedRoleMembership example --- .../2-CreateNewAdministrativeUnit.ps1 | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-CreateNewAdministrativeUnit.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-CreateNewAdministrativeUnit.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-CreateNewAdministrativeUnit.ps1 new file mode 100644 index 0000000000..d09f4fdecc --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-CreateNewAdministrativeUnit.ps1 @@ -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" + } + } +}