Skip to content
Snippets Groups Projects
Commit b9983a9f authored by Martin Čuchran's avatar Martin Čuchran
Browse files

server-init eddited

parent a365f01b
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,12 @@
$ErrorActionPreference = 'Stop';
$ip = [int]$env:computername.split('-')[2]+2;
$adapter = Get-NetAdapter;
$adapter | New-NetIPAddress -AddressFamily 'IPv4' -IPAddress "10.0.0.$($ip)" -PrefixLength '8' -DefaultGateway '10.0.0.1';
$adapter | Set-DnsClientServerAddress -ServerAddresses '147.251.4.33';
$ip = [int]$env:computername.split('-')[2];
$adapter = Get-NetAdapter | sort name;
$adapter[0] | New-NetIPAddress -AddressFamily 'IPv4' -IPAddress "192.168.1.$($ip)" -PrefixLength '16' -DefaultGateway '192.168.0.1';
$adapter[0] | Set-DnsClientServerAddress -ServerAddresses '147.251.4.33';
$adapter[1] | New-NetIPAddress -AddressFamily 'IPv4' -IPAddress "10.0.1.$($ip)" -PrefixLength '16';
$adapter[1] | Set-DnsClientServerAddress -ServerAddresses '147.251.4.33';
$user = [ADSI]'WinNT://./Administrator';
$user.SetPassword('Password.1');
NET USER pv176 Password.1 /add;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment