title: iOS MDM : apply Policies (Restrictions) and Wifi Configurations on Device
body: <p>I have completed the iOS MDM Enrollment Phases as well as the APNs push for Commands like DeviceInformation, DeviceLock etc.</p>
  
  <p>Now I am trying to push policies (restrictions) , wifi configurations and passcode over the device. </p>
  
  <p>So currently in my device i have one profile installed which is the MDM Management profile.</p>
  
  <p>Going through this <a href="https://stackoverflow.com/questions/9698228/updating-configuration-profile-installed-in-ios-device-in-mdm">Updating Configuration Profile installed in iOS device in MDM</a> forum, we have to send an InstallProfile Command to the device whenever we want to apply policies.</p>
  
  <p>But when i do so a in my Profiles section under settings -> General -> Profile , i see 2 profiles installed one is my MDM payload and second is the restrictions payload which i had sent.</p>
  
  <p>This is how i am trying to send the Payload</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
      &lt;dict&gt;
          &lt;key&gt;Command&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;RequestType&lt;/key&gt;
              &lt;string&gt;InstallProfile&lt;/string&gt;
              &lt;key&gt;Payload&lt;/key&gt;
              &lt;data&gt;cGhfbWRtX2Jhc2VfNjRfZW5jb2RlZA==&lt;/data&gt;
          &lt;/dict&gt;
          &lt;key&gt;CommandUUID&lt;/key&gt;
          &lt;string&gt;ph_mdm_command_uuid&lt;/string&gt;
      &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>Here Payload value contains the base64 encoded plist for profile this is my profile configuration which is being sent in the Payload of InstallProfile requesttype.</p>
  
  <pre><code>&lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;PayloadContent&lt;/key&gt;
      &lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;PayloadDescription&lt;/key&gt;
              &lt;string&gt;&lt;/string&gt;
              &lt;key&gt;PayloadDisplayName&lt;/key&gt;
              &lt;string&gt;Restrictions&lt;/string&gt;
              &lt;key&gt;PayloadIdentifier&lt;/key&gt;
              &lt;string&gt;com.hQLvCF.mdm.version1.mdm3.restrictions1&lt;/string&gt;
              &lt;key&gt;PayloadOrganization&lt;/key&gt;
              &lt;string&gt;&lt;/string&gt;
              &lt;key&gt;PayloadType&lt;/key&gt;
              &lt;string&gt;com.apple.applicationaccess&lt;/string&gt;
              &lt;key&gt;PayloadUUID&lt;/key&gt;
              &lt;string&gt;E9D5CFA9-4482-47DA-9CFA-5AA7AF4F62DC&lt;/string&gt;
              &lt;key&gt;PayloadVersion&lt;/key&gt;
              &lt;integer&gt;1&lt;/integer&gt;
              &lt;key&gt;allowAddingGameCenterFriends&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowAppInstallation&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowAssistant&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowAssistantWhileLocked&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowBookstoreErotica&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowCamera&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowCloudBackup&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowCloudDocumentSync&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowDiagnosticSubmission&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowExplicitContent&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowGlobalBackgroundFetchWhenRoaming&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowInAppPurchases&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowMultiplayerGaming&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowPassbookWhileLocked&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowPhotoStream&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowSafari&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowScreenShot&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowSharedStream&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowUntrustedTLSPrompt&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowVideoConferencing&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowVoiceDialing&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowYouTube&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;allowiTunes&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;forceEncryptedBackup&lt;/key&gt;
              &lt;false/&gt;
              &lt;key&gt;forceITunesStorePasswordEntry&lt;/key&gt;
              &lt;false/&gt;
              &lt;key&gt;ratingApps&lt;/key&gt;
              &lt;integer&gt;1000&lt;/integer&gt;
              &lt;key&gt;ratingMovies&lt;/key&gt;
              &lt;integer&gt;1000&lt;/integer&gt;
              &lt;key&gt;ratingRegion&lt;/key&gt;
              &lt;string&gt;us&lt;/string&gt;
              &lt;key&gt;ratingTVShows&lt;/key&gt;
              &lt;integer&gt;1000&lt;/integer&gt;
              &lt;key&gt;safariAcceptCookies&lt;/key&gt;
              &lt;integer&gt;2&lt;/integer&gt;
              &lt;key&gt;safariAllowAutoFill&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;safariAllowJavaScript&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;safariAllowPopups&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;safariForceFraudWarning&lt;/key&gt;
              &lt;false/&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
      &lt;key&gt;PayloadDescription&lt;/key&gt;
      &lt;string&gt;Push Policies&lt;/string&gt;
      &lt;key&gt;PayloadDisplayName&lt;/key&gt;
      &lt;string&gt;Policy Push&lt;/string&gt;
      &lt;key&gt;PayloadIdentifier&lt;/key&gt;
      &lt;string&gt;com.hQLvCF.mdm.version1.mdm3&lt;/string&gt;
      &lt;key&gt;PayloadOrganization&lt;/key&gt;
      &lt;string&gt;&lt;/string&gt;
      &lt;key&gt;PayloadRemovalDisallowed&lt;/key&gt;
      &lt;false/&gt;
      &lt;key&gt;PayloadType&lt;/key&gt;
      &lt;string&gt;Configuration&lt;/string&gt;
      &lt;key&gt;PayloadUUID&lt;/key&gt;
      &lt;string&gt;73D449F8-342F-4B53-9786-B888A0203349&lt;/string&gt;
      &lt;key&gt;PayloadVersion&lt;/key&gt;
      &lt;integer&gt;1&lt;/integer&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>so now what happens is it shows this new profile with profile name as "Push Policies" on my device. 
  Similar is the case with wi-fi profile.</p>
  
  <p><b>My Question is:</b> </p>
  
  <p>How do i incorporate this policy payload within the MDM payload and not have a new profile created/ installed. </p>
  
  <p>This new profile is appearing since i have sent an InstallProfile command. I would like this policy or wifi configuration to be within the mdm payload.</p>
  
  <p>Policies and Wifi configurations can be removed or added at any time in the system. So we cannot add default while enrolling the device.</p>
  
  <p>I hope i made myself clear.</p>
  
  <p>Thanks for reading.</p>