internal static AzureADGroupUser CreateFrom(PnP.Framework.Entities.GroupUser entity)
        {
            var o = new AzureADGroupUser
            {
                UserPrincipalName = entity.UserPrincipalName,
                DisplayName       = entity.DisplayName
            };

            return(o);
        }
Example #2
0
        protected override void ExecuteCmdlet()
        {
            AzureADGroup group = null;

            if (Identity != null)
            {
                group = Identity.GetGroup(AccessToken);
            }

            if (group != null)
            {
                // Get Owners of the group
                List <GroupUser> owners = GroupsUtility.GetGroupOwners(group.Convert(), AccessToken);
                if (owners.Any())
                {
                    WriteObject(owners.Select(o => AzureADGroupUser.CreateFrom(o)), true);
                }
            }
        }