Disable NetBIOS using SCCM Configuration Items/Baselines

Posted on

A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing context, a stack is an ordered pile. A server stack is one type of solution stack — an ordered selection of software that makes it possible to complete a particular task. Like in this post about Disable NetBIOS using SCCM Configuration Items/Baselines was one problem in server stack that need for a solution. Below are some tips in manage your windows server when you find problem about windows, powershell, sccm, system-center, .

I’m trying to disable NetBIOS and need to do this over SCCM to multiple clients.

I am trying to do this through compliance settings and have the following in place (and they work when run locally)

Discovery Script

$adapter=(gwmi win32_networkadapterconfiguration | where {$_.ipenabled -eq "1"})
Foreach ($nic in $adapter) {if ($adapter.TcpIPNetBiosOptions -ne "2") {[System.Environment]::Exit(1)}} [System.Environment]::Exit(0)

Remediation script

$adapter=(gwmi win32_networkadapterconfiguration | where {$_.ipenabled -eq "1"})
Foreach ($nic in $adapter) {
$adapter.settcpipnetbios(2)
}

So running the script works on each machine locally and, if already compliant, SCCM is giving correct response

BUT

If the registry values returns as $adapter.TcpIPNetBiosOptions -ne “2” then the configuration compliance shows “error” when evaluated in Configuration Manager and the remediation does not trigger automatically. If I run the script myself then the configuration returns as compliant.

Is there something which I am missing?

Edit I see the following error being reported

Setting Discovery Error 0x80070001 Incorrect function. Windows

$adapter.settcpipnetbios(2)

should be

$nic.settcpipnetbios(2)

Otherwise there would be no reason for the foreach loop.

Leave a Reply

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