Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How? Using an alternate account with Powershell DSC Package Resource and Credential Parameter

$
0
0

I'm attempting to install SCCM2012R2 (among other things) as the local Administrator account using the below Powershell DSC script.

Would someone mind giving me a good working example, or better yet, modify my script if possible?

With the script the way it is, setup begins but the install log file states

 "INFO: ConfigMgr2012 Setup was started by NT AUTHORITY\SYSTEM."

 If I start setup manually with the administrator account it would state that the setup was started as MCG\ADMINISTRATOR
 So it works manually. I just can't get the script to do it.

 Thank you in advance

$ConfigurationData = @{
    AllNodes = @(
        @{
            NodeName="*"
            PSDscAllowPlainTextPassword=$true
         }
         @{
            NodeName="SERVER"
            PSDscAllowPlainTextPassword=$true
         }

    )
}

Configuration InstallSCCMTest {
    Param
    (
        [PSCredential]$Credential
    )
    Node SERVER
    {
        Package InstallSCCM
        {
            Ensure = "Present"
            Name = "SCCM 2012 R2"
            Credential = $Credential
            Path = "D:\SC2012_SP1_RTM_SCCM_SCEP\SMSSETUP\BIN\X64\setup.exe"
            Arguments = "/script c:\ccmscript.ini"
            ProductId = "00000000-0000-0000-0000-000000000000" #Not the correct ProductID but works for installation
        }
    }
}
InstallSCCMTest -OutputPath $PSScriptRoot\InstallSCCMTest -Credential (Get-Credential) -ConfigurationData $ConfigurationData
Start-DscConfiguration -Path "$PSScriptRoot\InstallSCCMTest" -Wait -Verbose -Force



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>