Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Settting boot kernel architecture with Apple Script

Ok, so on three different sites, I've got a total of about fifty Macs, the majority of which run 10.6.8. I need to install a remote monitoring application on the machines, but the application only runs on the 64 bit kernel. I'd really like to set the kernel to 64 from Remote Desktop's send unix command feature, but it looks like it can't run with sudo. So after some poking around, I've come up with the following Applescript:


property myUserName : "<admin login>"

property myPassword : "<admin pass>"

do shell script "sudo systemsetup -setbootkernelarchitecture x86_64" user name myUserName password myPassword with administrator privileges


My goal here would be to run the script remotely with ARD. It copmpiles and runs fine, but doesn't acually change the boot kernel. I don't get any errors, so I've got nothign to go on here as to why it's not working.


Can anyone offer some insight on this? Would a different approach work better? I really don't want to go sit at each desktop and set the kernel manually.

Posted on Jun 11, 2012 6:41 AM

Reply
6 replies

Jun 11, 2012 11:15 AM in response to Trey

I'd really like to set the kernel to 64 from Remote Desktop's send unix command feature, but it looks like it can't run with sudo


You don't need to use sudo with Remote Desktop's 'send UNIX' command.


When you choose to send a command you get to nominate what user it should run as - either root or the current logged-in user. Just set it to run as root and omit the sudo prefix and you should be fine.

Jun 12, 2012 9:40 AM in response to twtwtw

Ok, changing the verbiage to "...do shell script '/usr/sbin/systemsetup -setkernelbootarchitecture x86_64' ...yadda yadda yadda" seems to have fixed it. Thanks! I've tried it a few times on some test systems, and it went well. We'll see how it goes later on in the real world.

Jun 12, 2012 9:41 AM in response to Camelot

Camelot wrote:

When you choose to send a command you get to nominate what user it should run as - either root or the current logged-in user. Just set it to run as root and omit the sudo prefix and you should be fine.

Yeah, that's what I would have thought, but it fails every time. Is there something I'm missing?

Settting boot kernel architecture with Apple Script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.