コード例 #1
0
        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;
        }
コード例 #2
0
 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;
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
 /// <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();
 }
コード例 #5
0
 private ADGroup CreateNewAdGroup(ResourcesController controllerAdmin)
 {
     var parameter = new GroupCreateParameters
     {
         DisplayName = TestUtilities.GenerateName("adgroup"),
         MailNickname = TestUtilities.GenerateName("adgroupmail")
     };
     return controllerAdmin.GraphClient.Groups.Create(parameter);
 }