Microsoft 365 Grubuna sahipler nasıl eklenir?


Microsoft 365 grubu, kişilerden oluşan bir ekibin e-posta göndermesine ve dosya, takvim ve diğer kaynakları paylaşmasına olanak tanır. Sahip, Microsoft 365 grubunun moderatörüdür ve üye ekleyip kaldırabilir ve grup ayarlarını değiştirebilir. Bu makalede, Microsoft Entra yönetim merkezinde ve PowerShell'de bir Microsoft 365 grubuna nasıl sahip ekleyeceğinizi öğreneceksiniz.

Önkoşullar

Microsoft 365 grubuna grup sahibi eklemeye başlamadan önce Microsoft 365 grubu oluşturmanız gerekir.

Microsoft 365 Grup sahibi

Her kuruluş Microsoft 365'te en fazla 500.000 grup oluşturabilir. Aşağıdaki tabloda Microsoft 365 grup sınırlamaları gösterilmektedir.

Microsoft 365 GroupMaximum value
Number of owners per group100
Number of members per groupMore than 1,000*
Single user can create groups250
Admin can create groups500,000 (default tenant limit)
Number of groups a user can be a member of1,000
File storage1 TB
10 GB per subscribed user
Additional storage purchased (unlimited)
Mailbox size50 GB

*Grup sohbetlerine yalnızca 1.000 kişi birlikte erişebilir.

Not: Kullanıcılar, Outlook'ta büyük gruplar halindeki takvimlere ve görüşmelere erişirken gecikmeler fark edebilir.

Microsoft 365 grubuyla her üyeye manuel olarak izin atamanız gerekmez. Üyelere aynı izinleri otomatik olarak verecek şekilde bir Microsoft 365 grubuna Tam Erişim posta kutusu izni atayabilirsiniz.

Microsoft 365 grubu için en az iki sahibin olması önerilir. Bu şekilde, sahiplerden birinin müsait olmaması durumunda diğeri Microsoft 365 grubunda değişiklik yapabilir.

Microsoft 365 grup sahibi şunları yapabilir:

  • Grup ayarlarını değiştirme
  • Grup üyelerini ekleme veya kaldırma
  • Grubu sil
  • Paylaşılan gelen kutusundaki ileti dizilerini silme
  • Grubu yeniden adlandırın
  • Açıklamayı veya resmi güncelleyin
  • Konuk erişim isteği davetini onaylama

Microsoft Entra ID'de Microsoft 365 grubuna sahip ekleme

Microsoft Entra yönetim merkezinde bir Microsoft 365 grubuna sahip eklemek için şu adımları izleyin:

  1. Microsoft Entra yönetim merkezinde oturum açın
  2. Kimlik > Gruplar > Tüm gruplar 'ı genişletin
  3. Listeden Microsoft 365 veya Güvenlik grup türünü tıklayın

Not: Microsoft Entra ID ve Microsoft Graph PowerShell'de bir Microsoft 365 grubuna ve Güvenlik grubuna sahipler eklemek mümkündür.

  1. Sahipler'i tıklayın

  1. Sahip ekle'yi tıklayın

  1. Kullanıcıları seçin
  2. Seç'i tıklayın

Grup sahiplerini bir Microsoft 365 grubuna başarıyla eklediniz.

Not: Bir Microsoft 365 grubunun en fazla 100 sahibi olabilir. Microsoft Entra yönetim merkezinde en fazla 100 kullanıcı seçip bunları sahip olarak ekleyebilirsiniz.

Microsoft 365 grubuna sahipler nasıl eklenir?

PowerShell ile Microsoft 365 grubuna tek veya birden fazla sahip ekleyebilirsiniz. Bir Microsoft 365 grubunun en fazla 100 sahibi olabilir.

Not: Konuk kullanıcılar, grupların üyesi olsalar bile grupların sahibi olamazlar.

Microsoft Graph PowerShell'e bağlanın

