-1

I'm not seeing my posixAccounts information from the following link: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/get

{
  "kind": "admin#directory#user",
  "id": "8675309",
  "etag": "\"UUID\"",
  "primaryEmail": "email@example.com",
  "name": {
    "givenName": "Email",
    "familyName": "Account",
    "fullName": "Email Account"
  },
  "isAdmin": true,
  "isDelegatedAdmin": false,
  "lastLoginTime": "2021-08-04T21:11:17.000Z",
  "creationTime": "2021-06-16T14:32:35.000Z",
  "agreedToTerms": true,
  "suspended": false,
  "archived": false,
  "changePasswordAtNextLogin": false,
  "ipWhitelisted": false,
  "emails": [
    {
      "address": "email@example.com",
      "primary": true
    },
    {
      "address": "email@example.com.test-google-a.com"
    }
  ],
  "phones": [
    {
      "value": "123-456-7890",
      "type": "work"
    }
  ],
  "nonEditableAliases": [
    "email@example.com.test-google-a.com"
  ],
  "customerId": "id12345",
  "orgUnitPath": "/path/to/org",
  "isMailboxSetup": true,
  "isEnrolledIn2Sv": false,
  "isEnforcedIn2Sv": false,
  "includeInGlobalAddressList": true
}

As you can see from the above output, there's no posixAccount information. I can open the ldap information in Apache Directory studio, so I know it's there, but I can't see it from the above output. Since I can see it though, I tried to update this using the update function in the API.

https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/update

I used this for the payload as I'm just testing updating the gid information. I used the documentation below to get the entry details needed. At least as far as I could tell.

{
  "posixAccounts": [
    {
      "gid": "12345",
    }
  ]
}

https://developers.google.com/admin-sdk/directory/reference/rest/v1/users

I'm getting a 200 response, but nothing is actually changing for the user when doing a PUT to update.

I tried a similar update method from another user on here, but no avail: Google Admin SDK - Create posix attributes on existing user

Kyle
  • 11
  • 3
  • Can you add in some reproduction steps to your question? Its hard to know whats wrong without knowing exactly what you are doing or how you have set it up. – iansedano Aug 05 '21 at 07:13
  • Understood. I've made an update with additional details. Thank you for the feedback. – Kyle Aug 05 '21 at 14:45

1 Answers1

1

I was able to get this resolved by supplying additional details in my PUT request:

{
  "posixAccounts": [
    {
      "username": "email(excluding @domain.com)",
      "uid": "1234",
      "gid": "12345",
      "operatingSystemType": "unspecified",
      "shell": "/bin/bash",
      "gecos": "Firstname Lastname"
      "systemId": ""
    }
  ]
}

The above wouldn't reflect in LDAP until I put "systemId" in there. So that part is required.

Kyle
  • 11
  • 3