################## Windows Management ################## :Author: Dimitry Dukhovny .. contents:: Networking ========== Also see `networking with Powershell `_. Get IP address -------------- Look for the interface alias in quotes in the output, such as **Ethernet 4**. .. code-block:: dosbatch :linenos: REM this just fetches the interface info ipconfig /all .. code-block:: dosbatch :linenos: REM this gets you full information in a cleaner way netsh interface ipv4 show config Set the new IP address ---------------------- For this example, we will assign **192.168.100.100** in our **/24** to the interface alias **Ethernet 4** with a default gateway of **192.168.100.254**. Our domain controllers in this example serve DNS and are at **192.168.100.1** and **192.168.100.2**. .. code-block:: dosbatch :linenos: netsh interface ipv4 set address name="Ethernet 4" static 192.168.100.100 255.255.255.0 192.168.100.254 netsh interface ipv4 set dns name="Ethernet 4" static 192.168.100.1 index=1 netsh interface ipv4 set dns name="Ethernet 4" static 192.168.100.2 index=2 Patches and Updates =================== Find which patches require a reboot ----------------------------------- This safely returns an error if nothing requires a reboot. .. code-block:: dosbatch :linenos: reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\AutoUpdate\RebootRequired Booting ======= Dual booting ------------ .. code-block:: dosbatch :linenos: bcdedit /set {bootmgr} path \EFI\centos\shim.efi .. Reboot immediately ------------------ .. code-block:: dosbatch :linenos: shutdown /r /t 0 .. Safe boot --------- .. code-block:: dosbatch :linenos: bcdedit /set {current} safeboot networkbcdedit /set {current} safeboot network .. Create a user ============= .. code-block:: dosbatch :linenos: net user MyCleverUserName MySpecialPassword /add .. Delete a user ============= .. code-block:: dosbatch :linenos: net user MyCleverUserName /delete .. Make a user an admin ==================== .. code-block:: dosbatch :linenos: net localgroup administrators MyCleverUserName /add .. Change a password ================= .. code-block:: dosbatch :linenos: net user MyCleverUserName MySpecialPassword .. Hide a user from the login screen ================================= .. code-block:: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts" reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v MyCleverUserName /t REG_DWORD /d 1 REM This next bit looks stupid. It is. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v MyCleverUserName /t REG_DWORD /d 0 .. Enable fast user switching ========================== .. code-block:: dosbatch :linenos: reg set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v dontdisplaylastusername /t REG_DWORD /d 1 reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v HideFastUserSwitching /t REG_DWORD /d "0" .. Removing Garbage ================ Uninstall Xbox Toys ------------------- .. code-block:: powershell :linenos: Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage ..