Skip to main content
Question

Changing Computer names

  • April 8, 2011
  • 10 replies
  • 21 views

I have a group of computers that have already been imaged that I want to add to Casper. They all are named with the same name. Is there an easy way to rename the computers as they are added - I wouldn't care if it was to their Serial Numbers but I need computer names to be individual!

Any help would be greatly appreciated -

I apologize if this has been previously discussed. I lost my Casper Server, and backup - (HD failure and corrupt backup together do not make me happy!) - and am now rebuilding everything from nothing!
Quite a task - but an awesome learning experience!!!!

Thank you in advance for any help you can provide!

Kimberly Police District Technician
Clinton Township School District
Lebanon, NJ

10 replies

Forum|alt.badge.img+31
  • Honored Contributor
  • April 8, 2011

Do you have a standard naming convention? Are they all located on separate VLANs? If you can give me as much detail as possible I could whip up a rename script

thanks,

Tom


ImAMacGuy
Forum|alt.badge.img+23
  • Esteemed Contributor
  • April 8, 2011

I'd be interested in that as well, as we seem to have users that feel
they can change their machine names as they see fit...

Is there a way to lock that down so they can't?

John Wojda

Lead System Engineer, DEI

3333 Beverly Rd. B2-338B

Hoffman Estates, IL 60179

Phone: (847)286-7855

Page: (224)532.3447

Team Lead: Matt Beiriger
<mailto:mbeirig at searshc.com;jwojda at searshc.com?subject=John%20Wojda%20Fe
edback&body=I%20am%20contacting%20you%20regarding%20John%20Wojda.>

Mac Tip/Tricks/Self Service & Support <http://bit.ly/gMa7TB>


Forum|alt.badge.img+24
  • Valued Contributor
  • April 8, 2011

Once they're in Casper it's easy to change the name. Just change it in the
JSS and then you can Casper Remote it with the Reset Computer Name box.
I'd say just add them one at a time, change the name in the JSS, then run
your Remote (or set up a specific policy for it I suppose).

Casper doesn't care that they join all with the same name as it's MAC
address that distinguishes them all.

j
-- Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436


Forum|alt.badge.img+5
  • Contributor
  • April 8, 2011

I thought there was a checkbox in recon to add an incremental number to each one...

ben janowski
Senior Macintosh Support Technician
Kohl's Mac Support Team
262.703.1396 | benjamin.janowski at kohls.com


Forum|alt.badge.img+31
  • Honored Contributor
  • April 8, 2011

I lock out the sharing pref in system preferences so they cannot change the name. I also have a set of scripts which caches the name at imaging, and then runs a daily task to ensure the name is proper.


  • April 8, 2011

Our laptop names are all very similar
They are all sitting here on my table - lol so yes they are on the same vlan

Laptops are named "CLHM-teacher" and we would ideally like them to be named "CLHM-Serial Number"
where serial number is the unique SN of that computer

I do know that I can rename them in the JSS - but I am not looking forward to renaming them one by one In addition we are changing our naming convention from what had been done in the past - so it would be nice to use the script on other computers in the district to get all the names to follow the same convention.

Thank you so much for all your help.
Kimberly


  • April 8, 2011

Tom -
Those scripts would be very valuable to have! If you would be willing to share!
Kim


Forum|alt.badge.img+31
  • Honored Contributor
  • April 8, 2011

Well, if that is all you want then you can do something simple like this:

#!/bin/bash

# set computer name to CLHM-serial nubmer

getSerial=system_profiler SPHardwareDataType | awk '/Serial Number/ { print $4 }'

# now set the computer names

scutil --set ComputerName "CLHM-${getSerial}" scuitl --set LocalHostName "CLHM-${getSerial}" scutil --set HostName "CLHM-${getSerial}"

# exit script exit 0


Forum|alt.badge.img+4
  • Contributor
  • April 7, 2016

I know this is old but i want something like this.My sharing preference is also lock like TLarkin. I don't want user changing computer name.

TLarkin, how does your script handle bound macs in AD?

This is our naming: Campus#>Building>Floor#>Dept>Hypen>TYPE>#.
Example:1SM4IT-MBP01

Thank you,


Forum|alt.badge.img+31
  • Honored Contributor
  • April 7, 2016
know this is old but i want something like this.My sharing preference is also lock like TLarkin. I don't want user changing computer name. TLarkin, how does your script handle bound macs in AD? This is our naming: Campus#>Building>Floor#>Dept>Hypen>TYPE>#. Example:1SM4IT-MBP01 Thank you,

Hi @ArielN this looks like a post that was transferred from the old mailing list to JAMF Nation so it is pretty old. This would just change or set the computer name in OS X, it wouldn't affect the Computer Object in AD. You would just want to be sure you set the computer name before you have Casper run your AD binding.

As for automating all the AD info into a name, I am sure that might be possible but I don't have any AD environments to even test it, so I would have to defer to someone here that could answer that a lot better than I could.