microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.53k stars 469 forks source link

AADEntitlementManagementAccessPackageAssignmentPolicy: MOF compile failure #3554

Open nextxpert opened 1 year ago

nextxpert commented 1 year ago

Description of the issue

After successful export of AADEntitlementManagementAccessPackageAssignmentPolicy, execution of the resulting ps1-file fails with the following output:

PSDesiredStateConfiguration\Node : The term 'Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphUserSet' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Users\VssAdministrator\AppData\Local\Temp\M365DSCOutput\M365Configuration-AADEntitlementManagementAccessPackageAssignmentPolicy.ps1:15 char:5 '+ Node localhost '+ ~~~~ ' + CategoryInfo : ObjectNotFound: (Microsoft.Graph...oftGraphUserSet:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException ' + FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node

Microsoft 365 DSC Version

1.23.628.1

Which workloads are affected

Azure Active Directory

The DSC configuration

Generated with Microsoft365DSC version 1.23.726.1

For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC

param ( )

Configuration ConfigureMicrosoft365-AADEntitlementManagementAccessPackageAssignmentPolicy { param ( )

$OrganizationName = $ConfigurationData.NonNodeData.OrganizationName

Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.23.726.1'

Node localhost
{
    AADEntitlementManagementAccessPackageAssignmentPolicy "AADEntitlementManagementAccessPackageAssignmentPolicy-Voor Business rollen; onbeperkte duur"
    {
        AccessPackageId         = "26ce68da-8010-4128-b0e5-95a913da7a13";
        AccessReviewSettings    = MSFT_MicrosoftGraphassignmentreviewsettings{
            IsEnabled = $True
            StartDateTime = '07/20/2023 13:06:13'
            IsAccessRecommendationEnabled = $True
            AccessReviewTimeoutBehavior = 'removeAccess'
            IsApprovalJustificationRequired = $True
            ReviewerType = 'Reviewers'
            RecurrenceType = 'quarterly'
            Reviewers = @(Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphUserSet)
            DurationInDays = 25
        }

; ApplicationId = $ConfigurationData.NonNodeData.ApplicationId; CanExtend = $False; CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint; Description = "Toewijzing voor onbeperkte duur mogelijk. Gebruikers kunnen aanvragen. Reguliere toegangscontrole, iedere 3 maanden."; DisplayName = "Voor Business rollen; onbeperkte duur"; DurationInDays = 0; Ensure = "Present"; Id = "f997c7cd-191f-4953-bbbd-4eaf9c500afd"; RequestApprovalSettings = MSFT_MicrosoftGraphapprovalsettings{ ApprovalMode = 'SingleStage' IsRequestorJustificationRequired = $True IsApprovalRequired = $True IsApprovalRequiredForExtension = $False

            ApprovalStages = @(@()
            )

        }

; RequestorSettings = MSFT_MicrosoftGraphrequestorsettings{

            AllowedRequestors = @(@()
            )
            AcceptRequests = $True
            ScopeType = 'SpecificDirectorySubjects'
        }

; TenantId = $OrganizationName; } } }

ConfigureMicrosoft365-AADEntitlementManagementAccessPackageAssignmentPolicy -ConfigurationData .\ConfigurationData.psd1

Verbose logs showing the problem

[debug] Executing resulting ps1 at C:\Users\VSSADM~1\AppData\Local\Temp\M365DSCOutput\M365Configuration-AADEntitlementManagementAccessPackageAssignmentPolicy.ps1

PSDesiredStateConfiguration\Node : The term 'Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphUserSet' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Users\VssAdministrator\AppData\Local\Temp\M365DSCOutput\M365Configuration-AADEntitlementManagementAccessPackageAssignmentPolicy.ps1:15 char:5

Environment Information + PowerShell Version

OsName               : Microsoft Windows Server 2022 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage           : en-US
OsMuiLanguages       : {en-US}
bgspan commented 1 year ago

I get the same error with Microsoft365DSC version 1.23.809.1