You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Modules/CIPPCore/Public/GraphHelper/Get-AuthorisedRequest.ps1
+2-2
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@ function Get-AuthorisedRequest {
10
10
[string]$Uri
11
11
)
12
12
if (!$TenantID) {
13
-
$TenantID=$env:TenantId
13
+
$TenantID=$env:TenantID
14
14
}
15
15
if ($Uri-like'https://graph.microsoft.com/beta/contracts*'-or$Uri-like'*/customers/*'-or$Uri-eq'https://graph.microsoft.com/v1.0/me/sendMail'-or$Uri-like'*/tenantRelationships/*') {
16
16
return$true
17
17
}
18
18
$Tenants=Get-Tenants-IncludeErrors
19
19
$SkipList=Get-Tenants-SkipList
20
-
if (($env:PartnerTenantAvailable-eq$true-and$SkipList.customerId-notcontains$TenantID-and$SkipList.defaultDomainName-notcontains$TenantID) -or (($Tenants.customerId-contains$TenantID-or$Tenants.defaultDomainName-contains$TenantID) -and$TenantID-ne$env:TenantId)) {
20
+
if (($env:PartnerTenantAvailable-eq$true-and$SkipList.customerId-notcontains$TenantID-and$SkipList.defaultDomainName-notcontains$TenantID) -or (($Tenants.customerId-contains$TenantID-or$Tenants.defaultDomainName-contains$TenantID) -and$TenantID-ne$env:TenantID)) {
Write-LogMessage-user $ExecutingUser-API $APIName-message "Successfully set auto renew for tenant $($Relation.customer.displayName) with ID $($RelationShipid)"-Sev 'Info'
18
18
@("Successfully set auto renew for tenant $($Relation.customer.displayName) with ID $($Relation.id)" )
19
19
}
@@ -25,10 +25,10 @@ function Set-CIPPGDAPAutoExtend {
25
25
}
26
26
} else {
27
27
try {
28
-
$Relationship=New-GraphGetRequest-uri 'https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships'-tenantid $env:tenantid-NoAuthCheck $true|Where-Object-Property id -EQ$RelationShipid
28
+
$Relationship=New-GraphGetRequest-uri 'https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships'-tenantid $env:TenantID-NoAuthCheck $true|Where-Object-Property id -EQ$RelationShipid
write-LogMessage-user $ExecutingUser-API $APIName-message "Successfully set auto renew for tenant $($Relationship.customer.displayName) with ID $($RelationShipid)"-Sev 'Info'
33
33
@("Successfully set auto renew for tenant $($Relationship.customer.displayName) with ID $($RelationShipid)" )
Copy file name to clipboardexpand all lines: Modules/CIPPCore/Public/Webhooks/New-CIPPGraphSubscription.ps1
+5-5
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ function New-CIPPGraphSubscription {
47
47
}
48
48
Write-Host"Creating webhook subscription for $EventType"
49
49
50
-
$AuditLog=New-GraphPOSTRequest-type POST -uri "https://manage.office.com/api/v1.0/$($TenantFilter)/activity/feed/subscriptions/start?contentType=$EventType&PublisherIdentifier=$($env:TenantId)"-tenantid $TenantFilter-scope 'https://manage.office.com/.default'-body '{}'-verbose
50
+
$AuditLog=New-GraphPOSTRequest-type POST -uri "https://manage.office.com/api/v1.0/$($TenantFilter)/activity/feed/subscriptions/start?contentType=$EventType&PublisherIdentifier=$($env:TenantID)"-tenantid $TenantFilter-scope 'https://manage.office.com/.default'-body '{}'-verbose
51
51
Write-LogMessage-user $ExecutingUser-API $APIName-message "Created Webhook subscription for $($TenantFilter) for the log $($EventType)"-Sev 'Info'-tenant $TenantFilter
52
52
return@{ Success=$true; message="Created Webhook subscription for $($TenantFilter) for the log $($EventType)" }
53
53
} else {
@@ -80,9 +80,9 @@ function New-CIPPGraphSubscription {
0 commit comments