-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AADGroup: Implements #2301 #2316
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
77a4aff
Adding MemberOf and AssignedToRole
salbeck-sit cbba7b2
Merge branch 'microsoft:Dev' into Dev
salbeck-sit ccebd49
Merge branch 'microsoft:Dev' into Dev
salbeck-sit cc3589b
fixed missing param in AADGroup unit-tests
salbeck-sit 0e15e4d
fixed typo in schema.mof
salbeck-sit 31b553b
removed param -All from calls to Get-MgGroup*
salbeck-sit 8426a89
updated changelog
salbeck-sit 3918462
Merge branch 'microsoft:Dev' into Dev
salbeck-sit 814864f
re-add param -All in Get-MgGroup* cmdlet-calls
salbeck-sit c12c021
change -All to -All:$true
salbeck-sit 22e6021
Merge branch 'Dev' into Dev
NikCharlebois File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-ConfigureAADGroups.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,31 @@ | ||
<# | ||
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 | ||
|
||
node localhost | ||
{ | ||
AADGroup 'MyGroups' | ||
{ | ||
DisplayName = "DSCGroup" | ||
Description = "Microsoft DSC Group" | ||
SecurityEnabled = $True | ||
MailEnabled = $False | ||
GroupTypes = @() | ||
MailNickname = "DSCGroup" | ||
Ensure = "Present" | ||
IsAssignableToRole = $True | ||
AssignedToRole = "Identity Governance Administrator" | ||
Credential = $credsGlobalAdmin | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
Modules/Microsoft365DSC/Examples/Resources/AADGroup/3-ConfigureAADGroups.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,39 @@ | ||
<# | ||
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 | ||
|
||
node localhost | ||
{ | ||
AADGroup 'MyGroups1' | ||
{ | ||
DisplayName = "DSCGroup" | ||
Description = "Microsoft DSC Group" | ||
SecurityEnabled = $True | ||
GroupTypes = @() | ||
MailNickname = "M365DSCG" | ||
Ensure = "Present" | ||
Credential = $credsGlobalAdmin | ||
} | ||
AADGroup 'MyGroups2' | ||
{ | ||
DisplayName = "DSCMemberGroup" | ||
Description = "Microsoft DSC Editor" | ||
SecurityEnabled = $True | ||
GroupTypes = @() | ||
MailNickname = "M365DSCMG" | ||
Ensure = "Present" | ||
MemberOf = @("DSCGroup") | ||
Credential = $credsGlobalAdmin | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing the -All here? It should be included to make sure we catch all members
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-ALL is apparently no longer supported by Get-MgGroup* cmdlets in v1.12.0 of the Microsoft.Graph.Groups module.
Running the unit-tests with -All parameters resulted in a number of 'caught throws' where the text in the corresponding M365DSC eventlog stated that "A parameter cannot be found that matches parameter name 'All'". The only cmdlets in the Get-TargetResource function that used -All were the Get-MgGroup* cmdlets. Removing -All everywhere resulted in a passed unit-test.
The question of whether this should have been brought to the attention of the folks responsible for Graph-modules is another matter. I guess you could have gotten them to update the relevant module in a day or two as something similar has happened before, but I really just wanted to get the change under wraps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was an intermediate release. Graph modules at up to 1.12.1 now and do allow the -all parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See e01d15b