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

Common JavaScript Techniques

Common JavaScript Techniques:1. Demonstate your understanding of they keyword typeofconsole.log(typeof typeof 1);// this follows the…

PowerShell: Manage Remote Desktop Servers by Logging Off Idle Sessions That Have Certain Inactive Programs

# manageRdsSessions.ps1 # Sequence of workflow: # a. Gather active and disconnected sessions on all…

PowerShell: Assign Guest Virtual Machine to a Cloud in VMM

# assignVmsToCloud.ps1 # version 0.02 # The following function assigns a guest VM into a…