Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

Start-DSCConfiguration is returning an error - Custom Application

Open JonasCordsen opened this issue 2 years ago • 6 comments

Hello

I am trying to test this Solution, but I am getting an error when I try to deploy the new configuration. Do you know if I am missing something in the configuration or if this is a bug?

The Error is as follows

PowerShell DSC resource MSFT_AADGroupsNamingPolicy  failed to execute Set-TargetResource functionality with error message: Der  opstod en eller flere fejl.                                                                                                       + CategoryInfo          : InvalidOperation: (:) [], CimException                                                               + FullyQualifiedErrorId : ProviderOperationExecutionFailure                                                                    + PSComputerName        : localhost                                                                                        



VERBOSE: [DESKTOP-FOSRNEN]: LCM:  [ End    Set      ]
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost

The following is the Configuration I am trying to deploy:

param(
    [Parameter()]
    [System.String]
    $ApplicationId,

    [Parameter()]
    [System.String]
    $ApplicationSecret,

    [Parameter()]
    [System.String]
    $TenantId
)

Configuration AzureAD
{
    param(
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $ApplicationSecret,

        [Parameter()]
        [System.String]
        $TenantId
    )

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.22.720.1'

    Node localhost
    {
        AADGroupsNamingPolicy AzureADGroupNaming
        {
            ApplicationId                 = $ApplicationId;
            ApplicationSecret             = $ApplicationSecret;
            CustomBlockedWordsList        = @();
            Ensure                        = "Present";
            IsSingleInstance              = "Yes";
            PrefixSuffixNamingRequirement = "GRP[GroupName]";
            TenantId                      = $TenantId;
        }
    }
}

$ConfigurationData = @{
    AllNodes = @(
        @{
            NodeName                    = "localhost"
            PSDscAllowPlainTextPassword = $true;
            PSDscAllowDomainUser        = $true;
            #region Parameters
            # Default Value Used to Ensure a Configuration Data File is Generated
            ServerNumber = "0"

        }
    )
}
AzureAD -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -ApplicationSecret $ApplicationSecret -TenantId $TenantId

JonasCordsen avatar Aug 10 '22 14:08 JonasCordsen

Could you share the verbose log?

Start-dscconfiguration -usexisting -verbose -wait -force

andikrueger avatar Aug 10 '22 16:08 andikrueger

Here they are file.log

JonasCordsen avatar Aug 10 '22 17:08 JonasCordsen

I have tested this via pipeline, and here it runs without a issue. Is there a compatibility or some prerquirements that I might need?

I run it on windows 11 Powershell 5

JonasCordsen avatar Aug 15 '22 07:08 JonasCordsen

I am having the same issue on a Windows Server

jackmurphy89 avatar Aug 26 '22 02:08 jackmurphy89

@andikrueger is this issue still pending information?

ReneRebsdorf avatar Sep 26 '22 09:09 ReneRebsdorf

Yes and no...We do have one report, that it is working and one, that it is not. :) On our end, we are not able to reproduce this issue.

@ReneRebsdorf Are you seeing any error with this resource and what version of M365DSC are you using?

andikrueger avatar Sep 26 '22 09:09 andikrueger

Closing due to inactivity.

andikrueger avatar Oct 12 '22 07:10 andikrueger