Migrating from Domain Service to the Admin SDK Advanced Services

The Domain service, which allows G Suite domain administrators to manage users and groups, is deprecated as of May 15, 2014, and will be turned off on November 20, 2014. The service is replaced by the recently added Admin SDK Directory and Admin SDK Reports advanced services. This page outlines the migration path from Domain service to its new replacement, Admin SDK.

Method comparison

The table below provides an overview of the methods used in Domain service and their equivalent methods (if any) in Admin SDK.

Domain services method Admin SDK method
DomainGroup.addMember(memberId) AdminDirectory.Members.insert(resource, groupKey)
In Admin SDK, a member's role in a group can be specified via role.
DomainGroup.addOwner(ownerId)
DomainGroup.deleteGroup() AdminDirectory.Groups.remove(groupKey)
DomainGroup.getAllMembers() AdminDirectory.Members.list(groupKey, optionalArgs)
In Admin SDK, owner(s) can be listed using the optional roles parameter.
DomainGroup.getAllOwners()
DomainGroup.getDescription() AdminDirectory.Groups.get(groupKey)
Property: description
Property: id
Property: name
DomainGroup.getId()
DomainGroup.getName()
DomainGroup.getPermissionLevel() N/A
DomainGroup.removeMember(memberId) AdminDirectory.Members.remove(groupKey, memberKey)
DomainGroup.removeOwner(ownerId)
DomainGroup.setDescription(description) AdminDirectory.Groups.patch(resource, groupKey)
Property: description
Property: name
DomainGroup.setName(name)
DomainGroup.setPermissionLevel(level) N/A
DomainNickname.deleteNickname() AdminDirectory.Users.Aliases.remove(userKey, alias)
DomainNickname.getNickname() AdminDirectory.Users.Aliases.list(userKey, optionalArgs)
Property: aliases
Property: primaryEmail
DomainNickname.getUsername()
DomainUser.deleteUser() AdminDirectory.Users.remove(userKey)
DomainUser.getAgreedToTerms() AdminDirectory.Users.get(userKey)
Property: agreedToTerms
Property: changePasswordAtNextLogin
Property: primaryEmail
Property: name.familyName
Property: name.givenName
Property: isAdmin
Property: suspended
DomainUser.getChangePasswordAtNextLogin()
DomainUser.getEmail()
DomainUser.getFamilyName()
DomainUser.getGivenName()
DomainUser.getIsAdmin()
DomainUser.getIsSuspended()
DomainUser.getStorageQuota() AdminReports.UserUsageReport.get(userKey, date, optionalArgs)
Account: total_quota_in_mb
DomainUser.setChangePasswordAtNext Login(changePassword) AdminDirectory.Users.patch(resource, userKey)
Property: changePasswordAtNextLogin
Property: name.familyName
Property: name.givenName
DomainUser.setFamilyName(name)
DomainUser.setGivenName(name)
DomainUser.setIsAdmin(admin) AdminDirectory.Users.makeAdmin(resource, userKey)
Property: isAdmin
DomainUser.setIsSuspended(suspended) AdminDirectory.Users.patch(resource, userKey)
Property: suspended
Property: password
Property: primaryEmail
DomainUser.setPassword(password)
DomainUser.setUsername(username)
GroupsManager.createGroup(groupId, name, description, permissionLevel) GroupsManager.createGroup(groupId, name) AdminDirectory.Groups.insert(resource)
Setting the permission level isn't supported in the Admin SDK.
GroupsManager.getAllGroups()
GroupsManager.getAllGroups(memberId)
AdminDirectory.Groups.list(optionalArgs)
Parameter: userKey
GroupsManager.getDomain()
NicknameManager.getDomain()
UserManager.getDomain()
N/A
As a workaround, get a single user's email address and extract the domain.
GroupsManager.getGroup(groupId) AdminDirectory.Groups.get(groupKey)
NicknameManager.createNickname(username, nickname) AdminDirectory.Users.Aliases.insert(resource, userKey)
NicknameManager.getAllNicknames() N/A
NicknameManager.getAllNicknames(username) AdminDirectory.Users.Aliases.list(userKey, optionalArgs)
You will need to loop through the results to find the nickname.
NicknameManager.getNickname(nickname)
UserManager.createUser(username, givenName, familyName, password) UserManager.createUser(username, givenName, familyName, password, passwordHashFunction) AdminDirectory.Users.insert(resource)
Property: hashFunction
UserManager.getAllUsers() AdminDirectory.Users.list(optionalArgs)
Either the customer or the domain parameter must be provided. As an account administrator, you can also use the my_customer alias to represent your account's customerId.
UserManager.getUser(user)
UserManager.getUser(username)
AdminDirectory.Users.get(userKey)

New features in Admin SDK

In addition to the supported methods outlined above, the Admin SDK advanced services provide the following new features:

Feature Admin SDK class or method
Admin notifications AdminDirectory.Notifications
Application-specific passwords AdminDirectory.Asps
Device management AdminDirectory.Chromeosdevices
AdminDirectory.Mobiledevices
Group aliases AdminDirectory.Groups.Aliases
OAuth tokens AdminDirectory.Tokens
Org units AdminDirectory.Orgunits
Reporting AdminReports
Search for users AdminDirectory.Users.list(optionalArgs)
Parameter: query
Un-delete users AdminDirectory.Users.undelete()
User data AdminDirectory.Users.get(userKey)
User photo AdminDirectory.Users.Photos.get(userKey)
Verification codes (2-factor) AdminDirectory.VerificationCodes

Send feedback about...

Apps Script
Apps Script