Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 27, 2013, 06:27 AM   #1
blabla296
macrumors newbie
 
Join Date: Jul 2013
Launchd and auto-enroll certificate script not working

Hi All !

First time here and already in trouble... so here's the deal :
- Mac OS X 10.8.4
- SCCM 2012
- XServe 10.7 + DeployStudio 1.6.2

I deploy my iMacs using DeployStudio. As a part of the deployment process, the Macs are binded to AD & OD. I need also to install the Microsoft SCCM 2012 client. In order for the iMacs to properly communicate with SCCM and being furtherly managed, I need them to enroll a certificate at first boot. My colleague and myself tried a couple of different methods, no luck yet.
So what we currently have in mind is to copy a plist in the LaunchDemons folder and the enroll script in another location to be run by launchd. Problem is : doesn't work... and no logs whatsoever !

Here's the plist :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
 <dict>
  <key>Label</key>
   <string>com.sccm.enrollcert</string>
  <key>ProgramArguments</key>
   <array>
    <string>/usr/bin/enroll</string>
   </array>
  <key>RunAtLoad</key>
   <true/>
 </dict>
</plist>
Very simple as you can see...

And here's the enroll.sh script :

Code:
#!/usr/bin/expect
spawn /usr/bin/CMEnroll -s SCCM.DOMAIN.local -ignorecertchainvalidation -u "DOMAIN\ACCOUNT"
expect "Please enter your password."
send "passwd\n"
sleep 50
So as you can see it pretty simple... but for some funny reason it doesn't work at all.

Is there something we're missing by using "expect"/"spawn" in a launchd script like that ?

Thanks in advance
blabla296 is offline   0 Reply With Quote
Old Jul 29, 2013, 01:28 AM   #2
blabla296
Thread Starter
macrumors newbie
 
Join Date: Jul 2013
EDIT :

My colleague got it. Just "expect" the "Executed successfully" sentence... lol

Last edited by blabla296; Jul 29, 2013 at 02:42 AM.
blabla296 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Can you write a script to auto delete text messages? bobfitz14 iOS 7 6 Mar 23, 2014 04:26 PM
Auto-login Multiple users who then launch a script RobQuads Mac OS X Server, Xserve, and Networking 6 Oct 9, 2013 07:11 PM
Apple Script / launchd way to keep WiFi on? jagak Mac Programming 2 Aug 8, 2013 08:50 PM
Script to auto quit hung app UFGrayMatter Mac Basics and Help 6 Nov 3, 2012 12:09 PM
Shell Script To Check if Microsoft Office Auto update available sonuw OS X 3 Aug 18, 2012 11:38 AM

Forum Jump

All times are GMT -5. The time now is 07:31 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC