0

I have a Windows GPO that runs a batch file startup script to disable NetBIOS. It normally looks like this:

wmic nicconfig where (TcpipNetbiosOptions!=null and TcpipNetbiosOptions!=2) call SetTcpipNetbios 2

However, I just found out that I have one particular computer that needs NetBIOS enabled. I didn't want to make an entire new GPO for this one machine and I also wasn't sure if it would override the other one, which is global. Excuse my Pseudo-code, but How can I make it so this command will only execute if the computers IP is not a certain one?

IF(<This IP Address> != 192.168.1.1)
wmic nicconfig where (TcpipNetbiosOptions!=null and TcpipNetbiosOptions!=2) call SetTcpipNetbios 2

Or is there a better idea?

TheFrack
  • 289

1 Answers1

1

Would the computer's hostname be sufficient, instead of IP Address?

IF %COMPUTERNAME% NEQ NetBIOSPC (wmic nicconfig where (TcpipNetbiosOptions!=null and TcpipNetbiosOptions!=2) call SetTcpipNetbios 2)

Obviously, replace NetBIOSPC with the actual hostname of the system. Be sure you're using the right hostname by typing hostname or echo %COMPUTERNAME% at the local CMD prompt on the target system.

Iszi
  • 14,163