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: MailNickname, SecurityEnabled and MailEnabled parameters should be 'required' #3072

Closed
Borgquite opened this issue Mar 24, 2023 · 0 comments · Fixed by #3077 or #3140
Closed
Labels
Breaking Changes Bug Something isn't working Entra ID

Comments

@Borgquite
Copy link
Contributor

Borgquite commented Mar 24, 2023

Details of the scenario you tried and the problem that is occurring

When creating a new AADGroup, the following parameters are all required by Graph, but are not required by the Microsoft365DSC module:

  • MailNickname
  • SecurityEnabled
  • MailEnabled

See https://learn.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http#request-body, verified with testing

Verbose logs showing the problem

(For mailEnabled - the others are also true though)

VERBOSE: [COMPUTERNAME]: [[AADGroup]GroupName] Performing the operation "New-MgGroup_CreateExpanded" on target "Call
remote 'GroupsGroupCreateGroup' operation".
A value is required for property 'mailEnabled' of resource 'Group'.
+ CategoryInfo : InvalidOperation: ({ body = Micros...oftGraphGroup }:) [], CimException
+ FullyQualifiedErrorId : Request_BadRequest,Microsoft.Graph.PowerShell.Cmdlets.NewMgGroup_CreateExpanded
+ PSComputerName : localhost

Suggested solution to the issue

The module should be updated so that compilation fails if these are not supplied (make them Required)

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $credsGlobalAdmin
    )

    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        AADGroup 'TestGroup'
        {
            DisplayName                   = 'TestGroup'
            MailNickname                  = 'TestGroup'
            SecurityEnabled               = $true
            Ensure                        = "Present"
            Credential                    = $credsGlobalAdmin
        }
    }
}

The operating system the target node is running

OsName : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : en-GB
OsMuiLanguages : {en-GB, en-US}

Version of the DSC module that was used ('dev' if using current dev branch)

1.23.308.1

NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Changes Bug Something isn't working Entra ID
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants