public Group CreateGroup() { string groupname = TestUtilities.GenerateName("adgroup"); string mailNickName = groupname + "tester"; GroupCreateParameters parameters = new GroupCreateParameters(); parameters.DisplayName = groupname; parameters.MailEnabled = false; parameters.SecurityEnabled = true; parameters.MailNickname = mailNickName; return GraphClient.Group.Create(parameters).Group; }
private Group CreateNewAdGroup(ResourcesController controllerAdmin) { var parameter = new GroupCreateParameters { DisplayName = TestUtilities.GenerateName("adgroup"), MailNickname = TestUtilities.GenerateName("adgroupmail"), SecurityEnabled = true }; return controllerAdmin.GraphClient.Group.Create(parameter).Group; }
/// <summary> /// Create a group in the directory. (see /// http://msdn.microsoft.com/en-us/library/azure/dn151614.aspx for /// more information) /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Graph.RBAC.IGroupOperations. /// </param> /// <param name='parameters'> /// Required. Parameters to create a group /// </param> /// <returns> /// Server response for Get group information API call /// </returns> public static Task<GroupGetResult> CreateAsync(this IGroupOperations operations, GroupCreateParameters parameters) { return operations.CreateAsync(parameters, CancellationToken.None); }
/// <summary> /// Create a group in the directory. (see /// http://msdn.microsoft.com/en-us/library/azure/dn151614.aspx for /// more information) /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Graph.RBAC.IGroupOperations. /// </param> /// <param name='parameters'> /// Required. Parameters to create a group /// </param> /// <returns> /// Server response for Get group information API call /// </returns> public static GroupGetResult Create(this IGroupOperations operations, GroupCreateParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IGroupOperations)s).CreateAsync(parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
private ADGroup CreateNewAdGroup(ResourcesController controllerAdmin) { var parameter = new GroupCreateParameters { DisplayName = TestUtilities.GenerateName("adgroup"), MailNickname = TestUtilities.GenerateName("adgroupmail") }; return controllerAdmin.GraphClient.Groups.Create(parameter); }