File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Entrypoints/HTTP Functions/CIPP/Setup Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 11using namespace System.Net
22
3- Function Invoke-ExecCreateSAMApp {
3+ function Invoke-ExecCreateSAMApp {
44 <#
55 . FUNCTIONALITY
66 Entrypoint,AnyTenant
@@ -19,7 +19,7 @@ Function Invoke-ExecCreateSAMApp {
1919 $URL = ($Request.headers .' x-ms-original-url' ).split(' /api' ) | Select-Object - First 1
2020 $TenantId = (Invoke-RestMethod ' https://graph.microsoft.com/v1.0/organization' - Headers @ { authorization = " Bearer $ ( $Token.access_token ) " } - Method GET - ContentType ' application/json' ).value.id
2121 # Find Existing app registration
22- $AppId = (Invoke-RestMethod ' https://graph.microsoft.com/v1.0/applications' - Headers @ { authorization = " Bearer $ ( $Token.access_token ) " } - Method GET - ContentType ' application/json' - Body " { `" filter `" : `" displayName eq 'CIPP-SAM' `" } " ).value | Select-Object - Last 1
22+ $AppId = (Invoke-RestMethod " https://graph.microsoft.com/v1.0/applications? `$ filter=displayName eq 'CIPP-SAM' " - Headers @ { authorization = " Bearer $ ( $Token.access_token ) " } - Method GET - ContentType ' application/json' ).value | Select-Object - Last 1
2323 # Check if the appId has the redirect URI, if not, add it.
2424 if ($AppId ) {
2525 Write-Host " Found existing app: $ ( $AppId.id ) . Reusing."
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ function Set-CIPPCopyGroupMembers {
4646 try {
4747 if ($PSCmdlet.ShouldProcess ($MailGroup.displayName , " Add $UserId to group" )) {
4848 if ($MailGroup.MailEnabled -and $Mailgroup.ResourceProvisioningOptions -notcontains ' Team' -and $MailGroup.groupTypes -notcontains ' Unified' ) {
49- $Params = @ { Identity = $MailGroup.mailNickname ; Member = $UserId ; BypassSecurityGroupManagerCheck = $true }
49+ $Params = @ { Identity = $MailGroup.id ; Member = $UserId ; BypassSecurityGroupManagerCheck = $true }
5050 try {
5151 $null = New-ExoRequest - tenantid $TenantFilter - cmdlet ' Add-DistributionGroupMember' - cmdParams $params - UseSystemMailbox $true
5252 } catch {
You can’t perform that action at this time.
0 commit comments