Ben Hart
asked on
deploying .Net 4.5 and WMF 4.0 via GPO scripts
I created a new test OU, places 4 windows 7 virtual machines within, 3 are Win7 SP1 Pro and the last is Win7 SP1 Enterprise.
I blocked inheritance on that OU, created a new GPO inside it, the only function of the GPO is to apply two shutdown scripts.
The first is:
rem script to install .net 4.5
@echo off
reg query "HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\.NETFra mework\v4. 0.30319\SK Us\.NETFra mework,ver sion=v4.5"
if %errorlevel%==1 goto installnet
if %errorlevel%==0 goto exit
:installnet
start /wait "\\domain\netlogon\bitlock er\dotnetf x45_full_x 86_x64.exe /ceipconsent /norestart /q"
:exit
exit
the second is:
rem Batch file pushes MWF 4.0 (powershell 4.0)
@echo off
reg query "HKLM\SOFTWARE\Microsoft\P owerShell\ 3\powerShe llEngine" /f 4.0
if %errorlevel%==1 goto installwmf
if %errorlevel%==0 goto exit
:installwmf
start /wait wusa.exe "\\domain\netlogon\bitlock er\Windows 6.1-KB2819 745-x64-Mu ltiPkg.msu " /quiet /norestart
:exit
exit
I gave the test vm's about 20 minutes before forcing a GPupdate, and shutting down. All of the machines took longer to shut down than normal. Once shutdown I brought them all back up and checked in Programs and Features/Installed Updates and should have seen entries for Microsoft Windows Management version 4 and .Net 4.5 but I did not see those on any of the machines.
I can run a gpresult and see the GPO in question being applied successfully, I can see mention of the two batch files as Shutdown scripts however neither actually are ran it seems.
In the System event logs on all 4 I see event 1125, which then checking the Group Policy Operational log I see event 7016. Which says its an error but the text says Completed so IDk what's up with this.
I blocked inheritance on that OU, created a new GPO inside it, the only function of the GPO is to apply two shutdown scripts.
The first is:
rem script to install .net 4.5
@echo off
reg query "HKEY_LOCAL_MACHINE\SOFTWA
if %errorlevel%==1 goto installnet
if %errorlevel%==0 goto exit
:installnet
start /wait "\\domain\netlogon\bitlock
:exit
exit
the second is:
rem Batch file pushes MWF 4.0 (powershell 4.0)
@echo off
reg query "HKLM\SOFTWARE\Microsoft\P
if %errorlevel%==1 goto installwmf
if %errorlevel%==0 goto exit
:installwmf
start /wait wusa.exe "\\domain\netlogon\bitlock
:exit
exit
I gave the test vm's about 20 minutes before forcing a GPupdate, and shutting down. All of the machines took longer to shut down than normal. Once shutdown I brought them all back up and checked in Programs and Features/Installed Updates and should have seen entries for Microsoft Windows Management version 4 and .Net 4.5 but I did not see those on any of the machines.
I can run a gpresult and see the GPO in question being applied successfully, I can see mention of the two batch files as Shutdown scripts however neither actually are ran it seems.
In the System event logs on all 4 I see event 1125, which then checking the Group Policy Operational log I see event 7016. Which says its an error but the text says Completed so IDk what's up with this.
Do these scripts install the updates if ran manually?
ASKER
Good question.. the push_net45.bat script runs successfully. Installed .Net 4.5 quietly without error. The Push_wmf4.bat does not. I spent the past 30 minutes tweaking and trying to get it to run and I think it has to do with the call to wusa.exe because the .net batch correctly runs the exe from a UNC path. I even changed the WMF4 batch to copy the file to %temp% then tried calling it from %temp% but wusa never actually starts. Her'es what I have on that script so far:
@echo off
pushd %~dp0
echo %CD%
copy Windows6.1-KB2819745-x64-M ultiPkg.ms u %temp%
reg query "HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\PowerSh ell\3\powe rShellEngi ne" /f 4.0
if %errorlevel%==1 goto installwmf
if %errorlevel%==0 goto exit
:installwmf
start /wait wusa.exe "%temp%\Windows6.1-KB28197 45-x64-Mul tiPkg.msu" /quiet /norestart
:exit
pause
@echo off
pushd %~dp0
echo %CD%
copy Windows6.1-KB2819745-x64-M
reg query "HKEY_LOCAL_MACHINE\SOFTWA
if %errorlevel%==1 goto installwmf
if %errorlevel%==0 goto exit
:installwmf
start /wait wusa.exe "%temp%\Windows6.1-KB28197
:exit
pause
By chance, have you seen this article:
http://4sysops.com/archives/deploying-powershell-4-with-group-policy/
It covers the WMF install and might help.
http://4sysops.com/archives/deploying-powershell-4-with-group-policy/
It covers the WMF install and might help.
ASKER
That's exactly what I have been following. The WMF script is what is not working for me, as you can tell from my first post the scripts I pasted in here are exactly from his website.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Another question I have to answer myself via a bandaid. Not sure why I'm paying membership fees when the past half a dozen questions barely got any response.
ASKER
I was referred to the website I had been using as a guide by the only person who tried helping me. No one else even tried to help.