Domain Setup from Scratch on Server Core

From Lucca's Wiki
Jump to navigationJump to search

Set your static IP

Get-NetAdapter
Get-NetAdapter -Name 'NAMEFROMPREVIOUSCOMMAND' | New-NetIPAddress -IPAddress {DESIRED-IP} -DefaultGateway {Desired-DefaultGW} -PrefixLength {SUBNET-MASK-CIDR}

Set your hostname

Rename-Computer

Install the domain controller services

Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools

Make this PC a domain controller. The "Safe Mode Administrator password" is the same as the regular administrator password that is set when first booting the pc.

Install-ADDSForest -DomainName mario.corp -ForestMode default -DomainMode default -DomainNetbiosName mariocorp -InstallDns:$true

Setup the DHCP Server: Microsoft-kb Resource

Install-WindowsFeature DHCP -IncludeManagementTools
Add-DhcpServerv4Scope -StartRange 10.0.69.40 -EndRange 10.0.69.250 -SubnetMask 255.255.255.0 -Name mario-dhcp
Set-DhcpServerv4OptionValue -ScopeId 10.0.69.0 -DnsServer 10.0.69.2 -Router 10.0.69.1 -DnsDomain 'mario.corp'





========quality of life tweaks below=======[edit]



VIM Text Editor:


mkdir vim-install; cd vim-install; $ProgressPreference = 'SilentlyContinue'; Invoke-Webrequest -UseBasicParsing https://github.com/vim/vim-win32-installer/releases/download/v9.1.0/gvim_9.1.0_x86_signed.zip -o gvim.zip; Expand-Archive -Path gvim.zip -DestinationPath .; cp .\vim\vim91\vim.exe C:\windows\system32\vim.exe



SSH Service:


Install the openssh server

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Start the sshd service

Start-Service sshd

Make it autostart

Set-Service -Name sshd -StartupType 'Automatic'

[config file is in C:\ProgramData\ssh\sshd_config]