Posted On March 29, 2019

PowerShell: Disable NetBios

kimconnect 0 comments
blog.KimConnect.com >> Codes >> 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 *

Related Post

PowerShell: DHCP Server Scope Options Editing

Occasionally, internal DNS server changes as machines are refreshed and/or decommissioned. DHCP servers should also…

FTP On Upload Email

# Connection details# If your SMTP server does not support SSL, remove the -UseSSL parameter…

LAMPP Passwords Change

Change ProFTP password: vim /opt/lampp/etc/proftpd.conf <?-- delete the last line in password, leave the first…