Başlamadan önce Microsoft Graph PowerShell modülünü yüklemelisiniz. Windows PowerShell'i yönetici olarak başlatın ve aşağıdaki komutu çalıştırın.

Install-Module Microsoft.Graph -Force

Önemli: Hataları ve yanlış sonuçları önlemek için bir cmdlet'i veya komut dosyasını çalıştırmadan önce daima Microsoft Graph PowerShell modülü sürümünün en son sürümünü yükleyin.

Microsoft Graph ile kimlik doğrulaması yapmak için Connect-MgGraph cmdlet'ini aşağıdaki kapsamlarla çalıştırın.

Connect-MgGraph -Scopes "User.ReadWrite.All", "Group.ReadWrite.All", "GroupMember.ReadWrite.All"

Artık hazır olduğunuza göre komutları MS Graph PowerShell ile kullanabilirsiniz.

Microsoft 365 Grubuna sahip ekleme

Örneğimizde Microsoft 365 grubuna (Yönetim Ekibi) tek bir sahip ekleyeceğiz. New-MgGroupOwner PowerShell cmdlet'ini kullanacağız.

Microsoft 365 grubuna sahip eklemek için PowerShell sözdizimine bakın.

New-MgGroupOwner -GroupId "Group Object Id" -DirectoryObjectId "Owner Object ID"

MS Graph PowerShell ile bir Microsoft 365 grubuna sahip eklemek için aşağıdaki PowerShell komutunu çalıştırın.

New-MgGroupOwner -GroupId "031f52ea-cb97-40fc-ab0f-73598f3fc66d" -DirectoryObjectId "41377e9c-dc47-46c0-b4a5-1d5bbdcb5cc5"

Microsoft 365 Grubuna birden fazla sahip ekleme

Bir Microsoft 365 grubuna birden fazla sahip eklemek için UserPrincipalName değerini de belirtebilirsiniz.

  1. Eklemek istediğiniz sahiplerin UPN'sini yazın
  2. Grup Nesne Kimliğini yazın
  3. Aşağıdaki PowerShell betiğini çalıştırın
$upns = @(
    "Amanda.Hansen@m365info.com",
    "Oliver.Taylor@m365info.com",
    "Anna.Bell@m365info.com",
)
$GroupId = "031f52ea-cb97-40fc-ab0f-73598f3fc66d"

$Group = Get-MgGroup -GroupId $GroupId -ErrorAction SilentlyContinue

if ($Group) {

    foreach ($upn in $upns) {
        $User = Get-MgUser -Filter "userPrincipalName eq '$upn'"
        
        if ($User) {
            $UserId = $User.Id
            $ExistingOwner = Get-MgGroupOwner -GroupId $GroupId
            
            if ($ExistingOwner.Id -eq $UserId) {
                Write-Host "User $($User.UserPrincipalName) already exists in the group." -ForegroundColor Yellow
            }
            else {
                New-MgGroupOwner -GroupId $GroupId -DirectoryObjectId $UserId
                Write-Host "User $($User.UserPrincipalName) added to the group." -ForegroundColor Green
            }
        }
        else {
            Write-Host "User $upn does not exist." -ForegroundColor Red
        }
    }
}
else {
    Write-Host "Group $GroupId does not exist." -ForegroundColor Red
}

Microsoft 365 Grubuna toplu sahipler ekleme

PowerShell ile tüm sahipleri tek bir Microsoft 365 grubuna ekleyebilirsiniz.

Not: Bir Microsoft 365 grubunun en fazla 100 sahibi olabilir. Tüm kullanıcıları sahip olarak eklediğinizde yalnızca ilk 100 kullanıcı alfabetik sıraya göre eklenecektir.

  1. 1 numaralı satırda Microsoft 365 Grup Kimliğini belirtin
  2. Kullanıcıları tek bir Microsoft 365 grubuna sahip olarak eklemek için aşağıdaki PowerShell betiğini çalıştırın
