# Deaktivierung von NetBios auf allen Netwerkkarten und auf definierten Maschinen
$user = “DWP\”+(Read-Host -Prompt ‘Admin Username zur Ausführung: ‘)
$password = Read-Host -Prompt “Wie lautet das Kennwort für $user”
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$pass
$machines=”WIN1909.dwp.local”,”srvsubca.dwp.local”
foreach ($machine in $machines){
Invoke-Command -ComputerName $machine -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(2)
};
}
}