Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hawkinsd

macrumors newbie
Original poster
Apr 6, 2016
2
0
Hello, just wondering if there is a command to run in terminal that would change the "login options" for "Display login window as" from "Name and password" to "list of users" on OS X 10.10.

Regards
 
Just to clarify, you specifically want to use Terminal instead of system prefs?
[doublepost=1460015390][/doublepost]Ideally something I can apply via some form of a script through deploy studio i.e.

Deploying a new image to 100 macs, 50 of them want the "Name and password" at login and 50 want "List users" so instead of holding two different image builds was wondering if these setting could be changed via a script / terminal that I could place in a deploy studio workflow to automate the changes.
 
Take a look at the dscl command here. It can do some manipulation of user accounts and might be able to do what you want.
 
[doublepost=1460015390][/doublepost]Ideally something I can apply via some form of a script through deploy studio i.e.

Deploying a new image to 100 macs, 50 of them want the "Name and password" at login and 50 want "List users" so instead of holding two different image builds was wondering if these setting could be changed via a script / terminal that I could place in a deploy studio workflow to automate the changes.
This can be managed with a configuration profile. That's probably the easiest way to handle it. The easiest way to do that is to get a copy of OS X Server and set up the profile manager. It's not necessary to use profile manager to enroll your computers, but you can. Some people would say that Profile Manager isn't a reliable way to manage systems. If you opt not to enroll computers, you can just download the profile then install that profile into your client computers.
http://www.amsys.co.uk/2015/02/creating-config-profiles-instead-first-boot-script/
[doublepost=1460065322][/doublepost]
Take a look at the dscl command here. It can do some manipulation of user accounts and might be able to do what you want.
dscl doesn't handle loginwindow preferences.
 
A scripted change will need to run as root. Do scripts in Deploy Studio always run as root?


The setting appears to be in this file:
/Library/Preferences/com.apple.loginwindow.plist​

Two command-line tools that can alter plist files are:
defaults
PlistBuddy​

See the man page of each for details.

If more details are needed, I can post sample commands to run, and actions to perform in System Preferences.
 
A scripted change will need to run as root. Do scripts in Deploy Studio always run as root?
Deploystudio is a boot environment that's used to image a Mac. It has the capability to run scripts post-imaging in the DeployStudio boot environment. Permissions won't be a factor as DeployStudio is specifically designed to do this sort of thing. You write a script, save it as a file, then add a deployment step that runs that script. It'd even be possible to actually deploy a plist directly after imaging but before booting the client OS.
 
... It'd even be possible to actually deploy a plist directly after imaging but before booting the client OS.
Then that might be another option.

I don't have 10.10 on anything here. I checked the following on several OS X versions I do have, and they all showed the same.

Here's what I did:

1. Show the current plist:
Code:
/usr/libexec/PlistBuddy -c print /Library/Preferences/com.apple.loginwindow.plist
Example output:
Code:
Dict {
    RetriesUntilHint = 3
    autoLoginUser = mr.cipher
    OptimizerLastRunForSystem = SOME_NUMBER
    lastUserName = mr.cipher
    autoLoginUserUID = 666
    SecureEraseOption = 0
    MasterPasswordHint = sympathy
    lastUser = loggedIn
    OptimizerLastRunForBuild = SOME_NUMBER
    MCXLaunchOnLogout = true
}

2. Change a setting in System Preferences.
System Preferences > Users & Groups > Login Options > Display login window as:
Change the radio button to: Name and password

3. Run the command in Terminal again:
Code:
/usr/libexec/PlistBuddy -c print /Library/Preferences/com.apple.loginwindow.plist
Example output:
Code:
Dict {
    RetriesUntilHint = 3
    autoLoginUser = mr.cipher
    OptimizerLastRunForSystem = SOME_NUMBER
    lastUserName = mr.cipher
    autoLoginUserUID = 666
    SecureEraseOption = 0
    MasterPasswordHint = sympathy
    lastUser = loggedIn
    OptimizerLastRunForBuild = SOME_NUMBER
    SHOWFULLNAME = true
    MCXLaunchOnLogout = true
}
Notice the SHOWFULLNAME item and its value.

4. Go back to System Preferences and change the setting to "List of users".
Then go back to Terminal and run the command again.
The value of SHOWFULLNAME should change to false.​

Since PlistBuddy can accept commands on its command-line, one can script it to set SHOWFULLNAME as desired.

Or one can copy the plist, possibly change other values such as autoLoginUser, and apply it.
 
  • Like
Reactions: richard2
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.