Configuring & Using Profile Manager 2 in OS X Mountain Lion Server

Profile Manager first appeared in OS X Lion Server as the Apple-provided tool for managing Apple devices, including Mobile Device Management (MDM) for iOS based devices as well as Profile management for OS X based computers, including MacBooks, MacBook Airs, Mac Minis, Mac Pros and iMacs running Mac OS X 10.7 and up. In OS X Mountain Lion, Apple has added a number of new features to Profile Manager, most notably the ability to push certain types of apps to mobile devices.

In this article, we’re going to look at setting up Profile Manager from scratch. If you’re upgrading to OS X Mountain Lion Server (10.8 Server) from OS X Lion Server (10.7 Server) then review this link for upgrade instructions.

Preparing For Profile Manager

Before we get started, let’s prep the system for the service. This starts with configuring a static IP address and properly configuring a host name for the server. In this example, the IP address will be 192.168.210.135 and the hostname will be mlserver3.pretendco.com. We’ll also be using a self-signed certificate, although it’s easy enough to generate a CSR and install it ahead of time. For the purposes of this example, we have installed Server from the App Store (and done nothing else with Server except open it the first time so it downloads all of its components from the web) and configured the static IP address using the Network System Preferences. Next, we’ll set the hostname using scutil.

sudo scutil --set HostName mlserver3.pretendco.com

Then the ComputerName:

sudo scutil --set ComputerName mlserver3.pretendco.com

And finally, the LocalHostName:

sudo scutil --set LocalHostName mdm

Now check changeip:

sudo changeip -checkhostname

The changeip command should output something similar to the following:

Primary address = 192.168.210.135
Current HostName = mlserver3.pretendco.com
DNS HostName = mlserver3.pretendco.com
The names match. There is nothing to change.
dirserv:success = "success"

f you don’t see the success and that the names match, you might have some DNS work to do next, according to whether you will be hosting DNS on this server as well. If you will be hosting your own DNS on the Profile Manager server, then the server’s DNS setting should be set to the IP address of the Server. To manage DNS, start the DNS service and configure as shown in the DNS article I did previously:

 

Provided your DNS is configured properly then changeip should work. If you’re hosting DNS on an Active Directory integrated DNS server or some other box then just make sure you have a forward and reverse record for the hostname/IP in question.

Now let’s open the Server app from the Applications directory. Here, use the Next Steps drawer at the bottom and verify that the Configure Network section reads that “Your network is configured properly” as can be seen here:

Profile Manager is built atop the web service, APNS and Open Directory. Therefore, let’s close the Next Steps drawer, click on the Web service and just hit start. While not required for Profile Manager to function, it can be helpful. We’re not going to configure anything else with this service in this article so as not to accidentally break Profile Manager. Do not click on anything while waiting for the service to start. While the indicator light can go away early, note that the Web service isn’t fully started until the path to the default websites is shown (the correct entry, as seen here, should be /Library/Server/Web/Data/Sites/Default) and a View Server Website link is shown at the bottom of the screen. If you touch anything too early then you’re gonna’ mess something up, so while I know it’s difficult to do so, be patient (honestly, it takes less than a minute, wait for it, wait for it, there!).

Once the Web service is started and good, click on the View Server Web Site link at the bottom and verify that the Welcome to Lion Server page loads.

Setting Up Profile Manager

Provided the Welcome to Lion Server page loads, click on the Profile Manager service. Here, click on the Configure button.

At the first screen of the Configure Device Management assistant, click on Next.

Assuming the computer is not yet an Open Directory master or Replica, and assuming you wish to setup a new Open Directory Master, click on Create a new Open Directory domain at the Configure Network Users and Groups screen. Then click on Next.

At the Directory Administrator screen, provide the username and password you’d like the Open Directory administrative account to have (note, this is going to be an Open Directory Master, so this example diradmin account will be used to authenticate to Workgroup Manager if we want to make changes to the Open Directory users, groups, computers or computer groups from there). Once you’re done entering the correct information, click Next.

At the Organization Information screen, enter your information (e.g. name of Organization and administrator’s email address). Keep in mind that this information will be in your certificate (and your CSR if you submit that for a non-self-signed certificate) that is used to protect both Profile Manager and Open Directory communications. Click Next.

At the Confirm Settings screen, make sure the information that will be used to configure Open Directory is setup correctly. Then click Set Up (as I’ve put a nifty red circle next to – although it probably doesn’t help you find it if it’s the only button, right?).

