The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   OS X Developer (http://hintsforums.macworld.com/forumdisplay.php?f=27)
-   -   Help making new user script (http://hintsforums.macworld.com/showthread.php?t=87082)

Mikey-San 03-11-2008 03:22 PM

Quote:

Originally Posted by demck85 (Post 457367)
I don't have ARD, though I wish I could have it, but we don't have the numbers to get it for the amount of users total (not justifiable).

Agreed with tlarkin here, man. If you have to manage 400 machines, you need ARD. It's just not a choice.

Go bug your procurement department. :)

tlarkin 03-11-2008 03:37 PM

Quote:

Originally Posted by demck85 (Post 457414)
i see what you are getting at...but everything has to be done in baby steps on this campus...it's frustrating, even to me...there are so many things that we should be able to do to help support end-users, but it's the education/gov't...it takes forever to get anything done.

Any hoo...

I use a combo of methods depending on the situation...
Lab-netrestore
fac/staff-bootable firewire drive

I've worked in government education for the past 4 years, so yeah I completely sympathize and understand. Here is what I do not get. You set up hundreds and hundreds of local user accounts for each individual student, however, you are not mapping drives, storing network home directories. authenticating against a Directory Service, and all of this extra work for what?

On the IT/Administration side it would be in your benefit to KISS (keep it simple stupid) by just creating one managed account for all students and one admin account for local administration. That way you aren't dealing with hundreds of extra local user accounts, which would be a nightmare to manage, you aren't having to worry about their individual home directories, and I assume they are saving all personal data on thumb drives or what not, so you aren't having to manage their data either.

I used to be in the same boat as you at my old job. 10,000 computers to support with about a 3% to 4% mac population. All managed locally. I set up a file server for students to store data on, then created one admin and one managed user account on each machine. I would then use ARD admin to push out any post scripts or post config after imaging.

At my new job I manage around 6,000 macs, so its a bit different on how we manage them, but if I were you, I would not bother with setting up individual local user accounts.

Now the tricky part for you is that you'll need 3 scripts. 1 for 10.3 1 for 10.4 and 1 for 10.5. I would simply place the script on the local admin accounts desktop for that image, so when a tech reimages it they can run the script from there. You can set it up to be interactive as well, and if you need help with that I can try to help though I am not an expert scripter. I'm in between expert and novice. Though, I have made interactive scripts before.

demck85 03-12-2008 08:34 AM

I'd really like to have ARD, but I don't manage all 400 Macs by myself. They're are just shy of 400 Macs across the campus. Then they are spread out between all the departments, and we specific techs assigned to each dept. So...not one tech is assigned to manage all the Macs on campus. I'm not a full Mac expert, I know more then all the other Techs, but i consider myself almost intermediate. I'm still very much learning how much you can..and can't do...with Macs. Plus, in an academic environment people have academic freedom...and that causes all kind of issues...
Until, my IT dept get some "balls" and money to do things like that...I'm forced right now to manage locally.

Now the scripts don't have to be extremely fancy. But like I stated before...it just need to the tech to add the fullname and shortname...and the rest is done by the script.

BarbadoSlim 03-12-2008 01:50 PM

400 macs? That's a lot of headaches.

tlarkin 03-12-2008 04:13 PM

well, I am not quite sure how to make it interactive and take my inputted text. I know how to make a menu based script to run commands but I don't quite know how to code it so you can input text.

I have a less effecient solution though of just using variables, so the script will need to be modified each time you use it, but you would only need to modify two fields with short name and long name, so it wouldn't be a huge deal.

Code:


#!/bin/bash

#this script will create users for 10.3 and 10.4 using the netinfo manager


#change the variable to match desired results for the user created

SNAME=desiredshortname

LNAME=desiredlongname

GID=desiredgroupid

UID=desiredUID

niutil -create . /users/$SNAME
niutil -createprop . /users/$SNAME gid $GID
niutil -createprop . /users/$SNAME uid $UID
niutil -createprop . /users/$SNAME shell /bin/bash
niutil -createprop . /users/$SNAME home /Users/$SNAME
niutil -createprop . /users/$SNAME realname "$LNAME"
niutil -createprop . /users/$SNAME passwd '*'
mkdir /Users/$SNAME
mkdir /Users/$SNAME/.ssh
chown -R $SNAME /Users/$SNAME
chgrp -R $GID /Users/$SNAME
chmod 755 /Users/$SNAME

Just fill in the blanks to make it do what you want to do. If someone can make those variables interactive it would make it even sweeter, I am just not quite sure how to do it. I was looking at example interactive scripts and trying to look at the coding, but decided I will have to tinker with it more before I try to do something like that.

tlarkin 03-12-2008 04:38 PM

well I was looking into it, and you could try adding code like this

example
Code:

#!/bin/sh
INPUT_STRING=hello
while [ "$INPUT_STRING" != "bye" ]
do
  echo "Please type something in (bye to quit)"
  read INPUT_STRING
  echo "You typed: $INPUT_STRING"
done

then you could use double semi colon ;; to separate each command in the script to modify each variable and then as a last command have it execute the full path of the script.

Of course, I am a noob in some ways when it comes to advanced scripting.

demck85 03-17-2008 08:38 AM

I've put in a request to have ARD order...now..I wait.

Would I just make .command file to put this commands in? I know in Linux you can make a .sh file.

BarbadoSlim 03-19-2008 03:50 PM

Quote:

Originally Posted by demck85 (Post 458568)
I've put in a request to have ARD order...now..I wait.

Would I just make .command file to put this commands in? I know in Linux you can make a .sh file.

Educational? You probably won't ever have ARD to work with.

BarbadoSlim 03-19-2008 05:39 PM

Quote:

Originally Posted by demck85 (Post 458568)
I've put in a request to have ARD order...now..I wait.

Would I just make .command file to put this commands in? I know in Linux you can make a .sh file.

I don't think putting a request for ARD is ever going to happen. You might be waiting years.

demck85 03-20-2008 08:02 AM

you're probably right, but i have to try...

BarbadoSlim 03-20-2008 10:12 AM

Quote:

Originally Posted by demck85 (Post 459178)
you're probably right, but i have to try...

maybe maybe not. might depend on which departments are more important to them, and if they feel like shelling them money on out for ARD

tw 03-20-2008 01:04 PM

Quote:

Originally Posted by BarbadoSlim (Post 459082)
I don't think putting a request for ARD is ever going to happen. You might be waiting years.

ah, you gotta work the system. if you just send in paper (or worse, electronic) requests, they will disappear down the rabbit hole. you have to do a little investigation, find out where the tech managers live, and then make the request in person. play desperate, worried, and confused, and they will buy you ARD just to get you out of their offices. :D

tlarkin 03-20-2008 02:18 PM

requesting at least puts it on the table and for 400 macs, you know you can start centralizing administration to them via ARD.

Also, ARD, has a built in feature that will just send a unix command, so you can send the script to each machine and then execute a command to run it. Done.

BarbadoSlim 03-20-2008 06:56 PM

Quote:

Originally Posted by tw (Post 459236)
ah, you gotta work the system. if you just send in paper (or worse, electronic) requests, they will disappear down the rabbit hole. you have to do a little investigation, find out where the tech managers live, and then make the request in person. play desperate, worried, and confused, and they will buy you ARD just to get you out of their offices. :D

Haha. One way of putting it. But the University in which he has stated he works. I don't think they'll do anything for him. Just gotta know the right people to talk to to get anything done at colleges.

tw 03-20-2008 10:40 PM

Quote:

Originally Posted by BarbadoSlim (Post 459290)
Haha. One way of putting it. But the University in which he has stated he works. I don't think they'll do anything for him. Just gotta know the right people to talk to to get anything done at colleges.

hey, I work in a university. bureaucracies are the same everywhere. ;)

Quote:

Bureaucracy |byoŏˈräkrəsē|, noun. a system of management which follows the path of least accountability, ensuring minimal output regardless of actual conditions.
just pick someone and make them feel accountable, and they will jump through hoops to escape the burden.

demck85 03-21-2008 09:10 AM

Oh Boy, this topic has gotten off track...

tlarkin 03-21-2008 10:07 AM

Quote:

Originally Posted by tw (Post 459311)
hey, I work in a university. bureaucracies are the same everywhere. ;)



just pick someone and make them feel accountable, and they will jump through hoops to escape the burden.

I find that really odd. I work in public education, K-12 and I generally get what I ask for. Well, they haven't given me my 6 new xserves I requested, but they are giving me a brand new spanking top of the line xserve for my JSS that I requested.

I got ARD admin, several licenses for several different applications. I got copies of OS X server, all that I would want. I got a macbook pro per request. I mean it can be done and it just goes to show how serious you are with what you want to accomplish.

Then again in retrospect I manage over 5500 to 6000 macs district wide. So, the justification may be better in my situation. However, I would think that University level networks would have access to more money and resources than public K-12

BarbadoSlim 03-21-2008 11:01 AM

If we were talking about a big named college. I can see getting what one wanted happening, but the university hes speaking of, is not that great.

greggm 08-05-2010 07:38 PM

Two things, the dscl scripts work very well in bash and I run them from ARD. Usually, I run them with the systems on the log in screen, ARD can run as root, and the login gives me console access.

Since I run a small group of iMacs that get repurposed several times a year, 3 times this summer, I depend on ARD. If I had to touch every one of our 300 systems each time I would have spent the $300 license fee many times over in the last two months. I am getting another license with Task Manager enabled in the Fall!

tlarkin 08-06-2010 10:51 AM

wow old post...

After running a 1:1 for 3 years now (starting my 4th) and using Casper. Nothing compares to the power tools Casper provides to manage computers, deploy software, mass image, etc.

ARD Admin and task manager cannot even hold a stick.


All times are GMT -5. The time now is 06:13 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.