“WARNING: Failed to load reporting information from Win32_ComputerSystem with hr = 80041010 and WARNING: Failed to load reporting information from Win32_BiosProperties with hr = 80041010”.

Capture

So I naturally tried to access Win32_ComputerSystem WMI class using a Wbemtest but I was getting an Invalid class error

 

Capture

Capture

Capture

Capture

Capture

This looked like a corrupt WMI repository.
use CMD to run command
net stop winmgmt
select Yes or Y
sc config winmgmt start= disabled
cd %windir%\system32\wbem
for /f %s in (‘dir /b *.dll’) do regsvr32 /s %s
for /f %s in (‘dir /b *.mof’) do mofcomp %s
wmiprvse /regserver
sc config winmgmt start= auto

give it a few minutes to complete then restart server.

VBS script can also be used this cover the entire C:\ drive

Create a RebuildWMI.vbs file then copy and paste the following script give it a good 15 minutes.

set osh = createobject(“wscript.shell”)
set fso = createobject(“scripting.filesystemobject”)

ret = osh.run(“sc stop iphlpsvc”,0,true)
ret = osh.run(“sc config winmgmt start= disabled”)
ret = osh.run(“sc stop winmgmt”,0,true)

bp = osh.popup(“Service stop returned ” & ret & “. Continue?” & vbcrlf & vbcrlf & “Ensure that WMI has stopped before continuing”,,”Continue?”,33)
if bp <> 1 then wscript.quit

if fso.folderexists(“c:\windows\system32\wbem\repository.old”) then
fso.deletefolder(“c:\windows\system32\wbem\repository.old”)
end if

if fso.folderexists(“c:\windows\system32\wbem\repository”) then
set rfol = fso.getfolder(“c:\windows\system32\wbem\repository”)
rfol.name = “repository.old”
end if

set rfol = fso.getfolder(“c:\windows\system32\wbem”)

for each fil in rfol.files
if right(lcase(fil.name),4) = “.dll” then
osh.run “regsvr32 /s “”” & fil.path & “”””,0,true
end if
next

ret = osh.run(“sc config winmgmt start= auto”)
ret = osh.run(“sc start winmgmt”,0,true)

bp = osh.popup(“Service start returned ” & ret & “. Continue?” & vbcrlf & vbcrlf & “Ensure that WMI has started before continuing”,,”Continue?”,33)
if bp <> 1 then wscript.quit

set rfol = fso.getfolder(“c:\”)

recur rfol

Msgbox “WMI rebuild complete. Reboot server”

sub recur(fol)
on error resume next
if lcase(fol.name) <> “system volume information” and lcase(fol.name) <> “recycler” and lcase(fol.name) <> “boot” and lcase(fol.name) <> “$recycle.bin” then
for each fil in fol.files
if right(lcase(fil.name),4) = “.mof” or right(lcase(fil.name),4) = “.mfl” then
osh.run “mofcomp “”” & fil.path & “”””,1,true
end if
next
for each sfol in fol.subfolders
recur sfol
next
end if
end sub
Run the script at every prompt give a good 15 minutes before it completes the process

have a look at windowsupdate.log file again and it should be sweet with no errors

 

 

PowerShell is King – Building a Reference Image Factory (v 3.2)

The Deployment Bunny

The Image Factory has been re-worked and updated. It also has moved to GitHub https://github.com/DeploymentBunny/ImageFactoryV3ForHyper-V/

Concept and flow

The idea is the same, we use MDT, create refimages task sequences that runs without any questions. A PowerShell script will grab all enabled Task Sequences in a specified folder, create a VM for each of them. Grab the Bios Serial number from each om them, update customsettings ini with that information, start the VM’s (number of concurrent VM’s determine how many VM’s can run at the same time, wait until all VM’s are done and finally removes all VM’s for a cleanup process. You can run the script as is (if you store it in C:SetupImageFactoryV3ForHyper-V on you MDT server), or you can open it in ISE and run section by section to see what happens.

The XML file (C:SetupImageFactoryV3ForHyper-VImageFactoryV3.xml)

Is a control file for settings, pretty straightforward, just make sure…

View original post 128 more words