$GroupId = "031f52ea-cb97-40fc-ab0f-73598f3fc66d"

$Group = Get-MgGroup -GroupId $GroupId -ErrorAction SilentlyContinue

if ($Group) {
    $Users = Get-MgUser -All
    
    foreach ($User in $Users) {
        $ExistingOwner = Get-MgGroupOwner -GroupId $GroupId
        
        if ($ExistingOwner.Id -eq $User.Id) {
            Write-Host "User $($User.UserPrincipalName) already exists as owner of the group." -ForegroundColor Yellow
        }
        else {
            New-MgGroupOwner -GroupId $GroupId -DirectoryObjectId $User.Id
            Write-Host "User $($User.UserPrincipalName) added as owner of the group." -ForegroundColor Green
        }
    }
}
else {
    Write-Host "Group $GroupId does not exist." -ForegroundColor Red
}

Sahipler maksimum 100'e ulaşırsa aşağıdaki hatayı alırsınız.

'101', ileri bağlantı 'sahipleri' için maksimum '100' kota sayısını aşacağından işlem gerçekleştirilemiyor.

Belirli departmanların sahiplerini Microsoft 365 Grubuna ekleme

Örneğimizde, Pazarlama departmanındaki tüm kullanıcıları Microsoft 365 grubuna (ManagementTeam@m365info.com) eklemek istiyoruz. -Filter parametresini eşitlik karşılaştırma operatörü (-eq) operatörüyle birlikte kullanacağız. PowerShell'de Karşılaştırma Operatörleri Nasıl Kullanılır bölümünde bunun hakkında daha fazla bilgi edinebilirsiniz.

  1. 1. satıra Microsoft 365 Grup Kimliğini yazın
  2. Aşağıdaki PowerShell betiğini çalıştırın
$GroupId = "031f52ea-cb97-40fc-ab0f-73598f3fc66d"

$Group = Get-MgGroup -GroupId $GroupId -ErrorAction SilentlyContinue

if ($Group) {
    $Users = Get-MgUser -All -Filter "Department eq 'Marketing'"
    
    foreach ($User in $Users) {
        $ExistingOwner = Get-MgGroupOwner -GroupId $GroupId
        
        if ($ExistingOwner.Id -eq $User.Id) {
            Write-Host "User $($User.UserPrincipalName) already exists as owner of the group." -ForegroundColor Yellow
        }
        else {
            New-MgGroupOwner -GroupId $GroupId -DirectoryObjectId $User.Id
            Write-Host "User $($User.UserPrincipalName) added as owner of the group." -ForegroundColor Green
        }
    }
}
else {
    Write-Host "Group $GroupId does not exist." -ForegroundColor Red
}

Pazarlama departmanındaki herkesi Microsoft 365 grubunun (ManagementTeam@m365info.com) sahipleri olarak ekleyecektir.

CSV'den Microsoft 365 Grubuna birden fazla sahip ekleme

Tek bir Microsoft 365 grubuna birden fazla sahip eklemek için CSV dosyası kullanmamız gerekir.

İki sütunlu bir CSV dosyası oluşturun:

  1. Microsoft Excel'i açın
  2. İlk sütunun başlığı olarak UPN yazın
  3. UserPrincipalName'i belirtin
  4. İkinci sütunun başlığı olarak SahipKimliği yazın
  5. Nesne Kimliğini sahibini belirtin

  1. Zaten (C:) sürücüsünde yoksa, temp klasörünü oluşturun
  2. Dosyayı M365users.csv olarak adlandırın
  3. CSV (Virgülle ayrılmış (*.csv) türü olarak kaydet)
  4. Kaydet'i tıklayın

  1. 1. satırda CSV dosya yolunu belirtin
  2. 2. satıra Microsoft 365 Grup Kimliğini yazın
  3. Aşağıdaki PowerShell betiğini çalıştırın
$CsvFilePath = "C:\temp\M365users.csv"
$GroupId = "031f52ea-cb97-40fc-ab0f-73598f3fc66d"

