Category: Uncategorized

PS: Connect remote Computer

As remote system to trust

Set-Item wsman:\localhost\client\trustedhosts *

Set-Item wsman:\localhost\client\trustedhosts <System Name/IP>

Connect to remote system with below Command

Enter-PSSession -ComputerName 192.168.10.14 -Credential

 

PS: Set IP and DNS

$wmi = Get-WMIObject Win32_NetworkAdapterConfiguration
Foreach($wmis in $wmi) {
$wmis.EnableStatic(“10.0.0.15”, “255.255.255.0”)
$wmis.SetGateways(“10.0.0.1”, 1)
$wmis.DNSServerSearchOrder
$DNSServers = “198.168.10.14″,”198.168.10.15″
$wmis.SetDNSServerSearchOrder($DNSServers)
$wmis.SetDynamicDNSRegistration(“TRUE”)

}