maandag 8 juli 2013

SCCM-Health-Check-v3.5 troubleshooting

Via via I got my hand on the SCCM Health Check script. Last version is 3.5.
I'm running SCCM 2012 SP1 on Windows Server 2008 R2.
At first test run of the script I noticed DNS errors (forward lookup error). I double checked manually and surely, those DNS errors were false. So the script was wrong. Hence started the troubleshooting part...

I quickly discovered the script used a library "JHSoftware.DnsClient.dll" which failed to load:
Exception calling "LoadFile" with "1" argument(s): "An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework.
When googling this error syntax I found many solutions pointed to changing the "powershell_ise.exe.config" file and adding this to the xml file:

 <runtime>
 <loadfromremotesources enabled="true"/>
</runtime>
Well... didn't help. 
I searched quite a long time on this topic, but after a lot of digging found this as an easier solution:
In the script itself, change line 1087
  • [System.Reflection.Assembly]::LoadFile("$DNSDll") | Out-Null

to
  • [System.Reflection.Assembly]::UnSafeLoadFrom("$DNSDll") | Out-Null
I don't know the details of why the first solution doesn't work, but this is a far easier solution. 
And because I don't want people searching the web for wrong(?) information, I'm putting this on the web as a quick fix.
Now I'm off for some more troubleshooting as the script still isn't happy...



Geen opmerkingen:

Een reactie posten