Remotely install SCCM 2012 Client using powershell

I have the following problem: I created a powershell script that copies the sccm client setup to C:\windows\temp. Then it is supposed to run the sccm setup.

I run the script from our management server. The files are copied, ccmsetup.exe starts, and then quits with the following error in the ccmsetup.log:

[LOG[File 'C:\Windows\ccmsetup\Silverlight.exe' with hash '8C5D1DDAEFD629670033841FB88188789F2F63170B2FE1AADDB2C9B33D4532EA' from manifest doesn't match with the file hash 'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855']LOG]!>

I aslo see this error in the security eventlog: event ID 4763 audit failure SeTCBPrivilege 

Now when I run the same powershell script locally in powershell on the server, everything is fine, no errors, script finishes.

So it probably has something to do with remoting or whatsoever, I just cannot find out what to do. Most people use side wide client push but that is not an option in our environment. I have searched and searched and just cannot find a script that does this. How hard can it be? I hope any of you guys can get me on track with this!

Here is the script I use:

# Vraag naar de naam van  server
$ServerName = Read-Host 'Wat is de naam van de server?'

#Kopieer de SCCM 2012 Client installatie folder naar TEMP

Copy-item "\\yadayadayada\install\ServerInstall\SCCM2012R2Client_5.00.7958.1000" -container -recurse \\$ServerName\c$\windows\temp\

#Start de installatie van SCCM Client

Invoke-Command -Computername $ServerName -ScriptBlock {
    Start-process "C:\windows\temp\SCCM2012R2Client_5.00.7958.1000\ccmsetup.exe" -argumentlist "SMSSITECODE=FSP" -Wait}

if ($setup.exitcode -eq 0) {
    $result = "Successfully installed the SCCM 2012 Client" 
     
    }
    else
    {
    $Result =  "Installation of SCCM 2012 Client Failed"
    } 
    Write-Host $result

#Output naar outputfile op de de beheershare

"Computer name: $ServerName Result: $result"| Out-File -FilePath \\yadayada\install\ServerInstall\Output\ServerFinalConfigLog_"$ServerName".txt

Thanks in advance!

September 9th, 2015 8:20am

Hi,

ConfigMgr forums are here:

https://social.technet.microsoft.com/Forums/en-us/home?category=systemcenter2012configurationmanager&filter=alltypes&sort=lastpostdesc

If you're not going to use client push, look at Jason Sandys' startup script instead (site looks to be offline at the moment, but I'm sure it'll be back up soon enough):

http://blog.configmgrftw.com/configmgr-client-startup-script/

Free Windows Admin Tool Kit Click here and download it now
September 9th, 2015 8:31am

This thread should be moved to the configuration manager 2012 forum thread, the issue is more specific to the behaviour of the CCMSetup than the script.

That being said, this is one of the more unusual methods of installing the CCM Client and not one of the recommended methods by Microsoft.

You could use any of the following methods:

  • Client Push Installation
  • Group Policy software deployment
  • Group Policy startup script

Looking at your script, it looks fine, I believe the issues is more related to the behaviour of the CCMSetup.exe

September 9th, 2015 8:31am

Thanks for the fast reply.  I know it is not one of the normal ways to do it but my client wants it this way. Group policy is not an option. Believe me, I wished I was able to use one of the methods described, I would have it working in no time.

Normally I always use client push or the start up script. This client does the last installation steps manually now and they want those actions in a powershell script. So they install the server, run the script and everything is installed and configured.

I have everything working flawlessly except a simple install of a executable. If I use a different executable I get the same error so it is probably something with the remote part and the authentication that is not passed through. Or user account control. 

Ah well, otherwise I will advise the client to install the sccm client manually if I cannot get this simple stuff to work.

 
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2015 8:42am

One other thought - you could (ab)use the task scheduler for this. You can wrap up a schtasks command in a PS script (dunno why they'd demand a PS script for this) and try that instead of using remoting.
September 9th, 2015 8:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics