Windows Management¶
- Author:
Dimitry Dukhovny
Networking¶
Also see networking with Powershell.
Get IP address¶
Look for the interface alias in quotes in the output, such as Ethernet 4.
1REM this just fetches the interface info
2ipconfig /all
1REM this gets you full information in a cleaner way
2netsh 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.
1netsh interface ipv4 set address name="Ethernet 4" static 192.168.100.100 255.255.255.0 192.168.100.254
2netsh interface ipv4 set dns name="Ethernet 4" static 192.168.100.1 index=1
3netsh 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.
1reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\AutoUpdate\RebootRequired
Booting¶
Dual booting¶
1bcdedit /set {bootmgr} path \EFI\centos\shim.efi
Reboot immediately¶
1shutdown /r /t 0
Safe boot¶
1bcdedit /set {current} safeboot networkbcdedit /set {current} safeboot network
Create a user¶
1net user MyCleverUserName MySpecialPassword /add
Delete a user¶
1net user MyCleverUserName /delete
Make a user an admin¶
1net localgroup administrators MyCleverUserName /add
Change a password¶
1net user MyCleverUserName MySpecialPassword
Hide a user from the login screen¶
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¶
1reg set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v dontdisplaylastusername /t REG_DWORD /d 1
2reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v HideFastUserSwitching /t REG_DWORD /d "0"
Removing Garbage¶
Uninstall Xbox Toys¶
1Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage