# Windows

# 2019 Core



# Remotemanagement

### Remote Management aktivieren

Der Core Server lässt sich über eine Arbeitsstation oder einen anderen Server Remote verwalten. Um auf dem entfernten Server Cmdlets ausführen zu können, muss folgendes vorbereitet werden.

**Die Arbeitsstation/Server bereiten wir wie folgt vor, auf dem Core Server ist nichts weiter zu tun:**   
winrm quickconfig  
winrm set winrm/config/client @{TrustedHosts=”\*”}  
chcp 65001

Enable-NetFirewallRule -DisplayGroup "Windows Remote Management" / Nicht sicher ob man dies braucht. Zuerst mit den unteren Befehlen testen

<div class="CodeMirrorContainer" contenteditable="false" data-lang="prettyprint prettyprinted" dir="ltr" id="bkmrk-%23-enable-windows-fir"><textarea style="display: none;">\# Enable Windows Firewall Remote Management Set-NetFirewallRule –Name “RemoteFwAdmin-In-TCP” –Enabled True Set-NetFirewallRule –Name “RemoteFwAdmin-RPCSS-In-TCP” –Enabled True</textarea><div class="CodeMirror cm-s-darcula"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5px; left: 35px;"><textarea autocapitalize="off" autocorrect="off" readonly="readonly" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" tabindex="-1"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true" tabindex="-1"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 30px; margin-bottom: -15px; border-right-width: 35px; min-height: 50px; min-width: 455.641px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>3</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 14px;"></div></div><div class="CodeMirror-code" role="presentation"><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">1</div></div>```
<span role="presentation" style="padding-right: 0.1px;">#  Enable Windows Firewall Remote Management</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">2</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Set-NetFirewallRule –Name “RemoteFwAdmin-In-TCP” –Enabled True</span>
```

</div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -30px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 21px;">3</div></div>```
<span role="presentation" style="padding-right: 0.1px;">Set-NetFirewallRule –Name “RemoteFwAdmin-RPCSS-In-TCP” –Enabled True</span>
```

</div></div></div></div></div></div><div style="position: absolute; height: 35px; width: 1px; border-bottom: 0px solid transparent; top: 50px;"></div><div class="CodeMirror-gutters" style="height: 85px; left: 0px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div></div></div></div></div>cmdkey /add:192.168.0.70 /user:Administrator -&gt; mal als Info gespeichert

# Firewall

Windows Firewall offers three firewall profiles:<span class="ezoic-adpicker-ad" id="bkmrk-"></span>

- **Domain profile**: applies to networks where the host system can authenticate to a domain controller.
- **Private profile**: a user-assigned profile and is used to designate private or home networks.
- **Public profile**: this is the default profile. It is used to designate public networks such as Wi-Fi hotspots at coffee shops, airports, and other locations.

## <span class="ez-toc-section" id="bkmrk--0"></span>Get status of the Windows Firewall with PowerShell

First, let’s get the current status of the Windows Firewall. We will be using the [Get-NetFirewallProfile](https://docs.microsoft.com/en-us/powershell/module/netsecurity/get-netfirewallprofile?view=win10-ps) cmdlet.

<div id="bkmrk-ps-c%3A%5C%3E-get-netfirew">```powershell
<span class="token function">PS</span> C:\> Get<span class="token operator">-</span>NetFirewallProfile <span class="token punctuation">|</span> <span class="token function">Format-Table</span> Name<span class="token punctuation">,</span> Enabled

Name    Enabled
<span class="token operator">--</span>-<span class="token operator">-</span>    <span class="token operator">--</span>-<span class="token operator">--</span>-<span class="token operator">-</span>
Domain     True
Private    True
Public     True
```

<div><div><button type="button">Copy</button></div></div></div>We have **three profiles**: Domain, Name, and Public. Windows Firewall is enabled on all three profiles.

## Disable Windows Firewall in Windows Server 2012/2016/2019

Disable Windows Firewall on all three profiles.

<div id="bkmrk-ps-c%3A%5C%3E-set-netfirew">```powershell
<span class="token function">PS</span> C:\> <span class="token function">Set</span><span class="token operator">-</span>NetFirewallProfile <span class="token operator">-</span>Profile Domain<span class="token punctuation">,</span> Public<span class="token punctuation">,</span> Private <span class="token operator">-</span>Enabled False
```

<div><div><button type="button">Copy</button></div></div></div>## <span class="ez-toc-section" id="bkmrk--1"></span>Check Windows Firewall status

Check the status after you disable the Firewall on all three profiles. Run the **Get-NetFirewallProfile** cmdlet.<span class="ezoic-adpicker-ad" id="bkmrk--2"></span>

<div id="bkmrk-ps-c%3A%5C%3E-get-netfirew-0">```powershell
<span class="token function">PS</span> C:\> Get<span class="token operator">-</span>NetFirewallProfile <span class="token punctuation">|</span> <span class="token function">Format-Table</span> Name<span class="token punctuation">,</span> Enabled

Name    Enabled
<span class="token operator">--</span>-<span class="token operator">-</span>    <span class="token operator">--</span>-<span class="token operator">--</span>-<span class="token operator">-</span>
Domain    False
Private   False
Public    False
```

</div>

# Firewall - 2

There are actually a whole series of groups that you need to look at for remote administration, depending upon what you want to remotely manage. The name of the firewall group is Windows Firewall Remote Management.

You can find the names of the individual rules, if you want to ensure you just enable the specific ones you want, by issuing the following command:

Get-NetFirewallRule | Where { $\_.DisplayGroup –Eq “firewall group”} | Format-Table  
Replace firewall group with with the appropriate managment group. The ones that relate to remote management are:

group="File and Printer Sharing"

group="Remote Service Management"

group="Performance Logs and Alerts"

group="Remote Event Log Management"

group="Remote Scheduled Tasks Management"

group="Remote Volume Management"

group="Remote Desktop"

group="Windows Firewall Remote Management"

group="windows management instrumentation (wmi)"

# OneSyncSvc

<header class="entry-header" id="bkmrk-synchronisierungshos">##### Synchronisierungshost\_xxxx (OneSyncSvc) läuft nicht auf Windows Server 2016

Für die viele Server ist der OneSyncSvc nicht von Bedeutung und kann abgeschaltet werden. Das kann man leider nicht im Dienste Panel. Dort kommt eine Fehlermeldung. Man kann es aber mit regedit machen oder mit dem cmd.</header>cmd als Admininistrator öffenen (im Beispiel gleich auch noch für diesen Karten Download dienst „MapsBrocker“

sc stop “MapsBroker”  
sc stop "OneSyncSvc"  
sc config “MapsBroker” start= disabled  
sc config "OneSyncSvc" start= disabled

<span style="text-decoration: underline;">*oder*</span>

Now, here is the tutorial.

1. Press **Windows** and **R** keys together to open the **Run** dialog.
2. Type **regedit** in the box and click **OK** to continue.
3. the Registry Editor window, navigate to the following path: **HKEY\_LOCAL\_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\OneSyncSvc**
4. In the right pane, select the **Start** key and double-click it.
5. Then change its value data from 2 to 4.
6. Then restart your computer to make the changes effect.

## Restore Startup Configuration for Sync Host

In this section, we will show you how to restore the startup configuration for Sync Host.

Now, here is the tutorial.

1\. [Open Command Prompt as administrator](https://www.partitionwizard.com/partitionmanager/command-prompt-win10-005.html).

2\. In the command line window, type the following commands and hit **Enter** after each command to continue.

**sc config OneSyncSvc start= auto  
sc start OneSyncSvc**

3\. Then close the command line window.

# Linux Subsystem



# Installationslink

[Installieren des Linux-Subsystems unter Windows Server | Microsoft Docs](https://docs.microsoft.com/de-de/windows/wsl/install-on-server)

  
https://docs.microsoft.com/de-de/windows/wsl/install-on-server

# CleanUP

[https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/clean-up-the-winsxs-folder?view=windows-11](https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/clean-up-the-winsxs-folder?view=windows-11)

Dism.exe /online /Cleanup-Image /SPSuperseded

Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

Dism.exe /online /Cleanup-Image /StartComponentCleanup

schtasks.exe /Run /TN "\\Microsoft\\Windows\\Servicing\\StartComponentCleanup"

# Batch



# DateTime

@echo off  
@echo off  
rem Get the time from WMI - at least that's a format we can work with  
set X=  
for /f "skip=1 delims=" %%x in ('wmic os get localdatetime') do if not defined X set X=%%x  
rem echo.%X%

rem dissect into parts  
set DATE.YEAR=%X:~0,4%  
set DATE.MONTH=%X:~4,2%  
set DATE.DAY=%X:~6,2%  
set DATE.HOUR=%X:~8,2%  
set DATE.MINUTE=%X:~10,2%  
set DATE.SECOND=%X:~12,2%  
set DATE.FRACTIONS=%X:~15,6%  
set DATE.OFFSET=%X:~21,4%

rem echo %DATE.YEAR%-%DATE.MONTH%-%DATE.DAY% %DATE.HOUR%:%DATE.MINUTE%:%DATE.SECOND%.%DATE.FRACTIONS%  
  
set dateString=J%DATE.YEAR%\_M%DATE.MONTH%\_T%DATE.DAY%

set backuplog=c:\\scripts\\logs\\backup\_%datestring%.log  
set timeString=%DATE.HOUR%:%DATE.MINUTE%:%DATE.SECOND%

\------------------------------------------------------------------------------------------------------------------

set hour=%time:~0,2%  
set minute=%time:~3,2%

set year=%date:~6,4%  
set month=%date:~3,2%  
set day=%date:~0,2%

# Passwort ändern

Change Password

C:\\Windows\\explorer.exe shell:::{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}

# Systems



# Portforwarding

Ein Portforwarding kann unter Windows mit Bordmitteln eingerichtet werden. Dieser Beitrag zeigt wie es geht.

Ein Portforwarding kann unter Windows mit Bordmitteln schnell eingerichtet werden – auch wenn man immer wieder glaubt, auf fremde Tools zurückgreifen zu müssen. Hierzu einfach nachfolgenden Befehl ausführen – und natürlich die korrekten Ports und IP-Adressen eintragen:

```
netsh interface portproxy add v4tov4 listenport=81 listenaddress=10.10.10.10 connectport=8181 connectaddress=192.168.0.2

