PowerShell: Disable NetBios

# Set Credentials
$username = "KIMCONNECT\"+(Read-Host -Prompt 'Input the Admin Username: ')
$password = Read-Host -Prompt "Input the password for account $username"
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$pass 

$computers="SERVER1"

foreach ($computer in $computers){
Invoke-Command -ComputerName $computer -Credential $cred -ScriptBlock {

$adapters=(Get-WmiObject Win32_NetworkAdapterConfiguration)
# $adapters=(Get-WmiObject Win32_NetworkAdapterConfiguration | Where Description -like "*Ethernet*")
Foreach ($adapter in $adapters){
  Write-Host $adapter
  $adapter.settcpipnetbios(0)
    };

}
}

Leave a Reply

Your email address will not be published. Required fields are marked *