customSchemas

10 views
Skip to first unread message

Tacim BULUT

unread,
Feb 1, 2022, 6:32:21 AMFeb 1
to Foresight Community
I want users to be members of the te...@xxxxxxx.com group based on the information entered in the customSchemas information. I started in the example below but got stuck on the first step up the mountain.

function addAllOUUsersToGroup() {
let pageToken
let page
do {
page = AdminDirectory.Users.list({
domain: 'domain.xxx.xx',
orderBy: 'givenName',
projection:'custom',
customFieldMask: 'tacim',
//maxResults: 100,
pageToken: pageToken
});
var users = page.users;
if (users) {
for (var i = 0; i < users.length; i++) {
var user = users[i];

try { // Try to get the users department if there is an error push the error to the array
var userEmail = user.primaryEmail
var rehbertum = 'te...@xxxxx.xxx.txxr'

var member = {
email: userEmail,
role: 'MEMBER'
};
var ozelalan = users.tacim[0].deneme;
Logger.log(ozelalan);
/*
if(users.tacim[0].deneme=='aa'){
Logger.log('%s,%s,%s)',user.name.fullName,ozelalan);
member = AdminDirectory.Members.insert(member, rehbertum);
}
*/

} catch (e) {
department = e
//Logger.log(department);
}
}
}
pageToken = page.nextPageToken;
} while (pageToken);
}

Jason Huang

unread,
Feb 1, 2022, 1:34:04 PMFeb 1
to Foresight Community, Tacim BULUT
Hello, we do not offer Google Apps Script support in this Foresight community. If you're looking for custom software development service, please reach out to us at con...@xfanatical.com. Thanks.
Reply all
Reply to author
Forward
0 new messages