Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Disable NIC on remote server in powershell

$
0
0
Hi I have a requirement to disable NIC using powershell remotely. I'm using below command. It works when i hardcode NIC's Name in the command but it is failing when i pass the NIC's Name in variable. Working Fine: [code="other"]Invoke-Command -Computer MYREMOTESERVER {(Disable-NetAdapter –Name "Trunk1" –Confirm:$false)}[/code]Failing: [code="sql"]Invoke-Command -Computer MYREMOTESERVER {(Disable-NetAdapter –Name $NICName –Confirm:$false)}[/code]

Viewing all articles
Browse latest Browse all 467

Trending Articles