วันจันทร์ที่ 21 สิงหาคม พ.ศ. 2566

Prevent users create Office 365 group

 Prevent users create group (Office365 and Microsoft Teams)

1.Make Sure that install only AzureADPreview

    Get-InstalledModule -Name "AzureAD*"

    Uninstall-Module AzureAD

    Uninstall-Module AzureADPreview


2.Install Module

    Install-Module AzureADPreview


3.Import Module

    Import-Module AzureADPreview


4. Connect username and pwd

    Connect-AzureAD


5.Let check paramiter 

    (Get-AzureADDirectorySetting).Values

            GroupCreationAllowedGroupId = null

            EnableGroupCreation = True


6.Create Security Group on Office365

    Get-AzureADGroup -SearchString "Client_Adm"


7.run_Script


$Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id

$Setting["EnableGroupCreation"] = $False

$Setting["GroupCreationAllowedGroupId"] = (Get-AzureADGroup -SearchString "Client_Adm").objectid

Set-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id -DirectorySetting $Setting



8.Let check

    (Get-AzureADDirectorySetting).Values


=Revert=


https://blog.djurasovic.com/step-by-steps-instruction-how-to-disable-creation-of-office-365-groups/

ไม่มีความคิดเห็น:

แสดงความคิดเห็น