Scripts.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-06-2012 06:35 AM
Hey guys, We are starting our Mac Air deployments in the next month or so and I am trying to find a script.
I was wondering if there is a script that I can have casper run every so often to have the computer name checked to see if it is the serial number and if its not, change it back to the serial number.
Thanks in advance!
-John

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-06-2012 07:15 AM
The JSS and a policy can actually handle this without the need for a script.
If you look in the Advanced tab of a policy you'll see an option called "Reset Computer Names" Basically, as long as the name of your Macs in the JSS matches what you expect, having that option checked in a policy that runs, say, every 15 minutes, or once a day, etc, will set the computer names back to the way they are in the JSS, regardless of what they have been named by a user.
On the other hand, you could put a script together that grabs the serial number from the Mac and does a rename on the command line. And then have that run by a policy every so often. That would work too.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-06-2012 12:55 PM
mm2270-
I will give that a try and let you know if it works out. Where does policy check for the computer name on the JSS? Is it when the binaries first install on the Mac's and communicates to the JSS?
Initially, we have the computer name's set as the serial number but I know the users will want to try and changing it to their own name, hence this policy. I also do know about configuration profile to lock down certain settings in system preference but I have't tested yet. Although I may go that route in the long run.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-06-2012 01:17 PM
You can name a computer anything you want in your JSS by going into the computer's details and clicking the little (-) button under the Computer Information section. Change the name there, click Save and if a policy like the above is running, the next time the Mac checks in, if it needs to, the name will be set back to what is in the database.
