Part 4: Setting Up the MDM Server and Enrolling Devices

 Part 4: Setting Up the MDM Server and Enrolling Devices

Part 4: Setting Up the MDM Server and Enrolling Devices

Server Setup

  1. Install Required Software on Your Server:

    • Ensure Openssl is installed and configured correctly. Prefer compiling from source to include all necessary features.
    • Install the required Python libraries:
      bash
      pip install web.py M2Crypto PyOpenSSL
  2. Modify APNSWrapper for TLS Compatibility:

    • Edit connections.py in APNSWrapper and change:
      python
      # Original code uses SSLv3 which is no longer supported ssl_version = self.ssl_module.PROTOCOL_TLSv1

Network Settings

  1. Configure Ports and Access:
    • Ensure the server can access gateway.push.apple.com:2195 for outbound communications.
    • Open inbound access on port 8080 for device check-ins.
    • Devices must also access gateway.push.apple.com:5223.

Run the MDM Server

  1. Start the Server:

    • Navigate to the /server directory and run:
      bash
      python server.py
  2. Enroll Devices:

    • On your device, go to https://YOUR_HOST:8080/ and install the CA certificate.
    • Complete enrollment by installing the Enroll.mobileconfig file.

Testing and Managing Devices

  1. Send Test Commands:

    • Use the server interface to send commands like DeviceLock to test server-device communication.
  2. Troubleshooting:

    • Check server logs for errors.
    • If commands fail, review the server settings, network configuration, and device logs.

Maintaining the MDM Server

  1. Updating Certificates:

    • Regularly update certificates to avoid expiration and maintain security.
  2. Device Management:

    • Use the MDM server’s REST endpoints for reporting issues, managing geolocation, and integrating with security apps.

Additional Resources