Summary
Get the various hostnames associated with the host, including the NETBIOS name if the computer is domain joined- Needs Admin: False
- Version: 1
- Author: @its_a_feature_
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the various hostnames associated with the host, including the NETBIOS name if the computer is domain joined
hostname
let output = {};
output['localized'] = ObjC.deepUnwrap($.NSHost.currentHost.localizedName);
output['names'] = ObjC.deepUnwrap($.NSHost.currentHost.names);
let fileManager = $.NSFileManager.defaultManager;
if(fileManager.fileExistsAtPath("/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist")){
let dict = $.NSMutableDictionary.alloc.initWithContentsOfFile("/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist");
let contents = ObjC.deepUnwrap(dict);
output['Local Kerberos Realm'] = contents['LocalKerberosRealm'];
output['NETBIOS Name'] = contents['NetBIOSName'];
output['Server Description'] = contents['ServerDescription'];
}