revlis.nl
Stash of notes about OSS, OSes, virtualization, dev hobby projects &c
December 10, 2016 — 0:04
Author: silver Category: windows Comments: Off
PS = Run in Powershell
System config:
sconfig
netdomf
wmic product
WMIC SOFTWAREFEATURE LIST BRIEF
PS:
wmi Win32_SoftwareFeature|Select ProductName,Caption,Version|FT *
PS:
Rename-Computer
PS:
Remove-Computer -credential domain\account -passthru -verbose -force; restart-computer
slmgr.vbs /skms kms.domain.local:1688
Diskpart:
list disk
select disk X
(attributes disk clear readonly)
create partition primary
(or size = )
select partition X
format fs=ntfs quick
assign
list volume
select volume X
remove letter=D
assign letter=L
Network:
PS
Get-NetIPInterface New-NetIPAddress -InterfaceIndex 12 -IPAddress 192.0.2.2 -PrefixLength 24 -DefaultGateway 192.0.2.1 Set-DNSClientServerAddress -InterfaceIndex 12 -ServerAddresses 192.0.2.4,192.0.2.5
netsh interface ip set address name="Local Area Connection" static 10.94.45.213 255.255.255.224 10.94.45.193
Firewall:
netsh advfirewall set allprofiles state off
netsh advfirewall set allprofiles state on
RDP:
PS
Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" Get-netfirewallrule -DisplayGroup "Remote Desktop" | format-table Name, Enabled -autosize New-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 -PropertyType dword New-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1 -PropertyType dword</del> Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1 Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Task Scheduler:
schtasks /create /tn "Task Name" /tr "D:\Dir\file.exe" /ru DOMAIN\user /rp /sc daily /st 03:30` schtasks /change /tn "Task Name" /ru DOMAIN\user schtasks /delete /tn "Task Name" schtasks /run /tn "Task Name" /i schtasks /query /fo table /nh schtasks /query /tn "Task Name" /fo list /v
Telnet:
PS:
Import-Module servermanager Add-WindowsFeature telnet-client
TS Share:
PS:
cd \\tsclient\c