Posted on 09-15-2016 02:42 PM
I am very new to managing apple computer, or even using them for that matter. We are running 32 IMAC's on a windows domain. I am still learning how to use Casper and have re imaged from an external hard drive. Until i learn Casper better its what I know how to do. The problem is my computers that I have imaged have lost their Binding with the domain every 30 days. I have noticed that All of the IMACs have the same NetBIOS name and I cant get them to change. Does anyone know how to fix this or if it's even the cause of the problem?
Posted on 09-15-2016 02:58 PM
/usr/bin/defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName will tell you what the name is.
sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName NAMEYOUWANT will set it.
Not sure if you're familiar with scutil to set the HostName/LocalHostName/ComputerName...
/usr/sbin/scutil --get LocalHostName
sudo /usr/sbin/scutil --set LocalHostName NameYouWant
Then you could use:
sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist NetBIOSName $(/usr/sbin/scutil --get LocalHostName)
Posted on 06-30-2022 09:35 AM
Oddly having NetBIOSName issues even though our network guys tell us that NetBIOS isn't an issue, yet security is asking us about weird named computers that we don't have listed having. THIS ^^^ worked!!! Thank you Robert!
Posted on 09-15-2016 03:03 PM
Thanks I'll try it out
Posted on 09-16-2016 06:11 AM
A little clarification - there are three "names" applied to Macintosh OSX computers.
Using the command "scutil", they are defined as: HostName = the Unix name for the device (under Server, this should be a fully qualified domain name) ComputerName = the Mac OS name for the device (the name broadcast on the network) LocalHostName = the "zeroconf" network name for the device (a.k.a. - Apple's "Bonjour" protocol)
The JSS uses the ComputerName for most of its operations. This is also the source of the Active Directory NetBIOSName (usually reduced to all lower case during binding). Should be limited to 15 standard ASCII characters if joining Active Directory.
If you use the "scutil" command to rename the device, you should sett ALL three names to the same value.
The Mac OS tends to link the LocalHostName to the ComputerName if you change the ComputerName in System Preferences:Sharing.
Posted on 09-16-2016 09:54 AM
I can the commands and it did change the NetBios name but after rebooting it reverted back to what it was before I changed it.
I used:
/usr/bin/defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server
sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName NAMEYOUWANT
and then I even tried:
sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist NetBIOSName $(/usr/sbin/scutil --get LocalHostName)
And both had the same results, They appeared to work but the after reboot they changed back.
Posted on 09-16-2016 12:48 PM
@ciretruk
If you have an "Update Inventory" policy make sure your Maintenance payload doesn't have the "Reset Computer Names" checked. This can cause your computer names to get reverted back at specific times depending on the frequency you run the policy.
Just something to check
Chuck
Posted on 09-16-2016 01:24 PM
Thanks Chuck,
I checked and no "reset computer names" was not checked.
Posted on 09-22-2016 12:58 PM
Perhaps you should try this:
Unbind from Active Directory
Run the following terminal commands on the target computer: sudo /usr/sbin/scutil --set HostName NameYouWant sudo /usr/sbin/scutil --set LocalHostName NameYouWant sudo /usr/sbin/scutil --set ComputerName NameYouWant
Restart the computer and verify the name has been retained using the "scutil --get" command.
Recon the computer using Casper Suite:Recon; or "sudo jamf recon"
Re-bind the computer to Active Directory.
Posted on 02-22-2021 08:10 AM
The NetBios name will revert to whatever it is getting from a PTR record even if the LocalHostName is changed using scutil. This is probably a bug, but unfortunately that means DDNS used by Windows machines can mess up NETBIOS advertisements on Mac. Particularly if a VPN connection is involved since macOS doesn't seem to register the IP address over DCE/RPC properly so you can't fix this by binding to the domain. You basically end up with the Mac advertising a stale DDNS record for another machine. I haven't found a way around this.
Posted on 12-22-2021 07:28 AM
This is what I observed as well. We used a fairly agressive policy to update netbios names from all configurations files and they keep resetting. Even if we update them on the computers manually.
Did you figure out a different solution ?
Thanks
Posted on 02-22-2021 08:15 AM
Thanks eclemens, That worked out perfectly for me