- Copy internal post link
- Copy external post link
- Report article
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html
[content:359185]
Update suchen nicht möglich mit sconfig.exe - Windows 2016
Vorweg wünsche ich euch ersteinmal eine schöne Weihnachtszeit.
Nun aber du meinem Problem..
Ich habe hier eine Windows Server 2016 (1607 Build 14393.1944) VM und möchte gerne Updates einspielen. Updates holt sich die VM normal über die Microsoft Server also nicht über einen fremden WSUS..
Wenn ich die Konsole "sconfig.exe" öffne und dann "6" eingebe, um Updates zu installieren, öffnet sich das zweite Konsolenfenster nur kurz und verschwindet gleich wieder...
In den Ereignisprotokollen konnte ich auch keinen Fehler finden - bin nicht wirklich windowsaffin .. kann also auch sein, dass ich da etwas übersehen habe, da ich leider nicht weis, wo diese sconfig seine Logs schreibt.
Ich finde auch im Internet nichts hilfreiches.. Ich hoffe es kann mir hier jemand weiterhelfen.
Liebe Grüße!
moddry
Content-Key: 359185
Url: https://administrator.de/contentid/359185
Printed on: April 20, 2024 at 02:04 o'clock
- Comment overview - Please log in
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252934
[content:359185#1252934]
Ist der Server nur als Core installiert, oder hat du Zugriff auf die GUI?
Wurde die Sprache nach der Installation umgestellt (zB von EN-en auf DE-de)??
Was ist in den Update-Einstellungen eingestellt (automatisch?, manuell? benutzerdefiniert?)
Hast du schon mal den Dienst Windows Update beendet, und den Ordner Softwaredistribution gelöscht / umbenannt??
Gruss
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252948
[content:359185#1252948]
Der Server hat eine GUI. Möchte die Updates aber trotzdem über den sconfig Dialog machen.
Ob die Sprache umgestellt wurde kann ich dir leider nicht sagen. Aber ich gehe mal von nein aus.
Updates stehen im Moment auf automatisch, jedoch hilft das Umstellen in Manuell oder Benutzerdef. nicht.. :/
Hast du schon mal den Dienst Windows Update beendet, und den Ordner Softwaredistribution gelöscht / umbenannt??
Wo finde ich diesen Ordner? Neustart des Dienstes bringt auch nichts..
Grüße Maxi
Edit:
Ordner habe ich mal geleert, Dienst entsprechend neu gestartet - keine Besserung.. Ich habe echt keine Ahnung mehr..
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252949
[content:359185#1252949]
Was passiert denn, wenn du die Updates über die GUI (nur mal testhalber) anstösst??
Gruss
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252950
[content:359185#1252950]
Dann editiere mal die „%windir%\system32\sprache\sconfig.cmd
Mach in dem Abschnitt, wo die "6" abgearbeitet wird, mal Pausen rein, dann siehst du, was die Console für eine Meldung ausgibt
Gruss
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252952
[content:359185#1252952]
Maxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252953
[content:359185#1252953]
MAxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252957
[content:359185#1252957]
Ich habe das Skript, welches geöffnet wird gefunden.
Wenn ich mir das Skript manuell aufrufe also so: PS C:\Windows\System32\de-DE> cscript.exe .\WUA_SearchDownloadInstall.vbs
Dann funktioniert es. Also funktioniert dieses Skript ansich ja..
Für mich kann es dann nur noch an dem sconfig.cmd liegen..
Hier die Datei:
echo off
color 17
for /F "tokens=3* delims= " %%A IN ('REG QUERY "HKCU\Control Panel\International" /v LocaleName') do set language=%%A
for /F "tokens=3* delims= " %%A IN ('REG QUERY "HKCU\Control Panel\Desktop" /v PreferredUILanguages') do set language=%%A
cls
REM Default language script is en-US
if not exist %windir%\system32\%language%\sconfig.vbs set language=en-US
pushd %~dp0
cd %windir%\system32\%language%
cscript sconfig.vbs
popd
color
Die Sprache ist auf Deutsch eingestellt. Also de-de auf dem Server.
Maxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252958
[content:359185#1252958]
'-------------------------------------------
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' Version 2.0
' sconfig.vbs - Configuration script used to setup a machine for remote configuration
'
'-------------------------------------------
const L_Msg001_Text = "Keine IP-Adresse"
const L_Msg002_Text = " Keine IP-Adresse "
const L_Msg003_Text = "Keine aktiven Netzwerkkarten gefunden."
const L_Msg004_Text = "Warnung"
const L_Msg005_Text = " Serverkonfiguration"
const L_Msg006_Text = "1) Domäne/Arbeitsgruppe: "
const L_Msg007_Text = "2) Computername: "
const L_Msg008_Text = "3) Lokalen Administrator hinzufügen"
const L_Msg009_Text = "8) Netzwerkeinstell."
const L_Msg010_Text = "5) Windows Update-Einstellungen: "
const L_Msg011_Text = "6) Updates herunterladen u. installieren "
const L_Msg012_Text = "7) Remotedesktop: "
const L_Msg013_Text = "Auswahl:"
const L_Msg014_Text = "9) Datum und Uhrzeit"
const L_Msg015_Text = ") Benutzer abmelden"
const L_Msg016_Text = ") Server neu starten"
const L_Msg017_Text = ") Server herunterfahren"
const L_Msg018_Text = ") Zur Befehlszeile wechseln"
const L_Msg019_Text = "Geben Sie eine Zahl ein, um eine Option auszuwählen: "
const L_Msg020_Text = "Domänen-/Arbeitsgruppenmitgliedschaft ändern"
const L_Msg021_Text = "(D)omäne oder (A)rbeitsgruppe beitreten? (Leer = Abbrechen) "
const L_Msg022_Text = "Domäne"
const L_Msg023_Text = "Arbeitsgruppe"
const L_Msg024_Text = "Der Computer gehört zurzeit einer Domäne an."
const L_Msg025_Text = "Möchten Sie diesen Computer jetzt aus der aktuellen Domäne entfernen?"
const L_Msg026_Text = "Geben Sie einen autorisierten Benutzer im Format ""Domäne\Benutzer"" an: "
const L_Msg027_Text = "Der Computer wird aus der aktuellen Domäne entfernt..."
const L_Msg028_Text = "Der Computer muss neu gestartet werden, damit die Änderungen übernommen werden."
const L_Msg029_Text = "Jetzt neu starten?"
const L_Msg030_Text = "Neu starten"
const L_Msg031_Text = "Geben Sie den Benutzer im Format ""Domäne\Benutzer"" an: "
const L_Msg032_Text = "Domäne beitreten"
const L_Msg033_Text = "Geben Sie den neuen Computernamen ein (Leer = Abbrechen): "
const L_Msg034_Text = "Computername"
const L_Msg035_Text = "Der Computername wird geändert..."
const L_Msg036_Text = "Geben Sie das Konto zum Beitreten zur lokalen Administratorgruppe ein (Leer = Abbrechen): "
const L_Msg037_Text = "Wird zur lokalen Administratorgruppe hinzugefügt..."
const L_Msg038_Text = "Lokale Administratorgruppe"
const L_Msg039_Text = "Der Benutzer wurde der lokalen Administratorgruppe hinzugefügt."
const L_Msg040_Text = "Ausgabe"
const L_Msg043_Text = "Windows Update ist derzeit auf Folgendes festgelegt: "
const L_Msg044_Text = "(A)utomatisch, Nur (D)ownloads oder (M)anuelle Updates auswählen:"
const L_Msg045_Text = "Automatisch"
const L_Msg046_Text = "Vom System werden täglich um 3:00 Uhr Updates gesucht und installiert."
const L_Msg047_Text = "Automatische Updates werden aktiviert..."
const L_Msg048_Text = "Manuell"
const L_Msg049_Text = "Das System sucht nie nach Updates."
const L_Msg050_Text = "Updates werden auf Manuell festgelegt..."
const L_Msg051_Text = "Windows Update ist festgelegt auf: "
const L_Msg052_Text = "Update-Einstellungen"
const L_Msg053_Text = "Remotedesktop (a)ktivieren oder (d)eaktivieren? (Leer = Abbrechen) "
const L_Msg054_Text = "1) Nur Clients zulassen, auf denen Remotedesktop mit Authentifizierung auf Netzwerkebene ausgeführt wird (höhere Sicherheit)"
const L_Msg055_Text = "2) Clients zulassen, auf denen eine beliebige Version von Remotedesktop ausgeführt wird (geringere Sicherheit)"
const L_Msg056_Text = "Auswahl: "
const L_Msg057_Text = "Remotedesktop wird aktiviert..."
const L_Msg058_Text = "Remotedesktop wurde für Clients aktiviert, auf denen eine beliebige Version von Remotedesktop ausgeführt wird (geringere Sicherheit)."
const L_Msg059_Text = "Remotedesktop"
const L_Msg060_Text = "Remotedesktop wurde nur für Clients aktiviert, auf denen Remotedesktop mit Authentifizierung auf Netzwerkebene ausgeführt wird (höhere Sicherheit)."
const L_Msg061_Text = "Fehler beim Deaktivieren von Remotedesktop."
const L_Msg062_Text = "Remotedesktop wird deaktiviert..."
const L_Msg063_Text = "Remotedesktop wurde deaktiviert."
const L_Msg064_Text = "Möchten Sie sich wirklich abmelden?"
const L_Msg065_Text = "Abmelden"
const L_Msg066_Text = "Möchten Sie wirklich einen Neustart ausführen?"
const L_Msg067_Text = "Soll wirklich heruntergefahren werden?"
const L_Msg068_Text = "Herunterfahren"
const L_Msg069_Text = "Aktiviert (alle Clients)"
const L_Msg070_Text = "Aktiviert (nur sicherere Clients)"
const L_Msg071_Text = "Deaktiviert"
const L_Msg072_Text = "-----------------------------"
const L_Msg073_Text = " Netzwerkeinstellungen"
const L_Msg074_Text = "Verfügbare Netzwerkkarten"
const L_Msg075_Text = "Index# IP-Adresse Beschreibung"
const L_Msg076_Text = "Wählen Sie die Indexnummer für die Netzwerkkarte aus (Leer = Abbrechen): "
const L_Msg077_Text = " Netzwerkkarteneinstellungen"
const L_Msg078_Text = "NIC-Index"
const L_Msg079_Text = "Beschreibung"
const L_Msg080_Text = "IP-Adresse"
const L_Msg081_Text = "DHCP aktiviert"
const L_Msg082_Text = "Bevorzugter DNS-Server"
const L_Msg083_Text = "Alternativer DNS-Server"
const L_Msg084_Text = "1) Adresse der Netzwerkkarte festlegen"
const L_Msg085_Text = "2) DNS-Server festlegen"
const L_Msg086_Text = "3) DNS-Servereinstellungen löschen"
const L_Msg087_Text = "4) Zurück zum Hauptmenü"
const L_Msg088_Text = "Gewünschte Option: "
const L_Msg089_Text = "Wählen Sie (D)HCP oder (S)tatische IP-Adresse aus (Leer = Abbrechen): "
const L_Msg090_Text = "Statische IP-Adresse festlegen"
const L_Msg091_Text = "Geben Sie die statische IP-Adresse ein: "
const L_Msg092_Text = "Geben Sie die Subnetzmaske ein (Leer = Standard: "
const L_Msg093_Text = "): "
const L_Msg094_Text = "Geben Sie das Standardgateway ein: "
const L_Msg095_Text = "NIC wird auf statische IP-Adresse festgelegt..."
const L_Msg096_Text = "Die IP-Adresse konnte nicht geändert werden."
const L_Msg097_Text = "Netzwerkeinstellungen"
const L_Msg098_Text = "Netzwerkkarte wird auf die Verwendung von DHCP festgelegt..."
const L_Msg099_Text = "DNS-Server"
const L_Msg100_Text = "Geben Sie den neuen bevorzugten DNS-Server ein (Leer = Abbrechen): "
const L_Msg101_Text = "Der bevorzugte DNS-Server wurde festgelegt."
const L_Msg102_Text = "Geben Sie den alternativen DNS-Server ein (Leer = keiner): "
const L_Msg103_Text = "Der alternative DNS-Server wurde festgelegt."
const L_Msg104_Text = "Der alternative DNS-Server konnte nicht festgelegt werden."
const L_Msg105_Text = "Der bevorzugte DNS-Server konnte nicht festgelegt werden."
const L_Msg106_Text = "Die DNS-Server wurden entfernt. DNS-Server werden automatisch aus dem Netzwerk abgerufen."
const L_Msg107_Text = "Die DNS-Server konnten nicht gelöscht werden."
const L_Msg108_Text = "Fehler beim Beitritt zur Arbeitsgruppe"
const L_Msg109_Text = "Willkommen in dieser Arbeitsgruppe: "
const L_Msg110_Text = "Teilnehmen"
const L_Msg111_Text = "System wird überprüft..."
const L_Msg112_Text = "Geben Sie eine gültige IP-Adresse an."
const L_Msg113_Text = "IP-Adressen mit 127 sind ungültig, da diese für Loopbackadressen reserviert sind. Geben Sie einen anderen gültigen Wert zwischen 1 und 223 an."
const L_Msg114_Text = "Zugriff wurde verweigert."
const L_Msg115_Text = "Falscher Parameter."
const L_Msg116_Text = "Das angegebene Objekt kann nicht geöffnet werden."
const L_Msg117_Text = "Das Kennwort kann nicht aktualisiert werden."
const L_Msg118_Text = "Anmeldefehler: Benutzername oder Kennwort ist unbekannt."
const L_Msg119_Text = "Die angegebene Domäne ist nicht vorhanden, oder es konnte keine Verbindung mit ihr hergestellt werden."
const L_Msg120_Text = "Das Konto ist bereits vorhanden."
const L_Msg121_Text = "Der Computer ist bereits Mitglied der Domäne."
const L_Msg122_Text = "Der Computer ist zurzeit kein Mitglied einer Domäne."
const L_Msg123_Text = "Fehler beim Beitreten zur Domäne."
const L_Msg124_Text = "Name der Domäne für den Beitritt: "
const L_Msg125_Text = "Name der Arbeitsgruppe für den Beitritt: "
const L_Msg126_Text = "Beitreten zu "
const L_Msg127_Text = " wird ausgeführt..."
const L_Msg128_Text = "==============================================================================="
const L_Msg129_Text = "A" '(E)nable
const L_Msg130_Text = "D" '(D)isable
const L_Msg131_Text = "S" '(S)tatic IP
const L_Msg132_Text = "D" '(D)HCP
const L_Msg133_Text = "A" '(W)orkgroup
const L_Msg134_Text = "D" '(D)omain
const L_Msg135_Text = "Format für einen Benutzernamen in einer Domänenumgebung: ""Domäne\Benutzername""."
const L_Msg136_Text = "Geben Sie in einer Arbeitsgruppenumgebung den Benutzernamen an."
const L_Msg137_Text = "M" 'Manual
const L_Msg138_Text = "A" 'Automatic
const L_Msg139_Text = "Subnetzmaske"
const L_Msg140_Text = "Standardgateway"
const L_Msg141_Text = "Mit dieser Option wird die Shell der grafischen Benutzeroberfläche des Servers aktiviert und ein Neustart erforderlich."
const L_Msg142_Text = "12) Wiederherstellen der grafischen Benutzeroberfläche (GUI)"
const L_Msg143_Text = "11) Windows-Aktivierung "
const L_Msg144_Text = "Geben Sie ""SCONFIG"" ein, damit dieses Menü angezeigt wird."
const L_Msg145_Text = "Aktiviert"
const L_Msg146_Text = "Deaktiviert"
const L_Msg149_Text = "Bestätigen"
const L_Msg150_Text = "1) Lizenzinformationen anzeigen"
const L_Msg151_Text = "2) Windows aktivieren"
const L_Msg153_Text = "3) Product Key installieren"
const L_Msg155_Text = "4) Zurück zum Hauptmenü"
const L_Msg156_Text = "4) Remoteverwaltung konfigurieren "
const L_Msg157_Text = "1) Remoteverwaltung aktivieren"
const L_Msg158_Text = "2) Remoteverwaltung deaktivieren"
const L_Msg161_Text = "4) Zurück zum Hauptmenü"
const L_Msg165_Text = "Fehler beim Neukonfigurieren der Windows-Firewall."
const L_Msg166_Text = "Die Remoteverwaltung wurde für alle Windows-Firewall-Profile blockiert."
const L_Msg167_Text = "Möchten Sie den Computernamen vor dem Neustart des Computers ändern?"
const L_Msg168_Text = "Computername ändern"
const L_Msg172_Text = "Drücken Sie die Eingabetaste, um den Vorgang fortzusetzen..."
const L_Msg175_Text = "Fehler"
const L_Msg179_Text = " Remoteverwaltung konfigurieren"
const L_Msg186_Text = "IPv6-Adresse"
const L_Msg187_Text = "IPv6-Gateway"
const L_Msg188_Text = "3) Serverantwort für Ping konfigurieren"
const L_Msg189_Text = "Soll dieser Server auf Pingen von Remotecomputern reagieren?"
const L_Msg190_Text = "Server wurde so konfiguriert, dass er auf Ping reagiert."
const L_Msg191_Text = "Server wurde so konfiguriert, dass er nicht auf Ping reagiert."
const L_Msg193_Text = "Unterstützen Sie uns bei der Verbesserung von Windows Server! Wenn die Telemetrie konfiguriert ist, werden von Windows regelmäßig statistische Informationen zu Ihrem System gesammelt und an Microsoft übermittelt. Die erfassten Informationen werden nicht dazu verwendet, Sie oder Ihr Unternehmen zu identifizieren oder zu kontaktieren."
const L_Msg194_Text = "Wenn Sie Imageerstellungstechnologie auf diesem Server nutzen, um weitere Server zu erstellen, verfügen diese über dieselben Telemetrieeinstellungen."
const L_Msg195_Text = "Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?LinkId=811315."
const L_Msg196_Text = "Die Windows-Datenschutzbestimmungen finden Sie unter https://go.microsoft.com/fwlink/?LinkId=734730."
const L_Msg197_Text = "10) Telemetrieeinstellungen "
const L_Msg198_Text = "Nicht teilnehmen"
const L_Msg199_Text = "Telemetrieeinstellungen ändern?"
const L_Msg200_Text = "Telemetrie"
const L_Msg201_Text = " -- Windows-Aktivierung --"
const L_Msg202_Text = "Telemetrieeinstellungen werden vom Systemadministrator verwaltet und können nicht geändert werden."
const L_Msg203_Text = "Fehler beim Aktivieren von Remotedesktop."
const L_Msg204_Text = "Remoteverwaltung wird aktiviert..."
const L_Msg205_Text = "Remoteverwaltung wird deaktiviert..."
const L_Msg206_Text = "Remoteverwaltung wurde erfolgreich aktiviert."
const L_Msg207_Text = "Fehler beim Aktivieren der Remoteverwaltung"
const L_Msg208_Text = "Remoteverwaltung wurde erfolgreich deaktiviert."
const L_Msg209_Text = "Fehler beim Deaktivieren der Remoteverwaltung"
const L_Msg210_Text = "Aktueller Status: Remoteverwaltung ist aktiviert."
const L_Msg211_Text = "Aktueller Status: Remoteverwaltung ist deaktiviert."
const L_Msg212_Text = "Fehler beim Abrufen der Einstellungen der Remoteverwaltung"
const L_Msg213_Text = "Die Einstellungen der Remoteverwaltung werden vom Systemadministrator verwaltet und können nicht geändert werden."
const L_Msg214_Text = "Grafische Benutzeroberfläche aktivieren"
const L_Msg215_Text = "Unbekannt"
const L_Msg216_Text = "Product Key eingeben"
const L_Msg217_Text = "Unterstützen Sie uns bei der Verbesserung von Microsoft Hyper-V Server! Wenn die Telemetrie konfiguriert ist, werden von Windows regelmäßig statistische Informationen zu Ihrem System gesammelt und an Microsoft übermittelt. Die erfassten Informationen werden nicht dazu verwendet, Sie oder Ihr Unternehmen zu identifizieren oder zu kontaktieren."
const L_Msg218_Text = "Die Datenschutzbestimmungen für Microsoft Hyper-V Server finden Sie unter https://go.microsoft.com/fwlink/?LinkId=734730."
const L_Msg219_Text = "Nur Downloads" ' Windows Update setting string
const L_Msg220_Text = "Benutzerdefiniert" ' Windows Update setting string
const L_Msg221_Text = "D" 'DownloadOnly
const L_Msg222_Text = "Nur Downloads-Updates werden aktiviert..."
const L_Msg223_Text = "Das System sucht und lädt Updates herunter."
const L_Msg224_Text = "Das System weist eine benutzerdefinierte Konfiguration für Updates auf."
const L_Msg225_Text = "Verfügbare Telemetrieeinstellungen:"
const L_Msg226_Text = "Sicherheit"
const L_Msg227_Text = "Einfach"
const L_Msg228_Text = "Erweitert"
const L_Msg229_Text = "Vollständig"
const L_Msg230_Text = "Geben Sie eine neue Telemetrieeinstellung ein (Leer = Abbrechen): "
const WUA_Script = "cscript WUA_SearchDownloadInstall.vbs"
const TelemetryCountSettings = 4
Dim CmdResults
Dim pcname
Dim group_type
Dim groupname
Dim InDomain
Dim MgmtNIC
Dim Autopatch
Dim Update_schedule
Dim Update_schedule_descr
Dim updateSelectionSet
Dim objNetAdapter
Dim DNSsetting
Dim DisplayIP
Dim objWshScriptExec
Dim TS_status
Dim HVS_SKU
Dim Telemetry_Status
Dim RemoteManagementStatus
Set oShell = WScript.CreateObject ("WScript.shell")
Set objWMIService = GetObject( "winmgmts:\\.\root\cimv2")
'Force to run with cscript
if Instr(1,Wscript.FullName,"Cscript",vbTextCompare)=0 then
oShell.Run "cscript " & chr(34) & wscript.ScriptFullName & chr(34)
wscript.quit
end if
Set oUACExec = oShell.Exec("cmd /c " & chr(34) & "whoami /groups | find " & chr(34) & "S-1-16-12288" & chr(34) & chr(34))
Do While (oUACExec.Status = cnWshRunning)
WScript.Sleep 100
Loop
If oUACExec.ExitCode <> 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "cscript", Chr(34) & WScript.ScriptFullName & Chr(34), "", "runas", 1
wscript.quit
end if
GetInitialStatusValues()
Do
' Get NICs
Set nics = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration where IPenabled=TRUE")
' Try to select the first NIC with an active IP
for each n in nics
MgmtNIC= n.index
Set objNetAdapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" & MgmtNIC)
exit for
next
' Deal with case where NICs go away
if MgmtNIC="" then
'No active NIC
DisplayIP = L_Msg003_Text
else
Set objNetAdapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" & MgmtNIC)
if objNetAdapter.IPenabled then
DisplayIP = objNetAdapter.IPAddress(0)
else
'No Active NICs
DisplayIP = L_Msg003_Text
end if
end if
' Get Domain status
InDomain = GetDomainStatus()
' Get Remote Desktop status
CheckRemoteDesktop()
' Get Telemetry status
CheckTelemetrystatus()
'Get Remote Mangement status
CheckRemoteManagementStatus()
wscript.echo
wscript.echo L_Msg128_Text '======
wscript.echo L_Msg005_Text 'sconfig
wscript.echo L_Msg128_Text '======
wscript.echo
wscript.echo L_Msg006_Text & group_type &": " & groupname 'domain/workgroup
wscript.echo L_Msg007_Text & pcname 'Computer name
wscript.echo L_Msg008_Text 'Add local admin
wscript.echo L_Msg156_Text & RemoteManagementStatus 'Configure Remote Access
wscript.echo ""
wscript.echo L_Msg010_Text & Update_schedule 'Update settings
wscript.echo L_Msg011_Text 'Download and Install updates
wscript.echo L_Msg012_Text & TS_status 'Remote Desktop
wscript.echo ""
if MgmtNIC="" then ' Network settings
wscript.echo L_Msg009_Text & vbTab & vbTab & vbTab & DisplayIP
else
wscript.echo L_Msg009_Text
end if
wscript.echo L_Msg014_Text ' Date and Time
wscript.echo L_Msg197_Text & Telemetry_Status ' Telemetry
if HVS_SKU then
offset=0
else
' Show Activation and Restore GUI menu items on Server Core
wscript.echo L_Msg143_Text ' 11) Windows Activation
offset=1
end if
wscript.echo ""
wscript.echo cstr(11+offset) & L_Msg015_Text ' Logoff
wscript.echo cstr(12+offset) & L_Msg016_Text ' Restart
wscript.echo cstr(13+offset) & L_Msg017_Text ' Shut Down
wscript.echo cstr(14+offset) & L_Msg018_Text ' Exit to cmd line
wscript.echo
if HVS_SKU then wscript.echo
wscript.StdOut.Write L_Msg019_Text
OptionSelection = Wscript.StdIn.ReadLine
wscript.echo
Select Case OptionSelection
Case "1" 'Change Domain/workgroup name
wscript.echo
wscript.echo L_Msg020_Text
do
wscript.echo
wscript.StdOut.Write L_Msg021_Text
DorW = Wscript.StdIn.ReadLine
loop until ucase(DorW)=ucase(L_Msg134_Text) or ucase(DorW)=ucase(L_Msg133_Text) or DorW=""
if ucase(DorW)=ucase(L_Msg133_Text) then
'Join Workgroup
'If in a domain, we need to remove it first before joining a workgroup
if InDomain then
confirm = msgbox(L_Msg024_Text & vbCRLF & L_Msg025_Text,VBYesNo,L_Msg004_Text)
if confirm=vbYes then
wscript.StdOut.Write L_Msg026_Text
domainuser = Wscript.StdIn.ReadLine
wscript.echo
wscript.echo L_Msg027_Text
targetstr = "netdom remove %computername% /domain:" & NewGroupName & " /userd:" & domainuser & " /passwordd:*"
result= oShell.Run(targetstr,1,TRUE)
if result=0 then
confirm = msgbox(L_Msg028_Text & vbCRLF & L_Msg029_Text, VBYesNo,L_Msg030_Text)
if confirm=vbYes then oShell.Run "shutdown /r /t 0",1
else
DomainAccessErrorMsg(result)
end if
end if
else
JoinWorkgroup()
end if
end if
if ucase(DorW)=ucase(L_Msg134_Text) then
'Joining Domain
group_type= L_Msg022_Text
wscript.echo
wscript.echo L_Msg032_Text
wscript.StdOut.Write L_Msg124_Text
NewGroupName = Wscript.StdIn.ReadLine
wscript.StdOut.Write L_Msg026_Text
domainuser = Wscript.StdIn.ReadLine
wscript.echo
wscript.echo L_Msg126_Text & NewGroupName & L_Msg127_Text
wscript.echo
targetstr = "netdom join %computername% /domain:" & NewGroupName & " /userd:" & domainuser & " /passwordd:*"
result= oShell.Run(targetstr,1,TRUE)
if result=0 then
confirm = msgbox(L_Msg167_Text, vbYesNo+vbDefaultButton2,L_Msg168_Text)
if confirm=vbYes then
ChangeComputerName()
else
confirm = msgbox(L_Msg028_Text & vbCRLF & L_Msg029_Text, VBYesNo,L_Msg030_Text)
if confirm=vbYes then oShell.Run "shutdown /r /t 0",1
end if
else
DomainAccessErrorMsg(result)
end if
end if
Case "2" 'Change Computer Name
ChangeComputerName()
Case "3" 'Add Account to local admin
wscript.echo L_Msg135_Text
wscript.echo L_Msg136_Text
wscript.echo
wscript.StdOut.Write L_Msg036_Text
AddUserAcct = Wscript.StdIn.ReadLine
if AddUserAcct="" then
'cancel
else
if not InDomain then
'Handle workgroup case by creating account first
targetstr = "net user " & AddUserAcct & " * /add"
result= oShell.Run(targetstr,1,TRUE)
if result<>0 then
'Show error message
RunShowOutput(targetstr)
else
AddToAdminGroup()
end if
else
AddToAdminGroup()
end if
end if
Case "4" 'Configure for remote management
ConfigureRemoteManagement()
Case "5" 'Update Settings
wscript.echo L_Msg043_Text & Update_schedule
wscript.StdOut.Write L_Msg044_Text
updateselection = Wscript.StdIn.ReadLine
updateSelectionSet = FALSE
if ucase(updateselection)=ucase(L_Msg138_Text) then
'Make updates automatic
wscript.echo
wscript.echo L_Msg047_Text
oShell.Run "Cscript %WinDir%\System32\SCregEdit.wsf /AU 4" & NewComputerName,7,TRUE
' Refresh update settings status
GetUpdateSettings Update_schedule, Update_schedule_descr
updateSelectionSet = TRUE
end if
if ucase(updateselection)=ucase(L_Msg221_Text) then
'Make updates DownloadOnly
wscript.echo
wscript.echo L_Msg222_Text
oShell.Run "Cscript %WinDir%\System32\SCregEdit.wsf /AU 3" & NewComputerName,7,TRUE
' Refresh update settings status
GetUpdateSettings Update_schedule, Update_schedule_descr
updateSelectionSet = TRUE
end if
if ucase(updateselection)=ucase(L_Msg137_Text) then
'Make updates manual
wscript.echo
wscript.echo L_Msg050_Text
oShell.Run "Cscript %WinDir%\System32\SCregEdit.wsf /AU 1" & NewComputerName,7,TRUE
' Refresh update settings status
GetUpdateSettings Update_schedule, Update_schedule_descr
updateSelectionSet = TRUE
end if
if updateSelectionSet then
oShell.Run "Net stop wuauserv",7,TRUE
oShell.Run "Net start wuauserv",7,TRUE
MsgBox L_Msg051_Text & Update_schedule & ". " & Update_schedule_descr, vbInformation, L_Msg052_Text
end if
Case "6" 'Install Security Patches
'Install all patches on seperate thread
oShell.Run WUA_Script,1,False
Case "7" 'Enable/disable Remote Desktop
WScript.Echo
wscript.StdOut.Write L_Msg053_Text
rd = Wscript.StdIn.ReadLine
if ucase(rd)=ucase(L_Msg129_Text) then ' Enable
do
wscript.echo
wscript.echo L_Msg054_Text
wscript.echo
wscript.echo L_Msg055_Text
wscript.echo
wscript.StdOut.Write L_Msg056_Text
rdsecuritylevel = Wscript.StdIn.ReadLine
loop while not (rdsecuritylevel="1" or rdsecuritylevel="2")
wscript.echo
wscript.echo L_Msg057_Text
'Enable Remote Desktop Admin mode
result=oShell.Run("Cscript %WinDir%\System32\Scregedit.wsf /ar 0 " & NewComputerName,7,TRUE)
oShell.Run "Cscript %WinDir%\System32\Scregedit.wsf /cs 1 " & NewComputerName,7,TRUE
if result=0 then
if rdsecuritylevel=2 then
'Allow WinXP and Win 2003 clients
oShell.Run "Cscript %WinDir%\System32\Scregedit.wsf /cs 0 " & NewComputerName,7,TRUE
msgbox L_Msg058_Text,Information,L_Msg059_Text
else
msgbox L_Msg060_Text,Information,L_Msg059_Text
end if
else
msgbox L_Msg203_Text,vbCritical,L_Msg059_Text
end if
end if
if ucase(rd)=ucase(L_Msg130_Text) then
wscript.echo
wscript.echo L_Msg062_Text
'Disable Remote Desktop mode
result=oShell.Run("Cscript %WinDir%\System32\Scregedit.wsf /ar 1 " & NewComputerName,7,TRUE)
oShell.Run "Cscript %WinDir%\System32\Scregedit.wsf /cs 1 " & NewComputerName,7,TRUE
if result=0 then
msgbox L_Msg063_Text,vbInformation,L_Msg059_Text
else
msgbox L_Msg061_Text,vbCritical,L_Msg059_Text
end if
end if
Case "8" 'Change Management NIC Assignment
If MgmtNIC<>"" then
ManagementNICsettings()
else
'Display no active NIC message
DisplayIP = L_Msg003_Text
end if
Case "9" 'Set Date and Time
oShell.Run "control timedate.cpl"
Case "10" 'Telemetry
DisplayTelemetrydialog()
Case "11"
if not(HVS_SKU) then 'show Activation menu item
ActivateInstall()
else 'Logoff
confirm = msgbox(L_Msg064_Text, vbYesNo+vbDefaultButton2,L_Msg065_Text)
if confirm=vbYes then
oShell.Run "logoff",7,True
end if
end if
Case "12"
if not(HVS_SKU) then 'Log Off
confirm = msgbox(L_Msg064_Text, vbYesNo+vbDefaultButton2,L_Msg065_Text)
if confirm=vbYes then
oShell.Run "logoff",7,True
end if
else ' Restart
confirm = msgbox(L_Msg066_Text, vbYesNo+vbDefaultButton2,L_Msg030_Text)
if confirm=vbYes then
oShell.Run "shutdown /r /t 0",1
end if
end if
Case "13"
if not(HVS_SKU) then ' Restart
confirm = msgbox(L_Msg066_Text, vbYesNo+vbDefaultButton2,L_Msg030_Text)
if confirm=vbYes then oShell.Run "shutdown /r /t 0",1
else 'Shut Down
confirm = msgbox(L_Msg067_Text, vbYesNo+vbDefaultButton2,L_Msg068_Text)
if confirm=vbYes then oShell.Run "shutdown /s /t 0",1
end if
Case "14"
if not(HVS_SKU) then 'Shut Down
confirm = msgbox(L_Msg067_Text, vbYesNo+vbDefaultButton2,L_Msg068_Text)
if confirm=vbYes then oShell.Run "shutdown /s /t 0",1
else 'Exit to command line
wscript.quit
end if
Case "15"
if not(HVS_SKU) then 'Exit to command line
wscript.quit
end if
Case Else
'
end Select
Loop 'Loops back to main menu unless exiting
wscript.quit
sub CheckRemoteDesktop()
' True if Remote Desktop enabled
Dim Sh, sKey, sValueName, sValue, nValue
Set Sh = CreateObject("WScript.Shell")
sKey = "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\"
sValueName = "fDenyTSConnections"
sValue = Sh.RegRead(SKey & sValueName)
if sValue=0 then
nValue= Sh.RegRead(sKey & "WinStations\RDP-Tcp\UserAuthentication")
if nValue = 0 then
TS_status= L_Msg069_Text
else
TS_status= L_Msg070_Text
end if
else
TS_status= L_Msg071_Text
end if
End sub
Function LegalNicSelected(pickedNIC)
LegalNicSelected=False
For Each nic in nics
if pickedNIC=CStr(nic.Index) then
LegalNicSelected=True
end if
Next
end Function
Sub ManagementNICsettings()
Set nics = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPenabled=TRUE")
Set objNetAdapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" & MgmtNIC)
wscript.echo
wscript.echo L_Msg072_Text
wscript.echo L_Msg073_Text
wscript.echo L_Msg072_Text
wscript.echo
wscript.echo
wscript.echo L_Msg074_Text
wscript.echo
wscript.echo L_Msg075_Text
For Each nic in nics
if nic.IPenabled then
DisplayIP = nic.IPAddress(0)
else
DisplayIP=L_Msg002_Text
end if
wscript.echo
'Adjust spacing for non EN-US
if instr(L_Msg075_Text,"Index#") then
wscript.StdOut.Write " " & nic.Index & VBTab & DisplayIP & VBTab & left(nic.Description,54)
else
wscript.StdOut.Write " " & nic.Index & VBTab & VBTab & DisplayIP & VBTab & left(nic.Description,47)
end if
Next
wscript.Echo
do
wscript.Echo
wscript.StdOut.Write L_Msg076_Text
SelectedNIC = Wscript.StdIn.ReadLine
loop until LegalNicSelected(SelectedNIC) or SelectedNIC = ""
if SelectedNIC="" then
'Do nothing, Cancel was selected, return to main menu
else
'Set the MgmtNIC to a legal value
MgmtNIC=SelectedNIC
do
wscript.echo
wscript.echo L_Msg072_Text
wscript.echo L_Msg077_Text
wscript.echo L_Msg072_Text
wscript.echo
Set nics = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration where IPenabled=TRUE")
Set objNetAdapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" & MgmtNIC)
'Display NIC info (IP, DHCP, DNS)
For Each nic in nics
if nic.index=cint(MgmtNIC) then
if nic.IPenabled then
DisplayIP = ""
DisplayIP = nic.IPAddress(0)
DisplayIPv6 = ""
DisplayIPv6 = nic.IPAddress(1)
else
DisplayIP=L_Msg002_Text
end if
wscript.echo
wscript.echo L_Msg078_Text & vbTab & vbTab & MgmtNIC
wscript.echo L_Msg079_Text & vbTab & vbTab & nic.Description
wscript.echo L_Msg080_Text & vbTab & vbTab & DisplayIP & vbTab & DisplayIPv6
wscript.echo L_Msg139_Text & vbTab & vbTab & nic.IPSubnet(0)
wscript.echo L_Msg081_Text & vbTab & vbTab & nic.DHCPenabled
on error resume next
DefaultGateway= cstr(nic.DefaultIPGateway(0))
if err<>0 then
DefaultGateway = ""
end if
on error goto 0
on error resume next
DisplayIPv6Gateway = cstr(nic.DefaultIPGateway(1))
if err<>0 then
DisplayIPv6Gateway = ""
end if
on error goto 0
wscript.echo L_Msg140_Text & vbTab & vbTab & DefaultGateway & vbTab & DisplayIPv6Gateway
on error resume next
primarydns= cstr(nic.DNSServerSearchOrder(0))
if err<>0 then
primarydns=""
end if
altdns= cstr(nic.DNSServerSearchOrder(1))
if err<>0 then
altdns=""
end if
on error goto 0
wscript.echo L_Msg082_Text & vbTab & primarydns
wscript.echo L_Msg083_Text & vbTab & altdns
end if
Next
'Display Network Adapter Options
wscript.echo
wscript.echo L_Msg084_Text
wscript.echo L_Msg085_Text
wscript.echo L_Msg086_Text
wscript.echo L_Msg087_Text
wscript.echo
wscript.echo
do
wscript.StdOut.Write L_Msg088_Text
NIC_option = Wscript.StdIn.ReadLine
loop until (left(NIC_option,1)>= "1" and left(NIC_option,1) <= "4") or NIC_option=""
Select Case NIC_option
Case "1" ' Set NIC IP to DHCP or Static
'---- Set IP for Selected NIC
wscript.echo
wscript.echo
wscript.StdOut.Write L_Msg089_Text
IPtypeSelection = Wscript.StdIn.ReadLine
Select Case ucase(IPtypeSelection)
Case ucase(L_Msg131_Text) 'Set Static IP
wscript.echo
wscript.echo L_Msg090_Text
do
wscript.StdOut.Write L_Msg091_Text
ip_address = wscript.StdIn.ReadLine
loop until CheckStaticIP(ip_address)
If IdentifyIPv4(ip_address) then
'Get Netmask
wscript.StdOut.Write L_Msg092_Text & DefaultNetmask(ip_address) & L_Msg093_Text
netmask = wscript.StdIn.ReadLine
if netmask="" then netmask=DefaultNetmask(ip_address)
' Get IPv4 Gateway
do
wscript.StdOut.Write L_Msg094_Text
gateway = wscript.StdIn.ReadLine
if gateway="" then exit do
loop until CheckStaticIP(gateway)
else
' Get IPv6 Gateway
end if
'Set the IP address info
strIPAddress = Array(ip_address)
strSubnetMask = Array(netmask)
strGateway = Array(gateway)
strGatewayMetric = Array(1)
wscript.echo L_Msg095_Text
'clear out all gateway entries first
arrClearGateways = Array()
errGateways = objNetAdapter.SetGateways(arrClearGateways, null)
objNetAdapter.ReleaseDHCPLease
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
If errEnable=0 Then
Set objNetAdapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" & MgmtNIC)
Else
msgbox L_Msg096_Text & vbCrLF & errEnable,vbCritical,L_Msg097_Text
wscript.echo L_Msg096_Text
End If
Case ucase(L_Msg132_Text) 'Set DHCP
wscript.echo
wscript.echo L_Msg098_Text
'clear out all gateway entries first
arrClearGateways = Array()
errGateways = objNetAdapter.SetGateways(arrClearGateways, null)
errEnable = objNetAdapter.EnableDHCP()
objNetAdapter.RenewDHCPLease
If errEnable = 0 Then
Set objNetAdapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" & MgmtNIC)
Else
msgbox L_Msg096_Text,vbCritical,L_Msg097_Text
wscript.echo L_Msg096_Text
End If
Case Else
'Cancel
end Select
Case "2" ' Change DNS
wscript.echo L_Msg099_Text
wscript.echo
wscript.StdOut.Write L_Msg100_Text
DNSServer = wscript.StdIn.ReadLine
strDNSServer=Array(DNSServer)
if DNSServer="" then
'Cancelled
else
'Set Preferred DNS
errDNS = objNetAdapter.SetDNSServerSearchOrder(strDNSServer)
If errDNS=0 Then
'Preferred DNS successfully set, set alternate
msgbox L_Msg101_Text,vbInformation,L_Msg097_Text
wscript.StdOut.Write L_Msg102_Text
altDNSServer = wscript.StdIn.ReadLine
strDNSServer=Array(DNSServer,altDNSServer)
if altDNSServer="" then
'skip entering alternate DNS
else
errDNS = objNetAdapter.SetDNSServerSearchOrder(strDNSServer)
If errDNS=0 Then
'Alternate DNS successfully set
msgbox L_Msg103_Text,vbInformation,L_Msg097_Text
wscript.echo L_Msg103_Text
else
msgbox L_Msg104_Text,vbCritical,L_Msg097_Text
wscript.echo L_Msg104_Text
end If
end if
else
msgbox L_Msg105_Text,vbCritical,L_Msg097_Text
end If
end if
Case "3" ' Remove DNS server settings
'clear out all entries and reset
arrDNSServers = Array()
errDNS = objNetAdapter.SetDNSServerSearchOrder(arrDNSServers)
If errDNS=0 Then
'DNS successfully cleared
msgbox L_Msg106_Text,vbInformation,L_Msg097_Text
wscript.echo L_Msg106_Text
else
msgbox L_Msg107_Text,vbCritical,L_Msg097_Text
wscript.echo L_Msg107_Text
end If
Case "4" ' return to Main Menu
Case else
end Select
Loop Until NIC_option="4" or NIC_option=""
end if
end sub
Sub ConfigureRemoteManagement()
do
wscript.echo
wscript.echo L_Msg072_Text
wscript.echo L_Msg179_Text
wscript.echo L_Msg072_Text
wscript.echo
wscript.echo
wscript.echo
resultGet=oShell.Run("configure-smremoting.exe -get",7,TRUE)
if resultGet=0 or resultGet=2 then
wscript.echo L_Msg210_Text
else
if resultGet=1 or resultGet=3 then
wscript.echo L_Msg211_Text
else
wscript.echo L_Msg212_Text
end if
end if
wscript.echo
wscript.echo L_Msg157_Text ' 1 Enable Remote Management
wscript.echo L_Msg158_Text ' 2 Disable Remote Management
wscript.echo L_Msg188_Text ' 3 Ping
wscript.echo
wscript.echo L_Msg161_Text ' 4 Return
wscript.echo
wscript.StdOut.Write L_Msg056_Text
RemoteOption = Wscript.StdIn.ReadLine
select case RemoteOption
Case "1" ' Enable Remote Management
if resultGet=2 or resultGet=3 then
msgbox L_Msg213_Text,,L_Msg179_Text
else
wscript.echo
wscript.echo L_Msg204_Text
'Enable Remote Management
result=oShell.Run("configure-smremoting.exe -enable",7,TRUE)
if result=0 then
msgbox L_Msg206_Text,,L_Msg179_Text
else
msgbox L_Msg207_Text,,L_Msg179_Text
end if
end if
Case "2" ' Disable Remote Management
if resultGet=2 or resultGet=3 then
msgbox L_Msg213_Text,,L_Msg179_Text
else
wscript.echo
wscript.echo L_Msg205_Text
'Enable Remote Management
result=oShell.Run("configure-smremoting.exe -disable",7,TRUE)
if result=0 then
msgbox L_Msg208_Text,,L_Msg179_Text
else
msgbox L_Msg209_Text,,L_Msg179_Text
end if
end if
Case "3" 'Allow/Disallow Ping
wscript.echo
'Allow Ping?
confirm = msgbox(L_Msg189_Text,VBYesNo,L_Msg179_Text)
if confirm=vbYes then
' Allow Ping
result=oShell.Run("netsh firewall set icmpsetting 8",7,TRUE)
if result=0 then
wscript.echo L_Msg190_Text 'Successfully allow ping
msgbox L_Msg190_Text,,L_Msg179_Text
else
wscript.echo L_Msg175_Text 'Failure
msgbox L_Msg165_Text,vbCritical,L_Msg179_Text
end if
else
'Disallow Ping
result=oShell.Run("netsh firewall set icmpsetting 8 disable",7,TRUE)
if result=0 then
wscript.echo L_Msg191_Text 'Disallow Ping successfully set
msgbox L_Msg191_Text,,L_Msg179_Text
else
wscript.echo L_Msg175_Text 'Failure
msgbox L_Msg165_Text,vbCritical,L_Msg179_Text
end if
end if
Case else
end Select
loop while RemoteOption="1" or RemoteOption="2" or RemoteOption="3"
end sub
sub ChangeComputerName()
Wscript.echo L_Msg034_Text
Wscript.echo
wscript.StdOut.Write L_Msg033_Text
NewComputerName = Wscript.StdIn.ReadLine
if NewComputerName<>"" then
wscript.echo L_Msg035_Text
wscript.echo
InDomain = GetDomainStatus()
if not InDomain then
'In workgroup
result = oShell.Run("netdom renamecomputer %computername% /force /NewName:" & NewComputerName,7,TRUE)
else
'In Domain
wscript.StdOut.Write L_Msg026_Text
domainuser = Wscript.StdIn.ReadLine
result = oShell.Run("netdom renamecomputer %computername% /force /NewName:" & NewComputerName & " /userd:" & domainuser & " /passwordd:*",1,TRUE)
end if
if result=0 then
confirm = msgbox(L_Msg028_Text & vbCRLF & L_Msg029_Text, VBYesNo,L_Msg030_Text)
if confirm=vbYes then oShell.Run "shutdown /r /t 0",1
else
DomainAccessErrorMsg(result)
end if
end if
end sub
sub JoinWorkgroup
group_type= L_Msg023_Text
wscript.StdOut.Write L_Msg125_Text
NewGroupName = Wscript.StdIn.ReadLine
wscript.echo
wscript.echo L_Msg126_Text & NewGroupName & L_Msg127_Text
targetstr = "Wmic computersystem where name=" & chr(34) & "%computername%" & chr(34) & " call joindomainorworkgroup name=" & chr(34) & NewGroupName & chr(34)
returncode = oShell.Run(targetstr,7,TRUE)
if returncode<>0 then
msgbox L_Msg108_Text,VBCritical,L_Msg023_Text
else
msgbox L_Msg109_Text & NewGroupName,vbInformation,L_Msg023_Text
end if
end sub
Sub GetInitialStatusValues()
wscript.echo L_Msg111_Text
wscript.echo
on error resume next
'Determine if Hyper-V Server SKU
HVS_SKU= VerifyHVS()
' Get update settings status
GetUpdateSettings Update_schedule, Update_schedule_descr
Set nics = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration where IPenabled=TRUE")
' Try to select the first NIC with an active IP
if MgmtNIC="" then
DisplayIP = L_Msg001_Text
for each n in nics
MgmtNIC= n.index
Set objNetAdapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" & MgmtNIC)
exit for
next
end if
if MgmtNIC="" then
'Display no active NIC message
DisplayIP = L_Msg003_Text
Msgbox DisplayIP,vbExclamation,L_Msg004_Text
end if
End Sub
function GetCmdLineOutput()
Set objStdOut = objWshScriptExec.StdOut
GetCmdLineOutput = objStdOut.ReadAll
end function
Function CheckStaticIP(ip)
on error resume next
IPstart = left(ip,instr(ip,".")-1)
on error goto 0
if IPstart>=1 and IPstart<224 then
CheckStaticIP=TRUE
else
msgbox L_Msg112_Text,vbCritical,L_Msg097_Text
CheckStaticIP=FALSE
end if
if IPstart=127 then
CheckStaticIP=FALSE
msgbox L_Msg113_Text,vbCritical,L_Msg097_Text
end if
end function
Function IdentifyIPv4(ip)
IdentifyIPv4= TRUE
end function
Function DefaultNetmask(ip)
DefaultNetmask=""
on error resume next
IPstart = left(ip,instr(ip,".")-1)
on error goto 0
if IPstart>=0 and IPstart <127 then
DefaultNetmask="255.0.0.0"
end if
if IPstart>127 and IPstart <224 then
DefaultNetmask="255.255.255.0"
end if
end function
Sub DomainAccessErrorMsg(result)
Select Case result
Case 5 strErrorDescription = L_Msg114_Text
Case 87 strErrorDescription = L_Msg115_Text
Case 110 strErrorDescription = L_Msg116_Text
Case 1323 strErrorDescription = L_Msg117_Text
Case 1326 strErrorDescription = L_Msg118_Text
Case 1355 strErrorDescription = L_Msg119_Text
Case 2224 strErrorDescription = L_Msg120_Text
Case 2691 strErrorDescription = L_Msg121_Text
Case 2692 strErrorDescription = L_Msg122_Text
Case else strErrorDescription = L_Msg123_Text
End Select
msgbox strErrorDescription,vbCritical,L_Msg022_Text
end sub
Function GetDomainStatus()
Set colItems = objWMIService.ExecQuery( "Select * from Win32_ComputerSystem", , 48 )
For Each objItem in colItems
pcname = objItem.Name
strComputerDomain = objItem.Domain
If objItem.PartOfDomain Then
group_type= L_Msg022_Text
groupname= strComputerDomain
GetDomainStatus=TRUE
Else
group_type= L_Msg023_Text
groupname= strComputerDomain
GetDomainStatus=FALSE
End If
Next
end Function
Function VerifyHVS()
on error resume next
OStype = oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionID")
on error goto 0
if Instr(OStype,"ServerHyper") then
VerifyHVS=TRUE
else
VerifyHVS=FALSE
end if
end Function
Sub GetUpdateSettings(ByRef updateSchedule, ByRef updateScheduleDescription)
Dim NoAutoUpdateVal
Dim AUOptions
on error resume next
updateSchedule=""
updateScheduleDescription=""
' If NoAutoUpdate is set then we are set to Manual
NoAutoUpdateVal = 0 ' Default in case reg value is not present
NoAutoUpdateVal = oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate")
if NoAutoUpdateVal = 1 then
updateSchedule = L_Msg048_Text
updateScheduleDescription = L_Msg049_Text
else
'We look at the relevant AUOptions registry entry to determine behaviour
AUOptions = 0 ' Default in case reg value is not present
AUOptions = oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\AUOptions")
Select Case AUOptions
Case 3
updateSchedule = L_Msg219_Text
updateScheduleDescription = L_Msg223_Text
Case 4
updateSchedule = L_Msg045_Text
updateScheduleDescription = L_Msg046_Text
Case Else
updateSchedule = L_Msg220_Text
updateScheduleDescription = L_Msg224_Text
End Select
end if
End Sub
sub AddToAdminGroup()
wscript.echo L_Msg037_Text
Set colAccounts = objWMIService.ExecQuery _
("Select * From Win32_Group Where Domain = '" & pcname & "' AND SID = 'S-1-5-32-544'")
For Each objAccount in colAccounts
admingroupname = objAccount.Name
Next
targetstr= "net localgroup " & admingroupname & " /add " & AddUserAcct
RunShowOutput(targetstr)
end sub
sub RunShowOutput(strCommand)
Set objWshScriptExec = oShell.Exec("cmd /C " & strCommand & " 2>&1")
strStdOut = objWshScriptExec.stdout.readall
msgbox strStdOut,,L_Msg040_Text
Set objWshScriptExec=nothing
end sub
function TelemetryStringForSetting(telemetrySetting)
dim strTelemetryString
select case telemetrySetting
case 0
strTelemetryString = L_Msg226_Text
case 1
strTelemetryString = L_Msg227_Text
case 2
strTelemetryString = L_Msg228_Text
case 3
strTelemetryString = L_Msg229_Text
case else
strTelemetryString = L_Msg215_Text
end select
TelemetryStringForSetting = strTelemetryString
end function
sub CheckTelemetrystatus()
'Check for policy
on error resume next
Telemetry_Value1= oShell.RegRead("HKLM\Software\Policies\Microsoft\Windows\DataCollection\AllowTelemetry")
on error goto 0
if Telemetry_Value1="" then
'Check for local
on error resume next
Telemetry_Value2= oShell.RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\DataCollection\AllowTelemetry")
if Telemetry_Value2="" then Telemetry_Value2=-1
on error goto 0
Telemetry_Status= TelemetryStringForSetting(Telemetry_Value2)
else
Telemetry_Status= TelemetryStringForSetting(Telemetry_Value1)
end if
end sub
sub SetTelemetryValue(telemetryValue)
oShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\DataCollection\AllowTelemetry", telemetryValue, "REG_DWORD"
end sub
sub CheckRemoteManagementStatus()
resultGet=oShell.Run("configure-smremoting.exe -get",0,TRUE)
if resultGet=0 or resultGet=2 then
RemoteManagementStatus= L_Msg145_Text 'Enabled
else
if resultGet=1 or resultGet=3 then
RemoteManagementStatus= L_Msg146_Text 'Disabled
else
RemoteManagementStatus= L_Msg215_Text 'Unknown
end if
end if
end sub
sub DisplayTelemetrydialog()
dim i
dim bSettingDone
dim strOptionSelection
dim telemetryMenuSelection
' Check for GP override
on error resume next
Telemetry_Value1= oShell.RegRead("HKLM\Software\Policies\Microsoft\Windows\DataCollection\AllowTelemetry")
on error goto 0
if HVS_SKU then
'Show Hyper-V Server Telemetry text
confirm = msgbox(L_Msg217_Text & vbCrLf & vbCrLf & L_Msg194_Text & vbCrLf & vbCrLf & L_Msg195_Text & vbCrLf & vbCrLf & L_Msg218_Text & vbCrLf & vbCrLf & L_Msg199_Text,vbYesNo+vbDefaultButton2,L_Msg200_Text )
else
'Show Windows Server Telemetry text
confirm = msgbox(L_Msg193_Text & vbCrLf & vbCrLf & L_Msg194_Text & vbCrLf & vbCrLf & L_Msg195_Text & vbCrLf & vbCrLf & L_Msg196_Text & vbCrLf & vbCrLf & L_Msg199_Text,vbYesNo+vbDefaultButton2,L_Msg200_Text )
end if
if Telemetry_Value1<>"" then
msgbox L_Msg202_Text,,L_Msg200_Text
else
if confirm=vbYes then
' Display choices and read user choice
wscript.echo
wscript.echo L_Msg225_Text
wscript.echo
for i = 0 to TelemetryCountSettings-1
wscript.echo cstr(i+1) & ") " & TelemetryStringForSetting(i)
next
bSettingDone = FALSE
do
wscript.echo
wscript.StdOut.Write L_Msg230_Text 'Enter new telemetry setting (Blank=Cancel):
strOptionSelection = Wscript.StdIn.ReadLine
if strOptionSelection <> "" then
' If a valid selection then change telemetry setting
telemetryMenuSelection = -1
on error resume next
telemetryMenuSelection = cint( strOptionSelection )
on error goto 0
if telemetryMenuSelection <> -1 and telemetryMenuSelection >=1 and telemetryMenuSelection <= TelemetryCountSettings then
' Valid menu selection
' Telemetry values are 0-based
SetTelemetryValue telemetryMenuSelection-1
bSettingDone = TRUE
end if
end if
loop until bSettingDone or strOptionSelection = ""
end if
end if
end sub
Sub ActivateInstall()
do
wscript.echo
wscript.echo L_Msg201_Text
wscript.echo
wscript.echo L_Msg150_Text '1) Display License info
wscript.echo L_Msg151_Text '2) Activate Windows
wscript.echo L_Msg153_Text '3) Install Product key
wscript.echo L_Msg155_Text '4) Exit
wscript.echo
wscript.StdOut.Write L_Msg056_Text 'Enter selection:
OptionSelection = Wscript.StdIn.ReadLine
Select case OptionSelection
Case "1"
'Display License information
oShell.Run ("%ComSpec% /K cscript %windir%\system32\slmgr.vbs /dli")
Case "2"
'Activate Windows
oShell.Run ("%ComSpec% /K cscript %windir%\system32\slmgr.vbs /ato")
Case "3"
'Install Product key
pid= inputbox(L_Msg216_Text, L_Msg216_Text)
if pid <> "" then
oShell.Run ("%ComSpec% /K cscript %windir%\system32\slmgr.vbs /ipk " & pid)
end if
Case else
end select
loop Until OptionSelection="4"
end sub
In Zeile 506 ist der Case 6, welcher dann dieses Updateskript aufruft.. Aber einen Fehler kann ich nciht rauslesen..
Maxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252961
[content:359185#1252961]
Der Fehler passiert ja erst, wenn du die Funktion "6" aufrufst??
Laut dem Script wird unter "6" die Funktion WUA_Script aufgerufen
Wie kommst du darauf, dass das Script .\WUA_SearchDownloadInstall.vbs was damit zu tun hat??
Gruss
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252963
[content:359185#1252963]
Aber über dden sconfig Dialog geht das nicht
Wenn ich die "6" aufrufe, dann öffnet sich das andere Script und schließt sich gleich wieder (also die Konsole)..
Kann das Skript auch nicht bearbeiten, da die Datei immer in Verwendung ist und ich das Programm oder den Dienst, was auf die Datei zugreift, nicht ausfindig machen kann..
Maxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1252969
[content:359185#1252969]
Hast du denn Admin-Rechte??
Gruss
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1253023
[content:359185#1253023]
Auch wenn ich den Notepad als Admin starte geht es nicht.
Maxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1253024
[content:359185#1253024]
maxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1253031
[content:359185#1253031]
Also kann es doch sein, dass es gar kein Fehler ist, wenn sich die Konsole sofort wieder schliesst, weil gar keine Updates zu installieren sind??
Gruss
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1253033
[content:359185#1253033]
Naja nicht wirklich.. Da kommt ja erst die Auswahl ob er nach allen oder nur nach empfohlenen Updates suchen soll.
Und wenn dann keine Verfügbar sind, dann zeigt er das normal an und dann kann man das Fenster wieder schließen.
Maxi
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/update-suchen-nicht-moeglich-mit-sconfig-exe-windows-2016-359185.html#comment-1458688
[content:359185#1458688]
Sconfig lässt sich nicht öffnen oder Sconfig Funktionen können nicht ausgeführt werden
Dies kann an folgendem Liegen: Bei der Installation wird de-CH installiert - dadurch werden alles Scripts so wie auch sconfig in den gewünschten Sprachordner hinterlegt.
Nach dem Login jedoch befindet sich das System in dem en-US verzeichnis, was dazu führt das er sconfig nicht öffnen kann oder die Funktionen die in Sconfig hinterlegt sind nicht ausführen kann.
Weshalb ist das so?
In dem Sconfig script sind hinter den Funktionen die ausgewählt werden können scripts.
Die Pfad angabe für diese scripts ist so definiert das es sich im selben Ordner wie das Sconfig script selber befinden muss. (Deswegen funktioniert es auch nicht wenn nur das Sconfig Script kopiert wird in ein anderes Verzeichniss den dann fehlen die Scripts die Sconfig aufrufen möchte)
Beispiel:
Sconfig wurde kopiert weil es nicht vorhanden war.
Nun lässt sich Sconfig öffnen, so weit so gut. Wenn wir nun jedoch die Funktion nummer 6 "Windows Updates" auslösen passiert scheinbar garnichts.
Dies liegt daran das folgendes in dem Sconfig Script steht: (Zeilen Zusaammengefasst)
Zeile: "6) Updates herunterladen u. installieren " → möchte folgendes ausführen
const WUA_Script = "cscript WUA_SearchDownloadInstall.vbs" → hier sehen wir das keine weiter Pfadangabe vorhanden sit für das Windows Update Suche Script, folgich wird im selben Ordner wie Sconfig gesucht.
Dadurch das dies jedoch kopiert wurde, jedoch nicht das Windows Update Suche Script dazu ist es Sconfig nicht möglich dies zu finden.
Lösung
Es muss die Spracheinstellung des eingeloggten Users angepasst werden
Hierfür muss Powershell geöffnet werden
cmd → powershell eingeben (Powershell wird geöffnet)
Folgender Befehl eingeben: Set-WinDefaultInputMethodOverride -InputTip "0807:00000807" (Hier steht 0807:00000807 für Swiss German)
Set-WinUserLanguageList -LanguageList de-ch, de-DE -Force
Anschliessend einen Neustart des Servers ausführen
Dann Sconfig aufstarten und funktionen testen
Falls es dann immer noch nicht funktionieren sollte Spracheinstellungen erneut prüfen
Wenn dies nach mehrfachen versuchen scheittert zu folgendem Workaround weitergehen
WORKAROUND
Es werden sämmtliche Dateien aus dem Ordner in dem das Sconfig voranden ist ind den Sprach Ordner kopiert mit dem der Benutzer startet. (ACHTUNG! dies wurde von mir noch nicht getestet da die Lösung immer funktioneirt hat.)
cmd → powershell eingeben (Powershell wird geöffnet)
Kopieren Befehel → Copy-Item "C:\Path1\*" -Destination "C:\Path2"
Path1: durch den Pfad ersetzen in dem Sconfig und alle Scrips sich befinden (Dort wo sie installiert wurden, * ist notwendig damit alle Elemente einbezogen werden) → "\windows\system32\de-CH\*"
Path2: Zielordner von wo der eingeloggte Benutzer Sconfig datei ausführen möchte
Der Befehl sollte wie folgt aussehen: Copy-Item "\windows\system32\de-CH\*" -Destination "\windows\system32\en-US\"
Anschliessend einen Neustart des Servers ausführen
Dann Sconfig aufstarten und funktionen testen
Nach nach erfolgreichen Updates ist es zu empfeheln erneut zu versuchen die Spracheinstellungen erneut versuchen anzupassen.