Thursday, August 21, 2014

DHCP Testing Command

Bring up Command Prompt and run:
netsh dhcp show server

Will receive the following result:
-----------------------------------------------------------------------------------------------
1 Servers were found in the directory service:

        Server [pdcsc.server.com] Address [192.168.100.1] Ds location: cn=pdcs
.server.com

Command completed successfully.
-----------------------------------------------------------------------------------------------

Wednesday, August 20, 2014

Windows 8.1 Set Network to be Private / Public

1. Use Command Prompt and run "secpol.msc"
2. Click on "Network List Manager Policies"
3. Double-click on your network
4. Click on "Tab Network Location"
5. Set "Location Type" to "Private" (or "Public")

Thursday, August 7, 2014

PowerShell - Remote Configure Static/DHCP IP Address

For Static IP:
$sc = {
param($IP)
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled ='true'";
$wmi.EnableStatic($IP, "255.255.255.0");
$wmi.SetGateways("192.168.1.1", 1);
$wmi.SetDNSServerSearchOrder(@("192.168.1.1","8.8.8.8"))
}

$IP = "192.168.1.101"
$job = Invoke-Command 192.168.1.121 -ScriptBlock $sc -ArgumentList $IP -AsJob -Credential $cred
Wait-Job $job -Timeout 20
$IP = "192.168.1.102"
$job = Invoke-Command 192.168.1.122 -ScriptBlock $sc -ArgumentList $IP -AsJob -Credential $cred
Wait-Job $job -Timeout 20



For DHCP IP:
$sc = {
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled ='true'";
$wmi.EnableDHCP();
$wmi.SetDNSServerSearchOrder();
}

$job = Invoke-Command 192.168.1.101 -ScriptBlock $sc -AsJob -Credential $cred
Wait-Job $job -Timeout 20
$job = Invoke-Command 192.168.1.102 -ScriptBlock $sc -AsJob -Credential $cred
Wait-Job $job -Timeout 20