How do you install .net4 on a Server 2008 r2 machine through psremoting in powershell?

Posted by Jake on Super User See other posts from Super User or by Jake
Published on 2011-11-18T20:14:55Z Indexed on 2011/11/28 18:09 UTC
Read the original article Hit count: 443

I need to write a script that installs .net 4 remotely using powershell to a group of Server 2008 R2 machines. I based my script off of http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/3045eb24-7739-4695-ae94-5aa7052119fd/.

enter-pssession -computername localhost
$arglist = "/q /norestart /log C:\Users\tempuser\Desktop\dotnetfx4"
$filepath = "C:\Users\tempuser\Desktop\dotNetFx40_Full_setup.exe"
Start-Process -FilePath $filepath -ArgumentList $arglist -Wait -PassThru

After running the command I would get the following log errors (running the same lines locally would install .net without error):

Action: Downloading Item 
Failed to CreateJob : hr= 0x80200014
Action: Performing actions on all Items
Action: Performing Action on Exe at C:\Users\tempuser\Desktop\dotnetfx4\SetupUtility.exe
Exe (C:\Users\tempuser\Desktop\dotnetfx4\SetupUtility.exe) succeeded.
 Exe Log File: dd_SetupUtility.txt
Action complete
Action: ServiceControl - Stop clr_optimization_v2.0.50727_32
 ServiceControl operation succeeded!
Action complete
Action: ServiceControl - Stop clr_optimization_v2.0.50727_64
 ServiceControl operation succeeded!
Action complete
Action: Performing Action on Exe at C:\Users\tempuser\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\Windows6.1-KB958488-v6001-x64.msu
Exe (C:\Users\tempuser\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\Windows6.1-KB958488-v6001-x64.msu) failed with 0x5 - Access is denied. .
 PerformOperation on exe returned exit code 5 (translates to HRESULT = 0x5)
Action complete
 OnFailureBehavior for this item is to Rollback.
Action: Performing actions on all Items
Action complete
Action complete
Action: Downloading http://go.microsoft.com/fwlink/?LinkId=164184&clcid=0x409 using WinHttp 
WinHttpDetectAutoProxyConfigUrl failed with error: 12180
Unable to retrieve Proxy information although WinHttpGetIEProxyConfigForCurrentUser called succeeded
Action complete
C:\Users\tempuser\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\TMPF279.tmp.exe: Verifying signature for netfx_Core.mzz
C:\Users\tempuser\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\TMPF279.tmp.exe Signature verified successfully for netfx_Core.mzz
Action complete
 Decompression completed with code: 16389
 Decompression of payload failed: C:\Users\tempuser\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\netfx_Core.mzz
Action complete
 Final Result: Installation failed with error code: (0x80074005) (Elapsed time: 0 00:00:28).

Is there some security setting or perhaps something else I've missed?

© Super User or respective owner

Related posts about powershell

Related posts about windows-server-2008-r2