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: Disable Annoying Windows Updates Notifications

This little snippet would render these notices as void. # This snippet is to add…

Repair Windows Server 2016 Error 0x800f081f

Run this function in PowerShell as Administrator: function resetWindowsUpdate{ # Source: https://learn.microsoft.com/en-us/troubleshoot/windows-client/installing-updates-features-roles/additional-resources-for-windows-update write-host 'Resetting Windows…

PowerShell: How to Play a Sound

$soundFile="C:\Windows\media\tada.wav"$sound = new-Object System.Media.SoundPlayer$sound.SoundLocation=$soundFile$sound.Play()