When I am logged in via remote desktop on a Windows Server 2012 R2 Core machine I can trigger the windows update by running sconfig.cmd. This however fails when its getting called within a PS remote session:
Enter-PSSession -ComputerName server2
This is what sconfig complains about. It basically says that it can't find a specific registry value. A funny thing to note is that Microsoft choose VBScript over PowerShell to program this CLI interface...
[server2]: PS C:\> sconfig
C:\>echo off
sconfig : FEHLER: Der angegebene Registrierungsschl?ssel bzw. Wert wurde nicht gefunden.
+ CategoryInfo : NotSpecified: (FEHLER: Der ang...nicht gefunden.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Microsoft (R) Windows Script Host, Version 5.8
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
System wird ?berpr?ft...
[...]
14) Server herunterfahren
15) Zur Befehlszeile wechseln
C:\Windows\System32\de-DE\sconfig.vbs(326, 1) Laufzeitfehler in Microsoft VBScript: Eingabe hinter Dateiende.
How should/can I initiate a Windows Update when being logged in via PS remote session?