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
should be
Otherwise there would be no reason for the
foreach
loop.