Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from KelvinTegelaar:master #82

Merged
merged 59 commits into from
Mar 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
65fb576
adduserbulk go brrr
JohnDuprey Mar 26, 2025
6dcb159
fixes length bug
KelvinTegelaar Mar 26, 2025
7c89917
do it for each type of received item.
KelvinTegelaar Mar 26, 2025
042d5d3
fix extension sync registration
JohnDuprey Mar 26, 2025
8783114
bulk user improvements
JohnDuprey Mar 26, 2025
6d5056c
rename function
JohnDuprey Mar 26, 2025
a5728d5
fix error message in hudu
JohnDuprey Mar 26, 2025
ab83c6a
Update licenses to newest MS list
kris6673 Mar 26, 2025
d357a70
fix schema extension list
JohnDuprey Mar 27, 2025
bfd2218
schema tweaks
JohnDuprey Mar 27, 2025
5305ccf
Merge pull request #1362 from kris6673/chore-licenses
KelvinTegelaar Mar 27, 2025
e7f2a14
test dev
KelvinTegelaar Mar 27, 2025
02b2968
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Mar 27, 2025
2b7ad0c
fixes standards reporting with periods in name.
KelvinTegelaar Mar 27, 2025
1027be5
fixes illegal name
KelvinTegelaar Mar 27, 2025
f8aea6b
support operationtype
JohnDuprey Mar 27, 2025
88061b3
fixes issues with compares
KelvinTegelaar Mar 27, 2025
1ea0f73
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Mar 27, 2025
467e245
update MIcrosoftTeams
JohnDuprey Mar 27, 2025
1292262
fix casing on sentAsAlert
JohnDuprey Mar 27, 2025
332e371
Update Push-SchedulerCIPPNotifications.ps1
JohnDuprey Mar 27, 2025
c76f109
updates to sherweb migration
KelvinTegelaar Mar 27, 2025
549ccec
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Mar 27, 2025
7ff2167
handle standard alert property missing
JohnDuprey Mar 27, 2025
e6aa3f7
Update Add-CIPPAzDataTableEntity.ps1
JohnDuprey Mar 27, 2025
f1489f5
standard tweaks
JohnDuprey Mar 27, 2025
6c43919
fix state check
JohnDuprey Mar 27, 2025
67434b7
fix branding profile
JohnDuprey Mar 27, 2025
22c11c4
fix user submissions
JohnDuprey Mar 27, 2025
05e3238
fix teams federation
JohnDuprey Mar 27, 2025
bebc72e
fix intune compliance settings
JohnDuprey Mar 27, 2025
98eb698
fix contact logic
JohnDuprey Mar 27, 2025
9eda89a
fix sharing domain check
JohnDuprey Mar 27, 2025
5fd8030
fix quarantine
JohnDuprey Mar 27, 2025
30c70e4
Update Invoke-CIPPStandardGlobalQuarantineNotifications.ps1
JohnDuprey Mar 27, 2025
3dbedfb
fix cipp-api integration for secondary subs
JohnDuprey Mar 28, 2025
2f8da33
fixes https://github.com/KelvinTegelaar/CIPP/issues/3873
KelvinTegelaar Mar 28, 2025
62388d5
fix compare for policies
KelvinTegelaar Mar 28, 2025
7f9e992
fix edit group for user actions
JohnDuprey Mar 28, 2025
c278676
fix safelinks reporting
JohnDuprey Mar 28, 2025
acc9f5f
fix application copy
JohnDuprey Mar 28, 2025
44bd89e
Update Invoke-CIPPStandardSpamFilterPolicy.ps1
JohnDuprey Mar 28, 2025
5535303
spam filter fix
JohnDuprey Mar 28, 2025
21dcab1
fiixes issue with cippapi module not connecting
KelvinTegelaar Mar 28, 2025
9fd301f
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Mar 28, 2025
d0cf944
fix user submissions
JohnDuprey Mar 28, 2025
e06d5e7
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Mar 28, 2025
4d6dfdb
update report text
JohnDuprey Mar 28, 2025
9d58b49
update oauth consent low sec to report conflicts
JohnDuprey Mar 28, 2025
e636d7f
add conflict detection
JohnDuprey Mar 28, 2025
19eb567
Fix federation config
JohnDuprey Mar 28, 2025
3da2817
fix spelling
JohnDuprey Mar 28, 2025
5dce65b
wording
JohnDuprey Mar 28, 2025
5a94acf
standard tweaks
JohnDuprey Mar 28, 2025
37a2326
fix state is correct logic
JohnDuprey Mar 28, 2025
eb5da4e
fix error handling
JohnDuprey Mar 28, 2025
6c5d8b9
up version
JohnDuprey Mar 28, 2025
b13e376
fix geo check
JohnDuprey Mar 28, 2025
5c91e91
Merge pull request #1366 from KelvinTegelaar/dev
JohnDuprey Mar 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix edit group for user actions
JohnDuprey committed Mar 28, 2025
commit 7f9e9922e392eb761f0ab7a0de75801a1f75019f
Original file line number Diff line number Diff line change
@@ -34,6 +34,9 @@ function Invoke-EditGroup {
try {
$member = $_.value
$memberid = $_.addedFields.id
if (!$memberid) {
$memberid = (New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users/$member" -tenantid $TenantId).id
}

if ($GroupType -eq 'Distribution List' -or $GroupType -eq 'Mail-Enabled Security') {
$Params = @{ Identity = $userobj.groupid; Member = $member; BypassSecurityGroupManagerCheck = $true }
@@ -262,7 +265,7 @@ function Invoke-EditGroup {
foreach ($GraphLog in $GraphLogs) {
$GraphError = $RawGraphRequest | Where-Object { $_.id -eq $GraphLog.id -and $_.status -notmatch '^2[0-9]+' }
if ($GraphError) {
$Message = $GraphError.body.error.message
$Message = Get-NormalizedError -message $GraphError.body.error
$Sev = 'Error'
$Results.Add("Error - $Message")
} else {
143 changes: 72 additions & 71 deletions Modules/CIPPCore/Public/GraphHelper/Get-NormalizedError.ps1
Original file line number Diff line number Diff line change
@@ -1,71 +1,72 @@
function Get-NormalizedError {
<#
.FUNCTIONALITY
Internal
#>
[CmdletBinding()]
param (
[string]$message
)

#Check if the message is valid JSON.
try {
$JSONMsg = $message | ConvertFrom-Json
} catch {
}
#if the message is valid JSON, there can be multiple fields in which the error resides. These are:
# $message.error.Innererror.Message
# $message.error.Message
# $message.error.details.message
# $message.error.innererror.internalException.message

#We need to check if the message is in one of these fields, and if so, return it.
if ($JSONMsg.error.innererror.message) {
Write-Host "innererror.message found: $($JSONMsg.error.innererror.message)"
$message = $JSONMsg.error.innererror.message
} elseif ($JSONMsg.error.message) {
Write-Host "error.message found: $($JSONMsg.error.message)"
$message = $JSONMsg.error.message
} elseif ($JSONMsg.error.details.message) {
Write-Host "error.details.message found: $($JSONMsg.error.details.message)"
$message = $JSONMsg.error.details.message
} elseif ($JSONMsg.error.innererror.internalException.message) {
Write-Host "error.innererror.internalException.message found: $($JSONMsg.error.innererror.internalException.message)"
$message = $JSONMsg.error.innererror.internalException.message
}


#finally, put the message through the translator. If it's not in the list, just return the original message
switch -Wildcard ($message) {
'Request not applicable to target tenant.' { 'Required license not available for this tenant' }
"Neither tenant is B2C or tenant doesn't have premium license" { 'This feature requires a P1 license or higher' }
'Response status code does not indicate success: 400 (Bad Request).' { 'Error 400 occured. There is an issue with the token configuration for this tenant. Please perform an access check' }
'*Microsoft.Skype.Sync.Pstn.Tnm.Common.Http.HttpResponseException*' { 'Could not connect to Teams Admin center - Tenant might be missing a Teams license' }
'*Provide valid credential.*' { 'Error 400: There is an issue with your Exchange Token configuration. Please perform an access check for this tenant' }
'*This indicate that a subscription within the tenant has lapsed*' { 'There is subscription for this service available, Check licensing information.' }
'*User was not found.*' { 'The relationship between this tenant and the partner has been dissolved from the tenant side.' }
'*AADSTS50020*' { 'AADSTS50020: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }
'*AADSTS50177' { 'AADSTS50177: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }
'*invalid or malformed*' { 'The request is malformed. Have you finished the SAM Setup?' }
'*Windows Store repository apps feature is not supported for this tenant*' { 'This tenant does not have WinGet support available' }
'*AADSTS650051*' { 'The application does not exist yet. Try again in 30 seconds.' }
'*AppLifecycle_2210*' { 'Failed to call Intune APIs: Does the tenant have a license available?' }
'*One or more added object references already exist for the following modified properties:*' { 'This user is already a member of this group.' }
'*Microsoft.Exchange.Management.Tasks.MemberAlreadyExistsException*' { 'This user is already a member of this group.' }
'*The property value exceeds the maximum allowed size (64KB)*' { 'One of the values exceeds the maximum allowed size (64KB).' }
'*Unable to initialize the authorization context*' { 'Your GDAP configuration does not allow us to write to this tenant, please check your group mappings and tenant onboarding.' }
'*Providers.Common.V1.CoreException*' { '403 (Access Denied) - We cannot connect to this tenant.' }
'*Authentication failed. MFA required*' { 'Authentication failed. MFA required' }
'*Your tenant is not licensed for this feature.*' { 'Required license not available for this tenant' }
'*AADSTS65001*' { 'We cannot access this tenant as consent has not been given, please try refreshing the CPV permissions in the application settings menu.' }
'*AADSTS700082*' { 'The CIPP user access token has expired. Run the SAM Setup wizard to refresh your tokens.' }
'*Account is not provisioned.' { 'The account is not provisioned. You do not the correct M365 license to access this information..' }
'*AADSTS5000224*' { 'This resource is not available - Has this tenant been deleted?' }
'*AADSTS53003*' { 'Access has been blocked by Conditional Access policies. Please check the Conditional Access configuration documentation' }
'*AADSTS900023*' { 'This tenant is not available for this operation. Please check the selected tenant and try again.' }
'*AADSTS9002313*' { 'The credentials used to connect to the Graph API are not available, please retry. If this issue persists you may need to execute the SAM wizard.' }
'*One or more platform(s) is/are not configured for the customer. Please configure the platform before trying to purchase a SKU.*' { 'One or more platform(s) is/are not configured for the customer. Please configure the platform before trying to purchase a SKU.' }
Default { $message }

}
}
function Get-NormalizedError {
<#
.FUNCTIONALITY
Internal
#>
[CmdletBinding()]
param (
[string]$message
)

#Check if the message is valid JSON.
try {
$JSONMsg = $message | ConvertFrom-Json
} catch {
}
#if the message is valid JSON, there can be multiple fields in which the error resides. These are:
# $message.error.Innererror.Message
# $message.error.Message
# $message.error.details.message
# $message.error.innererror.internalException.message

#We need to check if the message is in one of these fields, and if so, return it.
if ($JSONMsg.error.innererror.message) {
Write-Host "innererror.message found: $($JSONMsg.error.innererror.message)"
$message = $JSONMsg.error.innererror.message
} elseif ($JSONMsg.error.message) {
Write-Host "error.message found: $($JSONMsg.error.message)"
$message = $JSONMsg.error.message
} elseif ($JSONMsg.error.details.message) {
Write-Host "error.details.message found: $($JSONMsg.error.details.message)"
$message = $JSONMsg.error.details.message
} elseif ($JSONMsg.error.innererror.internalException.message) {
Write-Host "error.innererror.internalException.message found: $($JSONMsg.error.innererror.internalException.message)"
$message = $JSONMsg.error.innererror.internalException.message
}


#finally, put the message through the translator. If it's not in the list, just return the original message
switch -Wildcard ($message) {
'Request not applicable to target tenant.' { 'Required license not available for this tenant' }
"Neither tenant is B2C or tenant doesn't have premium license" { 'This feature requires a P1 license or higher' }
'Response status code does not indicate success: 400 (Bad Request).' { 'Error 400 occured. There is an issue with the token configuration for this tenant. Please perform an access check' }
'*Microsoft.Skype.Sync.Pstn.Tnm.Common.Http.HttpResponseException*' { 'Could not connect to Teams Admin center - Tenant might be missing a Teams license' }
'*Provide valid credential.*' { 'Error 400: There is an issue with your Exchange Token configuration. Please perform an access check for this tenant' }
'*This indicate that a subscription within the tenant has lapsed*' { 'There is subscription for this service available, Check licensing information.' }
'*User was not found.*' { 'The relationship between this tenant and the partner has been dissolved from the tenant side.' }
'*AADSTS50020*' { 'AADSTS50020: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }
'*AADSTS50177' { 'AADSTS50177: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }
'*invalid or malformed*' { 'The request is malformed. Have you finished the SAM Setup?' }
'*Windows Store repository apps feature is not supported for this tenant*' { 'This tenant does not have WinGet support available' }
'*AADSTS650051*' { 'The application does not exist yet. Try again in 30 seconds.' }
'*AppLifecycle_2210*' { 'Failed to call Intune APIs: Does the tenant have a license available?' }
'*One or more added object references already exist for the following modified properties:*' { 'This user is already a member of this group.' }
'*Microsoft.Exchange.Management.Tasks.MemberAlreadyExistsException*' { 'This user is already a member of this group.' }
'*The property value exceeds the maximum allowed size (64KB)*' { 'One of the values exceeds the maximum allowed size (64KB).' }
'*Unable to initialize the authorization context*' { 'Your GDAP configuration does not allow us to write to this tenant, please check your group mappings and tenant onboarding.' }
'*Providers.Common.V1.CoreException*' { '403 (Access Denied) - We cannot connect to this tenant.' }
'*Authentication failed. MFA required*' { 'Authentication failed. MFA required' }
'*Your tenant is not licensed for this feature.*' { 'Required license not available for this tenant' }
'*AADSTS65001*' { 'We cannot access this tenant as consent has not been given, please try refreshing the CPV permissions in the application settings menu.' }
'*AADSTS700082*' { 'The CIPP user access token has expired. Run the SAM Setup wizard to refresh your tokens.' }
'*Account is not provisioned.' { 'The account is not provisioned. You do not the correct M365 license to access this information..' }
'*AADSTS5000224*' { 'This resource is not available - Has this tenant been deleted?' }
'*AADSTS53003*' { 'Access has been blocked by Conditional Access policies. Please check the Conditional Access configuration documentation' }
'*AADSTS900023*' { 'This tenant is not available for this operation. Please check the selected tenant and try again.' }
'*AADSTS9002313*' { 'The credentials used to connect to the Graph API are not available, please retry. If this issue persists you may need to execute the SAM wizard.' }
'*One or more platform(s) is/are not configured for the customer. Please configure the platform before trying to purchase a SKU.*' { 'One or more platform(s) is/are not configured for the customer. Please configure the platform before trying to purchase a SKU.' }
"One or more added object references already exist for the following modified properties: 'members'." { 'This user is already a member of the selected group.' }
Default { $message }

}
}