Skip to content
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 11 commits into from
Sep 29, 2022
Merged

AADGroup: Implements #2301 #2316

merged 11 commits into from
Sep 29, 2022

Conversation

salbeck-sit
Copy link
Contributor

Pull Request (PR) description

AADGroup: Add properties MemberOf and AssignedToRole to resource

This Pull Request (PR) fixes the following issues

Implements #2301

@NikCharlebois
Copy link
Collaborator

@salbeck-sit can you please take a look at the failing Unit Tests? Thanks

Copy link
Collaborator

@NikCharlebois NikCharlebois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo. Can you also add an entry in the ChangeLog? Thanks

@@ -14,12 +14,14 @@ class MSFT_AADGroup : OMI_BaseResource
[Write, Description("Specifies an ID for the group.")] String Id;
[Write, Description("User Service Principal values for the group's owners.")] String Owners[];
[Write, Description("User Service Principal values for the group's members.")] String Members[];
[Write, Description("DisplayName values for the groups that htis group is a member of.")] String MemberOf[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in "this"

@@ -164,7 +172,7 @@ function Get-TargetResource
if ($Group.MembershipRuleProcessingState -ne 'On')
{
# Members
[Array]$members = Get-MgGroupMember -GroupId $Group.Id -All:$true
[Array]$members = Get-MgGroupMember -GroupId $Group.Id
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See e01d15b

@NikCharlebois NikCharlebois merged commit fe14254 into microsoft:Dev Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants