PowerShell script to Automatic Services that may have stopped


Get-WmiObject win32_service -ComputerName $computer -Filter “startmode = ‘auto’ AND state != ‘running’ AND name != ‘sppsvc'” | Invoke-WmiMethod -Name StartService

Server 2016 – A service installation section in this INF is invalid

After adding a PCI wireless card to a server and installing the manufacturer drivers it will not work and Device Manager reports Unknown device and the drivers are not installed with a “Service installation section in this INF is invalid” message.

Turns out the wireless features are not installed by default on Windows Servers now and once added back re-add the manufacturer drivers as normal to get working again.

Add-WindowsFeature -Name Wireless-Networking

SSL wildcard certificate missing private key after vendor auto renewal

A vendor (in this case godaddy) auto renewed an existing wildcard SSL cert.  This was renewed against the original CSR of which the server no longer existed.

Upon import to a server (that already had the private key for the expiring certificate) it did not associate a private key and could not be used.  The vendor told us to “re-key” the certificate however this would invalidate the current, live certificate within 3 days.  We could not carefully plan and reconfigure all dependencies within 3 days.

Fortunately the simple was simple.  From a server that already has the private key from the previous certificate extract the thumbprint of the new certificate and run the following,

certutil -repairstore my {thumbprint}

This should locate the primary key and associate with the new cert.

SYSPREP Windows 10 errors

Windows 10 with the latest updates now appears to cause the SYSPREP to fail due to some of the installed apps.  The error log points you to the offending items in the system32\sysprep\panther\setuperr.log file.  I had to remove the packages one by one and SYSPREP would then fail at the next one in the list.

I only had a few to remove to get SYSPREP working again using following PowerShell

Get-AppxPackage *candy* | Remove-AppxPackage
Get-AppxPackage *twitter* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
Get-AppxPackage *HPPrinterControl* | Remove-AppxPackage

Update 27/10/17 After 1709 update SYSPREP errors again this time with the MiraView application and could not remove it, after digging through the event logs shows the corresponding .xml file missing.  Coped c:\windows.old\windows\miraview folder to c:\windows and rebooted.  Afterwards, worked as expected.  An error in the 1709 upgrade process possibly?