The Open Directory master is then created. Even if you’re tying this thing into something like Active Directory, this is going to be a necessary step. Once Open Directory is setup you will be prompted to provide an SSL Certificate.

This can be the certificate provided when Open Directory is initially configured, which is self-signed, or you can select a certificate that you have installed using a CSR from a 3rd party provider. At this point, if you’re using a 3rd party Code Signing certificate you will want to have installed it as well. Choose a certificate from the Certificate: drop-down list and then click on Next.

If using a self-signed certificate you will be prompted that the certificate isn’t signed by a 3rd party. Click Next if this is satisfactory.

You will then be prompted to enter the credentials for an Apple Push Notification Service (APNS) certificate. This can be any valid AppleID. It is best to use an institutional AppleID (e.g. push@krypted.com) rather than a private one (e.g. charles@krypted.com). Once you have entered a valid AppleID username and password, click Next.

Provided everything is working, you’ll then be prompted that the system meets the Profile Manager requirements. Click on the Finish button to complete the assistant.

When the assistant closes, you will be back at the Profile Manager screen in the Server application. Here, check the box for Sign Configuration Profiles.

The Code Signing Certificate screen then appears. Here, choose the certificate from the Certificate field.

Unless you’re using a 3rd party certificate there should only be one certificate in the list. Choose it and then click on OK. If you are using a 3rd party certificate then you can import it here, using the Import… selection.

If you host all of your services on the one server (Mail, Calendars, VPN, etc) then leave the box checked for Include configuration for services; otherwise uncheck it.

Now that everything you need is in place, click on the ON button to start the service and wait for it to finish starting.

Once started, click on the Open Profile Manager link and the login page will open. Adminsitrators can login to Profile Manager to setup profiles and manage devices.

The URL for this (for mlserver3.pretendco.com) is https://mlserver3.pretendco.com/profilemanager. Use the Everyone profile to automatically configure profiles for services installed on the server if you want them deployed to all users. Use custom created profiles for everything else.

Enrolling Into Profile Manager

To enroll devices for management, use the URL https://mdm.pretendco.com/MyDevices (replacing the hostname with your own). Click on the Profiles tab to bring up a list of profiles that can be installed manually.

From Profiles, you’ll need to install a Trust profile in order for the client to enroll. Tap or click on the Install button for the Trust Profile and complete the installation process.

Click back on the Devices tab. From here, click or tap on the Enroll button and complete the enrollment process on the client (following the defaults will suffice).

On the devices, you’ll then be prompted to install the profile. On iOS tap Install then Install then Done. On OS X, click Continue, then Install.

Once enrolled, you can wipe or lock the device from the My Devices portal. Management profiles from the MDM server are then used. Devices can opt out from management at any time. If you’re looking for more information on moving Managed Preferences (MCX) from Open Directory to a profile-based policy management environment, review this article.

If there are any problems when you’re first getting started, an option is always to run the wipeDB.sh script that resets the Profile Manager (aka, devicemgr) database. This can be done by running the following command:

sudo /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend/wipeDB.sh

Automating Enrollment & Random Management Tips

The two profiles needed to setup a client on the server are accessible from the web interface of the Server app. Saving these two profiles to a Mac OS X computer then allows you to automatically enroll devices into Profile Manager using Apple Configurator, as shown in this previous article.

When setting up profiles, note that the username and other objects that are dynamically populated can be replaced through a form of variable expansion using payload variables in Profile Manager. For more on doing so, see this article.

Note: As the database hasn’t really changed, see this article for more information on backing up and reindexing the Profile Manager database.

Device Management

Once you’ve got devices enrolled, those devices can easily be managed from a central location. The first thing we’re going to do is force a passcode on a device. In this case, it’s an iPad. We’re going to click on the device in Profile Manager’s admin portal, located at https://<SERVERNAME>/profilemanager (in this case https://mdm.pretendco.com/profilemanager).

From the device (or user, group, user group or device group objects), click on the Profile tab and then click on the Edit button.

Here, you can configure a number of settings on devices. There are sections for iOS specific devices, OS X specific settings and those applicable to both platforms. Let’s configure a passcode requirement for an iPad. Click on Passcode, then click on Configure.

At the Passcode settings, let’s check the box for Allow simple value and then set the Minimum Passcode Length to 4. I find that with iOS, 4 characters is usually enough as it’ll wipe far before someone can brute force that. Click OK to commit the changes. Once configured, click Save.

At the “Save Changes?” screen, click Save. The device then prompts you to set a passcode a few moments later.

The next thing we’re going to do is push an app. To do so, first find an app in your library that you want to push out. Right-click (or control-click) on the app and click on Show in Finder. You can copy the app from your library or browse to it at the location it is in later.

Then, from the https://<SERVERNAME>/profilemanager portal, click on an object to manage (in this case it’s a group called Demo) and click on the Apps tab.

From the Apps tab, click on the cog wheel icon and then click on Edit Apps.

At the Add Apps screen, click on upload and then browse to the app we found earlier.

The app is then uploaded and displayed in the list. Click Add to add to the selected group. Then, click on Done. Then click on Save… and an App Installation dialog will appear on the iOS device you’re pushing the app to.

At the App Installation screen on the iPad, click on the Install button and the app will instantly be copied to the last screen of apps on the device. Tap on the app to open it and verify it works. Assuming it does open then it’s safe to assume that you’ve run the App Store app logged in as a user who happens to own the app. You can sign out of the App Store and the app will still open. However, you won’t be able to update the app as can be seen here.

This brings up an interesting limitation of how Profile Manager interacts with the App Store. It kinda’ doesn’t. If I were pushing apps to elementary school iPads in a 1:1 I could either use Apple Configurator (if I wanted to burn up a VPP code per student per year) or I could use iTunes (if I wanted a labor intensive process of restoring an iPad per computer rather than a parallel process). But either way, I’m gonna’ stay away from Profile Manager for apps.

So if you push an app to a device and the user taps on the app and the screen goes black then make sure the app is owned by the AppleID signed into the device. If it is, have the user open App Store and update any other app and see if the app then opens.

Finally, let’s wipe a device. From the Profile Manager web interface, click on a device and then from the cog wheel icon at the bottom of the screen, select wipe.

At the Wipe screen, click on the device and then click on the Wipe button again. The iPad then says Resetting iPad and just like that, the technical walkthrough is over.

Note: For fun, you can use the MyDevices portal to wipe your iPad from the iPad itself.

Conclusion

So where are all these new features that justify a new version number? To quote Apple’s Profile Manager 2 page:

Profile Manager simplifies deploying, configuring, and managing them all. It’s one place where you control everything: You can create profiles to set up user accounts for mail, calendar, contacts, and messages; configure system settings; enforce restrictions; set PIN and password policies; and more. Because it’s integrated with the Apple Push Notification service, Profile Manager can send out updated configurations over the air, automatically. And it includes web-based administration, so you can manage your server from any modern web browser. Profile Manager even gives users access to a self-service web portal where they can download and install new configuration profiles, as well as clear passcodes and remotely lock or wipe their Mac, iPhone, or iPad if it’s lost or stolen.

Wait, it did that before… Which isn’t to say that for the money, Profile Manager isn’t an awesome tool. Apps such as Casper MDM, AirWatch, Zenprise, etc all have far more options, but aren’t as easy to install and nor do they come at such a low price point. Profile Manager is a great option if all of the tasks you need to perform are available within the tool. If not, then it’s worth a look, if only as a means to learn more about the third party tools you’ll ultimately end up using. One thing I can say for it is that Profile Manager is a little faster and seems much more stable (in fact, Apple has now published scalability numbers, which they have rarely done in the past). You can also implement newer features with it, including Gatekeeper and Messages.