$Group = Get-MgGroup -GroupId $GroupId -ErrorAction SilentlyContinue

if ($Group) {
    $CsvUsers = Import-Csv -Path $CsvFilePath

    foreach ($CsvUser in $CsvUsers) {
        $CsvUserID = $CsvUser.UserId
        $User = Get-MgUser -Filter "Id eq '$CsvUserID'" -ErrorAction SilentlyContinue
         
        if ($User) {
            $UserId = $User.Id
            $ExistingOwner = Get-MgGroupOwner -GroupId $GroupId

            if ($ExistingOwner.Id -eq $UserId) {
                Write-Host "User $($User.UserPrincipalName) already exists as owner of the group." -ForegroundColor Yellow
            }
            else {
                New-MgGroupOwner -GroupId $GroupId -DirectoryObjectId $UserId
                Write-Host "User $($User.UserPrincipalName) added as owner of the group." -ForegroundColor Green
            }
        }
        else {
            Write-Host "User $CsvUserID does not exist." -ForegroundColor Red
        }
    }
}
else {
    Write-Host "Group $GroupId does not exist." -ForegroundColor Red
}

PowerShell çıktı sonucu şunu gösterir:

  • Microsoft 365 grubu mevcut değil veya yanlış yazılmış
  • Kullanıcı zaten Microsoft 365 grubunun sahibi olarak mevcut
  • Kullanıcı Microsoft 365 grubunun sahibi olarak eklenir
  • Kullanıcı mevcut değil veya yanlış yazılmış

CSV'den birden fazla Microsoft 365 Grubuna sahip ekleme

Bir CSV dosyasından birden fazla Microsoft 365 grubuna sahip ekleyebilirsiniz. Dört sütundan oluşan bir CSV dosyası oluşturmanız gerekir. İlk iki sütun Microsoft 365 gruplarının listesini içerecektir. Üçüncü ve dördüncü sütunlar, sahip olarak eklemek istediğiniz kullanıcıların listesini içerecektir.

Dört sütunlu bir CSV dosyası oluşturun:

  1. Microsoft Excel'i açın
  2. İlk sütunun başlığı olarak GrupAdı yazın
  3. Microsoft 365 grup e-postasını belirtin
  4. İkinci sütunun başlığı olarak GrupKimliği yazın
  5. Microsoft 365 Grup Kimliğini belirtin
  6. Üçüncü sütunun başlığı olarak KullanıcıAdı yazın
  7. UserPrincipalName sahibini belirtin
  8. Dördüncü sütunun başlığı olarak SahipKimliği yazın
  9. Nesne Kimliğini sahibini belirtin

Aşağıdaki CSV dosyası örneğine bakın.

  1. Zaten (C:) sürücüsünde yoksa, temp klasörünü oluşturun
  2. Dosyayı M365owners.csv olarak adlandırın
  3. CSV (Virgülle ayrılmış (*.csv) türü olarak kaydet)
  4. Kaydet'i tıklayın

  1. 1. satırda CSV dosya yolunu belirtin
  2. Aşağıdaki PowerShell betiğini çalıştırın
$CsvFilePath = "C:\temp\M365owners.csv"

$Csv = Import-Csv $CsvFilePath

foreach ($row in $Csv) {
    $GroupId = $Row.GroupID
    $OwnerId = $Row.OwnerID

    $Group = Get-MgGroup -GroupId $GroupId -ErrorAction SilentlyContinue

    if ($Group) {
        $ExistingOwner = Get-MgGroupOwner -GroupId $GroupId
    
        if ($ExistingOwner.Id -eq $OwnerId) {
            Write-Host "User $OwnerId already exists in the group." -ForegroundColor Yellow
        }
        else {
            $User = Get-MgUser -Filter "Id eq '$OwnerId'" -ErrorAction SilentlyContinue
    
            if ($User) {
                New-MgGroupOwner -GroupId $GroupId -DirectoryObjectId $OwnerId
                Write-Host "User $OwnerId added to the group." -ForegroundColor Green 
            }
            else {
                Write-Host "User $OwnerId doesn't exist" -ForegroundColor Red
            }
        }
    }
    else {
        Write-Host "Group $GroupId does not exist." -ForegroundColor Red
    }
}

