Kullanıcıları toplu olarak oluşturan ve aynı zamanda bir takma ad oluşturan.net'te yerleşik bir komut dosyam var.
Kullanıcılar Google Yönetici konsolu'nda oluşturulur, ancak e-posta takma adı bilgilerini tamamlamıyor gibi görünüyor. Yönetici konsolunu kontrol ettikten sonra alternatif e-posta alanı boştur
Bu hata iletisidir:
Google.API.İstemler.RequestError Kullanıcı oluşturma tamamlanmadı. [412] Hatalar[Mesaj [Kullanıcı oluşturma tamamlanmadı.] Konum[If - Match-header] Sebep [conditionNotMet] Etki Alanı [global]]]
Bu benim senaryom :
// create new Gmail user
Google.Apis.Admin.Directory.directory_v1.Data.User newuserbody = new Google.Apis.Admin.Directory.directory_v1.Data.User();
UserName newusername = new UserName();
newuserbody.PrimaryEmail = userEmail;
newusername.GivenName = sFirst;
newusername.FamilyName = sLast;
newuserbody.Name = newusername;
newuserbody.Password = sPass;
Google.Apis.Admin.Directory.directory_v1.Data.User
user = service.Users.Insert(newuserbody).Execute();
user = null;
}
catch (Exception e) {
LogMessage("CreateGoogleEmailApps", "Error", String.Format("Google user [{0}] could not be created at this time with error: {1}", sUN, e.Message));
}
try {
// nickname attempt
Alias newalias = new Alias();
newalias.AliasValue = string.Format("username-{0}@{1}", sPass, ASAS_Create.Properties.Settings.Default.G_DOMAIN);
Alias useralias = service.Users.Aliases.Insert(newalias, userEmail).Execute();
newalias = null;
} catch (Exception e) {
//LogMessage("CreateGoogleEmailApps", "Error", String.Format("Google user [{0}]'s alias could not be created at this time.", sUN));
LogMessage("CreateGoogleAliasApps", "Error", string.Format("Google Alias Error for user [{0}] with error message[{1}].", sUN, e.Message));
}