18 Comments

  • Dani Cela
    August 14, 2012 - 9:09 am | Permalink

    is there a way to clear the user database or resync it? I had a active directory sync which i have since removed and its still showing all of those users, but its shows them as loading…. in the web ui of profile manager.

  • cmstar0
    August 15, 2012 - 3:04 pm | Permalink

    I have an interesting scenario. I was setting this up for my company and demoing it for my boss. Everything went great and as expected. I had enrolled my MacBook Air, iPad, and iPhone. All worked. Boss was happy.

    Then as a final run through of what the end-user would see, we tried to enroll his phone. It loads the initial MyDevices screen, but will not accept ANY username and password combination (have verified working accounts on other machines). Everything works except THIS particular iPhone will not authenticate.

    I’ve deleted his cookies and browsing history. Forgotten all wireless networks, and verified he is on the right wireless network and again, verified accounts.

    As soon as you put in the username and password and hit logon, you IMMEDIATELY get an “invalid username and password”. Because it is immediate it acts as though it is not even processing the logon.

    ANY ideas or help would be much appreciated. This failed in the worst way at the worst possible time.

  • Tom
    August 17, 2012 - 6:54 am | Permalink

    It seems that there should be a better way for app management.

    I was actually thinking that this would be useful in a home environment, but if I push an app to a kids ipad then they would have to login to the store with my account.

    • August 27, 2012 - 8:31 pm | Permalink

      I think you might find your answer in mid-September. :)

  • Tony
    August 20, 2012 - 6:45 am | Permalink

    Great guide! :)

    But.. Have you tried to connect the ML server with Profile Manager to an AD? I’ve tried, and did not get it to work.

    This is what happens:

    1. Set up server “as usual”, start/configure Profile Manager, join the AD.
    2. Check in Server.app and Workgroup manager that i can search and see all AD users. I can also log in to PM as user with AD account.
    3. Here comes the problem. When i log in to PM as admin, i can’t search for any AD user. Search for short names or full name gives “no user” reply. In Lion Server i got this working without any hassle.

    Any clues?

    • August 23, 2012 - 9:03 pm | Permalink

      The 10.8.1 update should resolve this issue.

    • August 27, 2012 - 8:16 pm | Permalink

      This was specifically referenced as one of the fixes in 10.8.1. Tried that yet? Sorry I didn’t respond earlier…

  • Billy Z
    August 29, 2012 - 2:30 pm | Permalink

    Have you heard anything about using Workgroup manager in 10.8? It was my understanding that this had been phased out, and Mac OS X preferences should be managed in profile manager. I had a client speak to Apple Support, who informed them that Workgroup manager was the way to manage Mac’s in 10.8.

  • Adrian
    September 4, 2012 - 2:05 pm | Permalink

    Hello I had a quick question about the PM on ML. Does it sync the users passwords using LDAP? We have a password policy at work that requires users to change their password every 90 days and a lot of them use VPN and exchange on their iPads.

    • September 10, 2012 - 9:47 am | Permalink

      The password policies come from the directory service. It doesn’t cache them though.

  • Ron L
    September 20, 2012 - 10:13 am | Permalink

    Charles, as a new OS X administrator I’m really enjoying your site.

    Is there a way to prevent Mac App Store and iTunes Store access on client Macs via Profile Manager or some other means?

    • September 20, 2012 - 10:20 am | Permalink

      For Macs, it’s pretty different. The Mac App Store requires admin access to install apps. Therefore, simply having the users not be admins will do the trick. Restricting iTunes and the Mac App Store for admins though would likely require either poisoning the DNS, setting up a proxy that denies those sites or simply block Apple’s entire IP scheme (which is contiguous).

  • Ron L
    September 20, 2012 - 1:10 pm | Permalink

    Thanks for the quick reply Charles. The Mac App Store solution works perfectly.

    Is it possible to lockdown specific preferences in apps like iTunes? There is an option to disable iTunes store access, but the User can just re-enable it easily.

    Also, in AD it’s very simple to allow domain admins to administer local machines. Is this possible in OD as well, or do you have to login to the local machine with a network admin account and then enable local administration? (as per the Apple Support docs).

    Thanks again!

    • September 21, 2012 - 8:21 am | Permalink

      The answer here is it depends. Managed Preferences can lock various things in com.apple.itunes provided Apple has built in the option to do so. For example, there’s a moviesLimit key that can limit the number of movies, a disablePing key, a disablePodcasts key, a allowiTunesUAccess key (that can disable iTunes U), a disableRadio key, a disableSharedMusic key, a gamesLimit key, an array called Home Sharing Settings that can limit what can be shared, a restrictExplicit key, a restrictMovies key, a restrictTVShows key and a ratingSystemID key. These can all be used to disable various features or limit how much they can be used. This can be managed through local MCX, through a profile or through a directory service. You’re not outright limiting access to the store necessarily but you are limiting what can be done through the store.

      Hope this helps!

  • Pingback: Profile Manager 2 enables enterprise Mac administration | TechRepublic

  • SMC Tech
    October 11, 2012 - 7:46 am | Permalink

    I’ve noticed that when installing the Remote Management Profile, it adds a Cert/Key pair to the System Keychain called “Device Management Identity Certificate”. This is signed by the server self generateded IntermediateCA_MDM.PRETENDO.COM Certificate Authority. Is there a way to specify the CA used by devicemgr, or better yet generate a csr for this IntermediateCA and do a replace/renew certificate Authority?

  • Pax
    October 25, 2012 - 9:18 am | Permalink

    Wiped the PM database, but now it wants me to configure Users and Groups, create a new OD domain – which is super strange, since it’s already/still an OD master.

  • Comments are closed.