Windows 2012 Core
December 10, 2016 — 0:04

Author: silver  Category: windows  Comments: Off

PS = Run in Powershell

System config:

sconfig
netdomf

slmgr.vbs /skms kms.domain.local:1688

wmic product
wmic softwarefeature list brief

# PS:
wmi Win32_SoftwareFeature | Select ProductName, Caption, Version | ft *
# change name
Rename-Computer
# remove from domain & reboot
Remove-Computer -credential domain\account -passthru -verbose -force
Restart-Computer

Diskpart:

list disk
select disk X

If disk is set as read-only, first run:
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' | ft -autosize  Name, Enabled
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
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







We use Matomo free and open source web analytics
We also use Jetpack WordPress.com Stats which honors DNT