Connect to Server Name

When connecting to a server from Mac OS X, what name will your system use when you bring up the Connect to Server dialog box? By default it shows the full name of the user authenticated to a client computer. But, not everyone wants this behavior. Therefore, you can change it by altering the /Library/Preferences/com.apple.NetworkAuthorization.plist file.

The first thing you can do is add a key called UseDefaultName, which will tell the system to use a static value to populate the user field. That static value is then put into a string for Default Name. To make the UseDefaultName field true:

defaults write /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName -bool YES

To then set the string for that default name field:

defaults write /Library/Preferences/com.apple.NetworkAuthorization DefaultName “Charles”

Or if you wanted nothing to default into the field, you’d leave it static but give it nothing to put into the field (you do still need the key there though, so don’t skip this step):

defaults write /Library/Preferences/com.apple.NetworkAuthorization DefaultName “”

To have the field populated with the short name instead of long name, you would change UseDefaultName back to NO (after all, it isn’t a static setting, the short name):

defaults write /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName -bool NO

And you would then add a key for UseShortName and set it to true:

defaults write /Library/Preferences/com.ap
ple.NetworkAuthorization UseShortName -bool YES

Or, if you wanted to To change everything back, just delete the keys we created earlier:

defaults delete /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName

defaults delete /Library/Preferences/com.apple.NetworkAuthorization UseShortName

defaults delete /Library/Preferences/com.apple.NetworkAuthorization DefaultName

6 Comments

  • DB
    August 31, 2010 - 3:26 pm | Permalink

    Ahhhh I see…..I was trying to force OS X to always use the shortname instead of Display Name when connected to Active Directory. I didn’t catch you had to run both commands. Makes sense now. Did both and seem to be working the way I want now! Thanks!

    I only ran:
    defaults write /Library/Preferences/com.ap
    ple.NetworkAuthorization UseShortName -bool YES

    Also need to run this cmd as well:
    defaults write /Library/Preferences/com.apple.NetworkAuthorization UseDefaultName -bool NO

  • DB
    August 31, 2010 - 5:38 pm | Permalink

    Well its not working the way I thought….I thought it was working when you come back and your screensaver is on. I still have the same issue. In 10.5.8 I have the keychain lock icon in the menu bar and users can go up and lock the screen when they step away. When they come back they are presented with a login window and the username is always the display name from Active Directory. I want it to be the users username. Know of any way to force that to shortusername?

    • August 31, 2010 - 6:16 pm | Permalink

      I don’t know of a way to do that specifically. I would think it would actually be controlled somewhere in com.apple.loginwindow.plist if there is a way to do it. This is mostly just for the “Connect to Server” dialog box. I’ll tinker around with it when I get a chance and let you know if I come up with anything.

  • ivonesh
    April 22, 2011 - 12:01 pm | Permalink

    Charles,

    Is it possible to default to a blank dialog box with the cursor in the Name box?

    If I use the command defaults write /Library/Preferences/com.apple.NetworkAuthorization DefaultName “”

    It fills the name box with “” and drops me at the password entry.

    If I take out the “” in the terminal command it will accept it.

    Thanks!

  • ivonesh
    April 22, 2011 - 12:05 pm | Permalink

    Using ” instead of “” will make it blank.

  • Comments are closed.