PowerShell çıktı sonucu şunu gösterir:

  • Microsoft 365 grubu mevcut değil veya yanlış yazılmış
  • Kullanıcı zaten Microsoft 365 grubunun sahibidir
  • Kullanıcı Microsoft 365 grubuna eklenir
  • Kullanıcı mevcut değil veya yanlış yazılmış

CSV ile tüm Microsoft 365 Gruplarına tek sahip ekleme

Birden fazla Microsoft 365 grubuna sahip eklemek için CSV dosyası oluşturmanız gerekir.

Örneğimizde, (Amanda Hansen) kullanıcısını birden çok Microsoft 365 grubuna sahip olarak eklemek istiyoruz.

İki sütunlu bir CSV dosyası oluşturun:

  1. Microsoft Excel'i açın
  2. İlk sütunun başlığı olarak Grup yazın
  3. Microsoft 365 grubunun birincil SMTP adresini belirtin
  4. İkinci sütunun başlığı olarak ObjectID yazın
  5. Microsoft 365 grubunun Nesne Kimliğini belirtin

  1. Zaten (C:) sürücüsünde yoksa, temp klasörünü oluşturun
  2. Dosyayı M365groups.csv olarak adlandırın
  3. CSV (Virgülle ayrılmış (*.csv) türü olarak kaydet)
  4. Kaydet'i tıklayın

  1. 1. satırda CSV dosya yolunu belirtin
  2. 2. satıra sahibin Nesne Kimliğini yazın
  3. Aşağıdaki PowerShell betiğini çalıştırın
$CsvFilePath = "C:\temp\M365groups.csv"
$UserId = "41377e9c-dc47-46c0-b4a5-1d5bbdcb5cc5"

# Check if the user exists
$User = Get-MgUser -UserId $UserId -ErrorAction SilentlyContinue

if ($User) {
    $CsvGroups = Import-Csv -Path $CsvFilePath

    foreach ($row in $CsvGroups) {
        $GroupId = $Row.ObjectID

        $Group = Get-MgGroup -GroupId $GroupId -ErrorAction SilentlyContinue

        if ($Group) {
            $ExistingOwner = Get-MgGroupOwner -GroupId $GroupId
            
            if ($ExistingOwner.Id -eq $UserId) {
                Write-Host "User $UserId already exists in the group." -ForegroundColor Yellow
            }
            else {
                New-MgGroupOwner -GroupId $GroupId -DirectoryObjectId $UserId
                Write-Host "User $UserId added to the group." -ForegroundColor Green
            }
        }
        else {
            Write-Host "Group $GroupId does not exist." -ForegroundColor Red
        }
    }
}
else {
    Write-Host "User $UserId does not exist." -ForegroundColor Red
}

Bu kadar!

Devamını oku: PowerShell ile Dağıtım Grubuna sahipler nasıl eklenir »

Çözüm

Microsoft Entra yönetim merkezinde ve PowerShell ile bir Microsoft 365 grubuna nasıl sahip ekleyeceğinizi öğrendiniz. Bir Microsoft 365 grubuna tek, birden fazla ve tüm kullanıcıları sahip olarak ekleyebilirsiniz. Microsoft 365 grubu başına yalnızca 100'e kadar sahip ekleyebileceğinizi unutmayın.

Bu makaleyi beğendiniz mi? Ayrıca PowerShell'de Mantıksal Operatörler nasıl kullanılır konusunu da beğenebilirsiniz. Bizi takip etmeyi ve bu yazımızı paylaşmayı unutmayın.

İlgili makaleler