Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Changing TCP to dynamic using PowerShell

$
0
0

That's my code and I'm having difficulties making it work. It does not change my adapter settings.

#DHCP Function To Enable DCHP On The Local Computer
###############################################################

Function DHCP

{
$Adapt = Get-WMIObject Win32_NetworkAdapterConfiguration | Where {$_.IPenable -eq "True"} |`
Foreach-Object {$_.EnableDHCP();$_.SetDNSServersearchobject()}
Write-Host "Rebooting Now"
Start-Sleep -s 5
Restart-Computer
}


Viewing all articles
Browse latest Browse all 13067

Trending Articles