Disable NetBIOS using SCCM Configuration Items/Baselines

0

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

windows
powershell
sccm
system-center
asked on Server Fault Feb 26, 2018 by user001 • edited Feb 26, 2018 by user001

1 Answer

1
$adapter.settcpipnetbios(2)

should be

$nic.settcpipnetbios(2)

Otherwise there would be no reason for the foreach loop.

answered on Server Fault Jun 20, 2018 by Jimmy • edited Jun 23, 2018 by chicks

User contributions licensed under CC BY-SA 3.0