Error while executing .cmd file under user context using DSC

Welcome Forums DSC (Desired State Configuration) Error while executing .cmd file under user context using DSC

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
2 years, 6 months ago.

  • Author
    Posts
  • #57028

    Participant
    Topics: 2
    Replies: 0
    Points: 0
    Rank: Member

    Hello,

    We are installing Windows 10 ADK using user context. For this we created certificated on target node and imported public key on Authoring node using link https://msdn.microsoft.com/en-us/powershell/dsc/secureMOF.

    We created and ran following script on authoring node, but when we run the script we get following error:
    "Script ADK10.cmd threw non-terminating error when running Set-TargetResource functionality"
    We checked the mof file created and it shows the password is encrypted.
    Please help!!!

    Configuration ADKTest
    {
    param(
    [Parameter(Mandatory=$true)]
    [ValidateNotNullorEmpty()]
    [PsCredential]$credential
    )
    Import-DscResource -ModuleName PSDesiredStateConfiguration

    Node $AllNodes.NodeName
    {
    Script ADK10
    {
    SetScript = {& \\Server1\ADK10.cmd}
    TestScript = {$False}
    GetScript = {# Do Nothing}
    }
    Credential = $credential
    }
    LocalConfigurationManager
    {
    CertificateID = $Node.Thumbprint
    }
    }
    }

    $ConfigData = @{
    AllNodes = @(
    @{
    NodeName = 'TargetNode'
    PSDscAllowDomainUser = $true
    #PsDscAllowPlainTextPassword = $false
    CertificateFile = 'Path of public certificate file'
    Thumbprint = '3F6609C3FB9E8BC141F04C9EB07186E346DD64AA'
    }
    )
    }

    ADKTest -ConfigurationData $ConfigData -OutputPath "\\Server1\Test2"
    Set-DscLocalConfigurationManager -Path "\\Server1\Test2" -Force -Verbose
    Start-DscConfiguration -Path "\\Server1\Test2" -Wait -Verbose -force

  • #57535

    Keymaster
    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    So, unfortunately "Script ADK10.cmd threw non-terminating error when running Set-TargetResource functionality" isn't a very detailed error message – there's nothing anyone over the Internet is going to be able to do to help you, with just that information. You're going to have to troubleshoot the CMD script itself, which obviously isn't PowerShell, but there's no way from this end to tell you what's wrong.

The topic ‘Error while executing .cmd file under user context using DSC’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort