Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

deploying .Net 4.5 and WMF 4.0 via GPO scripts

Posted on 2014-02-10
7
Medium Priority
?
2,100 Views
Last Modified: 2014-02-16
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\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,version=v4.5"
if %errorlevel%==1 goto installnet
if %errorlevel%==0 goto exit
:installnet
start /wait "\\domain\netlogon\bitlocker\dotnetfx45_full_x86_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\PowerShell\3\powerShellEngine" /f 4.0
if %errorlevel%==1 goto installwmf
if %errorlevel%==0 goto exit
:installwmf
start /wait wusa.exe "\\domain\netlogon\bitlocker\Windows6.1-KB2819745-x64-MultiPkg.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.
0
Comment
Question by:Ben Hart
  • 5
  • 2
7 Comments
 
LVL 22

Expert Comment

by:Joseph Moody
ID: 39849943
Do these scripts install the updates if ran manually?
0
 
LVL 14

Author Comment

by:Ben Hart
ID: 39850125
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-MultiPkg.msu %temp%
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\powerShellEngine" /f 4.0
if %errorlevel%==1 goto installwmf
if %errorlevel%==0 goto exit
:installwmf
start /wait wusa.exe "%temp%\Windows6.1-KB2819745-x64-MultiPkg.msu" /quiet /norestart
:exit
pause
0
 
LVL 22

Expert Comment

by:Joseph Moody
ID: 39850138
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Author Comment

by:Ben Hart
ID: 39850180
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.
0
 
LVL 14

Accepted Solution

by:
Ben Hart earned 0 total points
ID: 39850317
Initial tests show that shit might be my solution

@echo off
pushd %~dp0
echo %CD%
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\powerShellEngine" /f 4.0
if %errorlevel%==1 goto installwmf
if %errorlevel%==0 goto exit
:installwmf
expand -f:* Windows6.1-KB2819745-x64-MultiPkg.msu %temp%
pkgmgr.exe /n:%temp%\Windows6.1-2819745-x64.xml /quiet /norestart
:exit
0
 
LVL 14

Author Comment

by:Ben Hart
ID: 39851162
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.
0
 
LVL 14

Author Closing Comment

by:Ben Hart
ID: 39862479
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.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question