```

Das Portforwarding kann folgendermaßen aufgehoben werden:

```
netsh interface portproxy delete v4tov4 listenport=81 listenaddress=10.10.10.10

```

So schnell und einfach geht das.

# Neue Seite

The command syntax is as follows:

`netsh interface portproxy add v4tov4 listenaddress=localaddress listenport=localport connectaddress=destaddress connectport=destport`

where

<div id="bkmrk-">  
</div>- **listenaddress** –is a local IP address to listen for incoming connection (useful if you have multiple NICs in different subnets/[VLANs](http://woshub.com/configure-multiple-vlan-on-windows/) or [multiple IP addresses on one interface](http://woshub.com/assign-multiple-ip-addresses-single-nic-windows/));
- **listenport** – a local TCP port number to listen on (the connection is waiting on);
- **connectaddress** – is a local or remote IP address (or DNS name) to which you want to redirect the incoming connection;
- **connectport** – is a TCP port to which the connection from `listenport` is forwarded to.

<div class="info_box" id="bkmrk-using-the%C2%A0netsh-inte">Using the `netsh interface portproxy add` `v4tov6`/`v6tov4`/`v6tov6` options, you can create port forwarding rules between IPv4 and IPv6 a</div><div class="info_box" id="bkmrk--1"></div>`netstat -na|find "3340"`

Alternatively, you can check that the port is not listening locally using [the PowerShell cmdlet Test-NetConnection](http://woshub.com/checking-tcp-port-response-using-powershell/):

`Test-NetConnection -ComputerName localhost -Port 3340`

``

# diskpart



# Befehle

### 1. Partition löschen

Zuerst werde ich Ihnen zeigen, wie Sie eine Partition löschen. Die Schritte sind wie folgt.

- Öffnen Sie das Fenster von Diskpart.
- Geben Sie ***list disk*** (*Der Befehl wird alle Festplatten auf Ihrem Computer auflisten*)
- Dann sollten Sie den Datenträger auswählen, der die zu löschende Partition enthält. Deshalb geben Sie in diesem Schritt ***select disk 1*** (*„1“ sollten nach Ihrem Bedürfnis verschieden sein*)
- Geben Sie ***list partition*** ein, damit alle Partitionen auf dem Datenträger angezeigt werden.
- Geben Sie ***select partition X*** (*„X“ sollte die Nummer der Partition sein, die gelöscht wird*)
- Geben Sie danach ***delete Partition*** ein, damit die Partition gelöscht wird.
- Zum Schluss geben Sie ***exit*** ein, um das Fenster zu schließen.

### 2. Partition formatieren

Nachdem wir den Befehl zum Löschen der Partition gesehen haben, schauen wir uns jetzt das Formatieren der Partition an.

Die Schritte sind wie unten gezeigt.

- Diskpart aufrufen
- list disk
- select disk 1
- list partition
- ***format fs=ntfs quick***

### 3. Datenträger bereinigen

Wenn Sie einen Datenträger nicht benötigen und es darauf viele Partitionen gibt und Sie sie nicht nacheinander löschen möchten, können Sie diesen Befehl in Diskpart verwenden, um die Aufgabe leicht zu erledigen.

Die Schritte sind wie folgt gezeigt.

- list disk
- select disk 1
- ***clean***

### 4. Partition erstellen

Nachdem Sie erfahren haben, wie Sie mit Diskpart Partition oder Datenträger löschen können, zeige ich Ihnen jetzt, wie Sie eine Partition mit Diskpart erstellen können.

Die Schritte sind wie folgt gezeigt.

- list disk
- select disk 1
- ***create partition primary***

### 5. Partition erweitern

So erweitern Sie eine Partition mit Hilfe von Diskpart.

- list disk
- select disk 1
- list partition
- select partition 2
- ***extend***

### 6. Partition verkleinern

So verkleinern Sie eine Partition mit Hilfe von Diskpart.

- list disk
- select disk 1
- list partition
- select partition 2
- ***shrink***

### 7. Datenträger konvertieren

So konvertieren Sie Datenträger in GPT- oder MBR-Datenträger.

- list disk
- select disk 1
- clean
- **convert mbr** oder **convert gpt**

## Eine zuverlässige Alternativ zu Diskpart

[*MiniTool Partition Wizard*](https://de.minitool.com/partition-manager/), ein zuverlässiger Partition-Manager, wurde von MiniTool Software Ltd. entwickelt. Es gibt so viele Funktionen zur Verwaltung Ihres Datenträgers. Die oben erwähnten 7 Operationen: ***Partition löschen, Partition formatieren, Datenträger bereinigen, Partition erstellen, Partition erweitern, Partition verkleinern*** und ***Datenträger konvertieren***, können leicht in Partition Wizard erledigt werden.

# Key auslesen

wmic path softwarelicensingservice get OA3xOriginalProductKey