From 6cd1845e904bcee18f799ccadc5b5c9aa3634037 Mon Sep 17 00:00:00 2001 From: Reshmee Auckloo Date: Mon, 28 Oct 2024 08:04:19 +0000 Subject: [PATCH 1/2] new cmdlet prevent guest account --- .../README.md | 83 ++++++++++++++++++ .../assets/example.png | Bin 0 -> 18412 bytes .../assets/sample.json | 62 +++++++++++++ 3 files changed, 145 insertions(+) create mode 100644 scripts/aad-control-guestaccount-m365-groups-teams/README.md create mode 100644 scripts/aad-control-guestaccount-m365-groups-teams/assets/example.png create mode 100644 scripts/aad-control-guestaccount-m365-groups-teams/assets/sample.json diff --git a/scripts/aad-control-guestaccount-m365-groups-teams/README.md b/scripts/aad-control-guestaccount-m365-groups-teams/README.md new file mode 100644 index 00000000..9a69aca5 --- /dev/null +++ b/scripts/aad-control-guestaccount-m365-groups-teams/README.md @@ -0,0 +1,83 @@ +--- +plugin: add-to-gallery +--- + +# Automate Renewal of Expiring M365 Groups or or Microsoft Teams teams + +## Summary + +By default, guest access for Microsoft 365 groups is enabled within the tenant. This can be controlled either to allow or block guest access at the tenant level or for individual Microsoft 365 groups / Microsoft Teams team. For more information, check out [Manage guest access in Microsoft 365 groups](https://learn.microsoft.com/en-us/microsoft-365/admin/create-groups/manage-guest-access-in-groups?view=o365-worldwide&wt.mc_id=MVP_308367). + +This script will enable or disable adding guests to a Microsoft 365 Group or Microsoft Teams team. + +![Example Screenshot](assets/example.png) + +# [PnP PowerShell](#tab/pnpps) + +```powershell +param ( + [Parameter(Mandatory = $true)] + [string] $domain, + [Parameter(Mandatory = $true)] + [ValidateSet("true", "false")] + [string] $allowToAddGuests +) + +$adminSiteURL = "https://$domain-Admin.SharePoint.com" +$dateTime = "_{0:MM_dd_yy}_{0:HH_mm_ss}" -f (Get-Date) +$invocation = (Get-Variable MyInvocation).Value +$directorypath = Split-Path $invocation.MyCommand.Path +$fileName = "m365_disable_addguests" + $dateTime + ".csv" +$outputPath = $directorypath + "\"+ $fileName + +if (-not (Test-Path $outputPath)) { + New-Item -ItemType File -Path $outputPath +} +Connect-PnPOnline -Url $adminSiteURL -Interactive -WarningAction SilentlyContinue +# amend as required to be the correct filter +$report = Get-PnPMicrosoft365Group -Filter "startswith(displayName, 'test')" | ForEach-Object { + $group = $_ + + $groupSettings = Get-PnPMicrosoft365GroupSettings -Identity $group.Id + if (-Not $groupSettings) + { + $groupSettings = New-PnPMicrosoft365GroupSettings -Identity $group.Id -DisplayName "Group.Unified.Guest" -TemplateId "08d542b9-071f-4e16-94b0-74abb372e3d9" -Values @{"AllowToAddGuests"=$allowToAddGuests} + } + if (($groupSettings.Values | Where-Object { $_.Name -eq "AllowToAddGuests"}).Value.ToString() -ne $allowToAddGuests) + { + $groupSettings = Set-PnPMicrosoft365GroupSettings -Identity $groupSettings.ID -Group $group.Id -Values @{"AllowToAddGuests"=$allowToAddGuests} + } + + #retrieving the details to ensure the settings are applied + $groupSettings = Get-PnPMicrosoft365GroupSettings -Identity $group.Id + $allowToAddGuestsValue = ($groupSettings.Values | Where-Object { $_.Name -eq "AllowToAddGuests"}).Value.ToString() + [PSCustomObject]@{ + id = $group.Id + Description = $group.Description + DisplayName = $group.DisplayName + m365GroupAllowToAddGuests = $allowToAddGuestsValue ?? "Default" + } +} +$report |select * |Export-Csv $outputPath -NoTypeInformation -Append +Disconnect-PnPOnline +``` + +[!INCLUDE [More about PnP PowerShell](../../docfx/includes/MORE-PNPPS.md)] + +*** + +## Source Credit + +Sample first appeared on [Prevent Guests from Being Added to a Specific Microsoft 365 Group or Microsoft Teams team using PnP PowerShell](https://reshmeeauckloo.com/posts/powershell-m365Group-disable-add-guests/) + + +## Contributors + +| Author(s) | +|-----------| +| [Reshmee Auckloo](https://github.com/reshmee011) | + + +[!INCLUDE [DISCLAIMER](../../docfx/includes/DISCLAIMER.md)] + + diff --git a/scripts/aad-control-guestaccount-m365-groups-teams/assets/example.png b/scripts/aad-control-guestaccount-m365-groups-teams/assets/example.png new file mode 100644 index 0000000000000000000000000000000000000000..3b44b07782fd0ae88c3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_?&pin9c9|`~B@Ler&xS zXS^PIs7kQ7{crdEE3CaBrYal(IS9gDkat)xsS0>b!{6i4`Foebk6{r9_kW(xE&n19 zTQ7dj`tOSbh%O0YhFUO>Yk~Wcv@OTQz{SkB;vv2~K;8*1cs8lyaa2mnkN=OjSM2gg RX}tyVxTmY1%Q~loCID}4jGzDj literal 0 HcmV?d00001 diff --git a/scripts/aad-control-guestaccount-m365-groups-teams/assets/sample.json b/scripts/aad-control-guestaccount-m365-groups-teams/assets/sample.json new file mode 100644 index 00000000..f2a4475d --- /dev/null +++ b/scripts/aad-control-guestaccount-m365-groups-teams/assets/sample.json @@ -0,0 +1,62 @@ +[ + { + "name": "aad-control-guestaccount-m365-groups-teams", + "source": "pnp", + "title": "Prevent Guests from Being Added to a Specific Microsoft 365 Group or Microsoft Teams team", + "shortDescription": "Prevent Guests from Being Added to a Specific Microsoft 365 Group or Microsoft Teams team", + "url": "https://pnp.github.io/script-samples/aad-control-guestaccount-m365-groups-teams/README.html", + "longDescription": [ + "Prevent Guests from Being Added to a Specific Microsoft 365 Group or Microsoft Teams team" + ], + "creationDateTime": "2024-10-27", + "updateDateTime": "2024-10-27", + "products": [ + "SharePoint", + "Microsoft Teams", + "Microsoft 365 Group" + ], + "metadata": [ + { + "key": "PNP-POWERSHELL", + "value": "2.99.0" + } + ], + "categories": [ + "Governance", + "Deploy", + "Provision" + ], + "tags": [ + "modern", + "Connect-PnPOnline", + "Disconnect-PnPOnline", + "Get-PnPMicrosoft365GroupSettings", + "New-PnPMicrosoft365GroupSettings", + "Set-PnPMicrosoft365GroupSettings", + "Get-PnPMicrosoft365Group" + ], + "thumbnails": [ + { + "type": "image", + "order": 100, + "url": "https://raw.githubusercontent.com/pnp/script-samples/main/scripts/aad-control-guestaccount-m365-groups-teams/assets/example.png", + "alt": "" + } + ], + "authors": [ + { + "gitHubAccount": "reshmee011", + "company": "", + "pictureUrl": "https://avatars.githubusercontent.com/u/7693852?v=4", + "name": "Reshmee Auckloo" + } + ], + "references": [ + { + "name": "Want to learn more about PnP PowerShell and the cmdlets", + "description": "Check out the PnP PowerShell site to get started and for the reference to the cmdlets.", + "url": "https://aka.ms/pnp/powershell" + } + ] + } +] From b3430a55338aff4f8c298c74fad6dde42385d5fb Mon Sep 17 00:00:00 2001 From: Paul Bullock Date: Mon, 28 Oct 2024 18:05:42 +0000 Subject: [PATCH 2/2] Minor alignment of title --- scripts/aad-control-guestaccount-m365-groups-teams/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/aad-control-guestaccount-m365-groups-teams/README.md b/scripts/aad-control-guestaccount-m365-groups-teams/README.md index 9a69aca5..d3614bbd 100644 --- a/scripts/aad-control-guestaccount-m365-groups-teams/README.md +++ b/scripts/aad-control-guestaccount-m365-groups-teams/README.md @@ -2,7 +2,7 @@ plugin: add-to-gallery --- -# Automate Renewal of Expiring M365 Groups or or Microsoft Teams teams +# Prevent Guests from being added to a specific Microsoft 365 Group or Microsoft Teams team ## Summary