title: Microsoft Graph - Create user without onPremisesImmutableId on a Federated Domain
body: <p>We are trying to create a User on a Federated domain, without sending the JSON field <code>onPremisesImmutableId</code>. As documented on the <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_post_users" rel="nofollow noreferrer">Create User</a> page, this field becomes mandatory in such cases.</p>
  
  <p>When we issue such a request, the HTTP response status code is strangely 400 without a proper message in the response payload. Below is a sample.</p>
  
  <p>Is it possible to get an accurate message as to why the request failed? The reason why we're asking is, before making this domain Federated, the same request was working perfectly fine, but not anymore. It took us hours to figure out what went wrong and the documentation finally gave a clue.</p>
  
  <pre><code>Request:
  Invoke-WebRequest -Method POST https://graph.microsoft.com/v1.0/users -Headers @{"Authorization"="Bearer &lt;access_token&gt;"} -Body '{"accountEnabled":true,"displayName": "displayName-value","mailNickname": "mailNickname-value",  "userPrincipalName": "blah-blah","passwordProfile":{"password": "bleh"}}' -ContentType 'application/json'
  </code></pre>
  
  <p>===============</p>
  
  <pre><code>Response:
      status: 400 Bad Request
      Date: Thu, 06 Apr 2017 19:35:32 GMT
      x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"South India","Slice":"SliceA","ScaleUnit":"000","Host":"AGSFE_IN_1","ADSiteName":"MAA"}}
      Duration: 148.322
      client-request-id: 516c451a-1052-4918-9671-2ebfa8d2f795
      Content-Type: application/json
      Access-Control-Allow-Origin: *
      Access-Control-Expose-Headers: ETag, Location, Preference-Applied, Content-Range, request-id, client-request-id
      Cache-Control: private
      Transfer-Encoding: chunked
      request-id: 516c451a-1052-4918-9671-2ebfa8d2f795
  
   {
    "error": {
      "code": "Request_BadRequest",
      "message": "One or more properties contains invalid values.",
      "innerError": {
        "request-id": "516c451a-1052-4918-9671-2ebfa8d2f795",
        "date": "2017-04-06T19:35:32"
      }
    }
  }
  </code></pre>