private PowerShellResults <AdminRoleGroupRow> AddRoleAssignments(IEnumerable <Identity> addedRoles, ManagementRoleAssignments roleAssignmentsWebService, Identity identity, ManagementScopeRow scopeRow, ExtendedOrganizationalUnit ouRow, PowerShellResults <AdminRoleGroupRow> results)
 {
     if (addedRoles != null)
     {
         foreach (Identity identity2 in addedRoles)
         {
             NewManagementRoleAssignment newManagementRoleAssignment = new NewManagementRoleAssignment();
             newManagementRoleAssignment.Role          = identity2;
             newManagementRoleAssignment.SecurityGroup = identity.RawIdentity;
             this.SetScopeInfoInParameter(identity2, newManagementRoleAssignment, scopeRow, ouRow, results);
             if (results.Failed)
             {
                 return(results);
             }
             results.MergeErrors <ManagementRoleAssignment>(roleAssignmentsWebService.NewObject(newManagementRoleAssignment));
         }
         return(results);
     }
     return(results);
 }
Exemple #2
0
 public PowerShellResults <ManagementRoleAssignment> NewObject(NewManagementRoleAssignment properties)
 {
     return(base.NewObject <ManagementRoleAssignment, NewManagementRoleAssignment>("New-ManagementRoleAssignment", properties));
 }