I have test this script and works great except I have to change slashes (/) with periods (.), in order to run on Leopard machine.
Do you know if I want to run this on remote machine using apple remote desktop then what do I need to do? I tried copying and pasting thru “send unix command” task but that did not work.
Well if you just want to run the code as a unix command then strip out all the AppleScript bits until you’re left with something like thi /usr/bin/dscl / -create /Users/ghouse;/usr/bin/dscl / -create /Users/ghouse UserShell /bin/bash;/usr/bin/dscl / -create /Users/ghouse RealName ‘Dr. Gregory House’;/usr/bin/dscl / -create /Users/ghouse UniqueID 600;/usr/bin/dscl / -create /Users/ghouse PrimaryGroup 1001;/usr/bin/dscl / -create /Users/ghouse NFSHomeDirectory /Users/ghouse;/usr/bin/dscl / -passwd /Users/ghouse infectious;/usr/bin/dscl / -append /Groups/admin GroupMembership ghouse
and then when you run it run it as the “root” user.
Yes, this script creates an account and I can login with that account but once I log into a machine using new account then it give me error that user’s home folder is not at usual place. Currently we have other account’s home folders at this location, “/Users/”. Does anyone know how to fix that problem?
Is this on Leopard or Tiger? I have tested the script in the form I posted “/” rather than “.” on Tiger and I had no problems. I can test on Leopard tomorrow though.
Thanks James, this script works great. Since this was an apple script which I saved and copied over using ARD to the target machine then I ran it locally and it created an account and a home drive folder at 2 different locations (/Users/ and under the domain folder which is fine with me). Another thing that I experienced that after creating an account once I tried to login to target machine using newly created account then it showed me 2 different names (one was display name and other once was username) and I have to select in order to continue. This is what I have changed:
Do you know why am i getting those two different names?
So this is the Unix script that I sent to the target machine using ARD:
This script creates a user properly but shows that it created a home directory as well. Once I logged into target machine using new account then I receive the same error (home folder for user is not located in the usual place or can not be accessed).
So I have added the “-l” syntax and executed that command again using root account from ARD but still no home folder and I have received the same error message.
One thing that I don’t understand is this that what is the difference between the apple script (that you posted earlier) and this unix script. With apple script account and home folder was created successfully but only issue with that one that a person has to login to all the machines and manually execute apple script. Is there a way that I can remotely run that script on all the machines using ARD?
This worked for me using ARD in SL 10.6.2, but I received an error when sending it a user with Leopard 10.5.6. It Did create the admin account but didn’t create a home folder so you cannot access any settings requiring the default password. Any thoughts? Thanks!