Running script (.cmd) or exe under user context using DSC

Welcome Forums DSC (Desired State Configuration) Running script (.cmd) or exe 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
  • #57025

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

    Hello,

    We are trying to install Windows 10 ADK under user context. We performed following steps:
    1. Created self signed certificate for Target Node and Authoring Node on Target Node(referred https://msdn.microsoft.com/en-us/powershell/dsc/secureMOF)

    2. Ran following script to install ADK, but ADK keeps on installing under system context when checked in task manager on target node.
    I checked the mof file created and it shows credential=NULL.
    Please guide of we are missing on anything.

    Configuration MyConfiguration
    {
    param(
    [Parameter(Mandatory)]
    [PSCredential]$MyCredential
    )

    Import-DscResource -ModuleName PSDesiredStateConfiguration

    Node $AllNodes.NodeName
    {
    Script ADK10
    {
    SetScript = {& \\UNCPATH\ADK10.cmd}
    TestScript = {$False}
    GetScript = {# Do Nothing}
    }
    Credential = $credential
    }
    LocalConfigurationManager
    {
    CertificateID = '3F6609C3FB9E8BC141F04C9EB07186E346DD64AA'
    }
    }
    }
    $cd = @{
    AllNodes = @(
    @{
    NodeName = "TargetServerName"
    PSDscAllowDomainUser = $true
    CertificateFile = 'Path to public key certificate'
    Thumbprint = '3F6609C3FB9E8BC141F04C9EB07186E346DD64AA'
    }
    )
    }
    MyConfiguration -ConfigurationData $Cd -OutputPath "\\UNCPath\Test3"
    Set-DscLocalConfigurationManager -Path "\\UNCPath\Test3" -Force -Verbose
    Start-DscConfiguration -Path "\\UNCPath\Test3" -Wait -Verbose -force

  • #57536

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

    Again, this is really an ADK thing, not PowerShell – it's something you might need to take up with Microsoft Product Support.

The topic ‘Running script (.cmd) or exe under user context using DSC’ is closed to new replies.

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