Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
d647adc
feat: Add mail contact deployment standard script
Jr7468 May 28, 2025
912648e
Fixed issue with compare. Used wrong input for convert
ngms-psh May 30, 2025
7a1de2a
fix: fix adding user from Add to group useraction
kris6673 May 30, 2025
b4230b3
fix: fix all the casing of variables and methods
kris6673 May 30, 2025
48f38ee
fix: copy groups now uses ExternalDirectoryObjectID to prevent Micros…
kris6673 May 30, 2025
b823d35
readability
kris6673 May 30, 2025
ecbaa3d
fix: correct variable name from $APINAME to $APIName in logging messages
kris6673 May 30, 2025
8a09b26
fix: casing and change very odd error message
kris6673 May 30, 2025
98e5e37
New options for creating and editing contacts
Zacgoose May 31, 2025
1d278ca
Consistency and optimisation
Zacgoose May 31, 2025
d6c1d57
dirty retry but it rarely needed anyway
Zacgoose May 31, 2025
1c8fd60
sleep is better in this situation but alos check you actually need to…
Zacgoose May 31, 2025
1dd9033
Start of works on contact templates + new standard
Zacgoose May 31, 2025
c7ec71b
Working contact template setup
Zacgoose May 31, 2025
226bdac
Tidy up and naming
Zacgoose May 31, 2025
f7d5c06
much quicker requests for list all contacts but less detailed
Zacgoose May 31, 2025
1084b48
fixes
Zacgoose May 31, 2025
5518b8a
New options for creating, editing, templating and standardising contacts
Zacgoose May 31, 2025
42bd4af
Merge branch 'contact-add-edit-list' of https://github.com/Zacgoose/C…
Zacgoose May 31, 2025
52743fb
Fix: Casing and error handling
kris6673 Jun 1, 2025
3067656
Fix: Update terminology from AAD to Entra in
kris6673 Jun 1, 2025
8e5f431
Feat: New standard to disable unlicensed resource mailbox Entra accounts
kris6673 Jun 1, 2025
b884978
Round 1
Zacgoose Jun 2, 2025
9026bc0
Round 2
Zacgoose Jun 3, 2025
b501fae
State Fixes
Zacgoose Jun 3, 2025
94852b0
Enabled fixes
Zacgoose Jun 3, 2025
9dce385
Revert to State from Enabled
Zacgoose Jun 3, 2025
f61ef18
Added IsValid
Zacgoose Jun 3, 2025
bc9e588
forgive me for I have sinned
Zacgoose Jun 3, 2025
b86fdd5
Template name and description fixes
Zacgoose Jun 3, 2025
567889d
remove logging
Zacgoose Jun 3, 2025
57b6ad6
Safe Links Policy - Management, Standards, and Templates
Zacgoose Jun 2, 2025
2cb4772
Merge branch 'safelinkspolicy' of https://github.com/Zacgoose/CIPP-AP…
Zacgoose Jun 3, 2025
0f72951
Update Invoke-CIPPStandardSendReceiveLimitTenant.ps1
StoricU Jun 4, 2025
09cffff
Update Get-CIPPAlertInactiveLicensedUsers.ps1
Zacgoose Jun 5, 2025
f05c72f
invert logic for never signed in accounts, skip be default
Zacgoose Jun 5, 2025
e8f5b49
Refactor Invoke-EditRoomMailbox and Invoke-ListRooms scripts for cons…
kris6673 Jun 5, 2025
b13f6d3
Add equipment backend functions
kris6673 Jun 5, 2025
e171f97
Added Calendar Processing
Jr7468 Jun 5, 2025
5285821
Created a Standard to enable Name Pronounciation
Jr7468 Jun 6, 2025
1ee0299
Spelling
Jr7468 Jun 6, 2025
2913ea2
fix: Authorization failed because of missing requirement(s). error an…
kris6673 Jun 6, 2025
b73689a
Created a Standard to enable Name Pronounciation
Jr7468 Jun 6, 2025
d5321e9
Merge branch 'StandardNamePronounciation' of https://github.com/Jr746…
Jr7468 Jun 6, 2025
902df69
Fixed -AsApp $true
Jr7468 Jun 6, 2025
ae3371b
Created a Standard to enable Name Pronounciation
Jr7468 Jun 6, 2025
53374d3
Merge branch 'StandardNamePronounciation' of https://github.com/Jr746…
Jr7468 Jun 6, 2025
033010c
Created a Standard to enable Name Pronounciation
Jr7468 Jun 6, 2025
1c709ae
Merge branch 'StandardNamePronounciation' of https://github.com/Jr746…
Jr7468 Jun 6, 2025
e054811
Account for all AccessRight permissions when removing permissions, al…
Zacgoose Jun 6, 2025
0a21b10
Removed $APINAME (1/3)
sfaxluke Jun 6, 2025
7a4f910
Removed $APINAME (2/3)
sfaxluke Jun 6, 2025
9f7488b
Add log message endpoint for Transport Standards
sfaxluke Jun 6, 2025
eaba7ab
Feat: add standard to restrict third-party storage services in Micros…
kris6673 Jun 6, 2025
6b20e60
Fix: parameter input error: |System.ArgumentException|Entered frequen…
kris6673 Jun 6, 2025
b17b9ee
Feat: Add internal phishing protection for Microsoft Forms
kris6673 Jun 6, 2025
f52f0ef
Feat: Add OrgSettings-Forms.ReadWrite.All scopes and roles to SAMMani…
kris6673 Jun 6, 2025
61b117e
Modified Invoke-AddGroup to support dynamic membership for M365 groups
Jr7468 Jun 6, 2025
51055a1
Merge pull request #1457 from Jr7468/DeployContactStandard
JohnDuprey Jun 6, 2025
9e3bf5e
reference definitions from frontend main repo
JohnDuprey Jun 7, 2025
da979c0
fix mfa push
JohnDuprey Jun 7, 2025
5b95fae
Merge pull request #1489 from Jr7468/DynamicM365
KelvinTegelaar Jun 8, 2025
8bbe1f1
Merge pull request #1487 from kris6673/feat-StandardFormsPhishingProt…
KelvinTegelaar Jun 8, 2025
3a4948c
Merge pull request #1486 from kris6673/issue4229
KelvinTegelaar Jun 8, 2025
b6874ce
Merge pull request #1485 from kris6673/feat-storage-providers
KelvinTegelaar Jun 8, 2025
7a75da3
Merge pull request #1484 from sfaxluke/LogMessages
KelvinTegelaar Jun 8, 2025
6233ada
Merge pull request #1482 from Jr7468/StandardNamePronounciation
KelvinTegelaar Jun 8, 2025
5bbe22e
Merge pull request #1481 from kris6673/fix-pronouns-standard
KelvinTegelaar Jun 8, 2025
7ad50a6
Merge pull request #1480 from Jr7468/CalendarProcessing
KelvinTegelaar Jun 8, 2025
8624136
Merge pull request #1476 from Zacgoose/signin-alert-fixes
KelvinTegelaar Jun 8, 2025
4c9c8c3
Merge pull request #1473 from StoricU/patch-1
KelvinTegelaar Jun 8, 2025
28b9e83
Merge pull request #1469 from kris6673/issue4172
KelvinTegelaar Jun 8, 2025
3f30a57
Merge pull request #1464 from ngms-psh/issue-quarantinepolicy-compare
KelvinTegelaar Jun 8, 2025
42e9ec8
Merge pull request #1467 from kris6673/fix-add-dist-grp
KelvinTegelaar Jun 8, 2025
3c574aa
Merge pull request #1468 from Zacgoose/contact-add-edit-list
KelvinTegelaar Jun 8, 2025
0d60695
Merge pull request #1479 from kris6673/equipment
KelvinTegelaar Jun 8, 2025
ce7781d
fixes issues caused by incorrect grouptype
KelvinTegelaar Jun 8, 2025
2414906
fixes deployment issues
KelvinTegelaar Jun 8, 2025
e0de70c
corrected input value from alert configuration
Zacgoose Jun 9, 2025
4271168
Added script alert for OneDrive usage quota
ngms-psh Jun 9, 2025
cd61d80
more words
kris6673 Jun 9, 2025
a155351
Merge pull request #1491 from ngms-psh/feat-OnedriveUsage-alert
KelvinTegelaar Jun 9, 2025
4f17c81
Merge pull request #1492 from kris6673/words
KelvinTegelaar Jun 9, 2025
42bdfb2
Merge pull request #1490 from Zacgoose/huntress-alert-fix
KelvinTegelaar Jun 9, 2025
cf2536d
fix tenant cleanup
JohnDuprey Jun 9, 2025
3264c87
allow group editing
KelvinTegelaar Jun 10, 2025
a64063e
If compare fails, catch and StateIsCorrect = false
ngms-psh Jun 10, 2025
26efa2f
+= words
kris6673 Jun 9, 2025
f4609bb
remove unused old endpoints
kris6673 Jun 9, 2025
d319566
Refactor logging and fix some variable casing
kris6673 Jun 9, 2025
f726407
rename to fit function naming standards
kris6673 Jun 9, 2025
3fa17c2
refactor a few functions to add error handling
kris6673 Jun 9, 2025
40b91b3
Enhance logging and permission handling in Invoke-ExecModifyCalPerms …
Jr7468 Jun 10, 2025
431d1f5
Refactored to use Set-CIPPCalendarPermission
Jr7468 Jun 10, 2025
d72c74b
Merge pull request #1495 from kris6673/fix-modernize-endpoints
KelvinTegelaar Jun 10, 2025
0348180
Merge pull request #1494 from ngms-psh/issue4247
KelvinTegelaar Jun 10, 2025
0120edf
Merge pull request #1496 from Jr7468/dev
KelvinTegelaar Jun 10, 2025
5ccd2b7
backtics to splat.
KelvinTegelaar Jun 10, 2025
f1dd576
Merge pull request #1471 from Zacgoose/safelinkspolicy
KelvinTegelaar Jun 10, 2025
b95612f
Merge pull request #1483 from Zacgoose/mailbox-perms-fix
KelvinTegelaar Jun 10, 2025
022d8fd
better logging and a report mode fix
kris6673 Jun 10, 2025
97c8c01
better logging and fix alert being wrong
kris6673 Jun 10, 2025
4e8624a
Fix casing of GetEnumerator method and standardize tenant variable us…
kris6673 Jun 10, 2025
d26ce7d
more logging
kris6673 Jun 10, 2025
93f1438
More casing
kris6673 Jun 10, 2025
2a375f3
Fixed permission node.
Jr7468 Jun 10, 2025
0480eb8
Fix BPA import
JohnDuprey Jun 11, 2025
afda81b
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Jun 11, 2025
615737a
fix exclude from standards in onboarding
JohnDuprey Jun 11, 2025
49741ff
prevent missing refresh_token in claims
JohnDuprey Jun 12, 2025
888cce4
Update Invoke-ExecAddTenant.ps1
JohnDuprey Jun 12, 2025
ec6c2c6
smol brain mistake fixed
kris6673 Jun 12, 2025
a84d742
feat: add support for renaming named locations
kris6673 Jun 12, 2025
0dd57a4
fix: standardize variable casing and improve error handling in Set-CI…
kris6673 Jun 12, 2025
cc7acff
feat: extend Set-CIPPNamedLocation function to support 'setTrusted' a…
kris6673 Jun 12, 2025
cd07ff7
feat: enhance Set-CIPPNamedLocation function to support 'delete' acti…
kris6673 Jun 12, 2025
15ec1f9
Merge pull request #1501 from kris6673/feat-rename-nl
KelvinTegelaar Jun 12, 2025
6a3dae3
move permission to tenant groups
KelvinTegelaar Jun 13, 2025
2a3e57c
added permission
KelvinTegelaar Jun 13, 2025
e2a4024
Add bobbytables to profile import
Jun 13, 2025
002e182
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
Jun 13, 2025
7484b9c
fixes issue with assigned app
KelvinTegelaar Jun 13, 2025
56c5691
Add CA policy displayname change action
Jun 13, 2025
30069dc
API support for editing Intune policy displaynames
Jun 13, 2025
40c164c
Add standard to set default SP & Onedrive sharing #4234
Jun 13, 2025
6b6e7e2
Feat: reenable unmanagedSync standard
kris6673 Jun 13, 2025
5f72572
chore: update comments
kris6673 Jun 13, 2025
6ce06bd
Feat: Add TwoClickEmailProtection standard
kris6673 Jun 13, 2025
a82b206
fix: casing and instant reporting
kris6673 Jun 13, 2025
d3ae99e
Merge pull request #1504 from kris6673/feat-TwoClickEmailProtection
KelvinTegelaar Jun 13, 2025
b95c218
Merge pull request #1503 from kris6673/feat-unmanagedSync
KelvinTegelaar Jun 13, 2025
27c5429
Merge pull request #1499 from Jr7468/CalRoleFix
KelvinTegelaar Jun 13, 2025
307866a
Merge pull request #1498 from kris6673/fix-DisableTenantCreation
KelvinTegelaar Jun 13, 2025
269148d
Merge pull request #1497 from kris6673/fix-standards
KelvinTegelaar Jun 13, 2025
c02efa9
creation delay
KelvinTegelaar Jun 14, 2025
17722b7
policy delay
KelvinTegelaar Jun 14, 2025
d425c7c
low domain score alert
KelvinTegelaar Jun 14, 2025
163994d
bulk license support
KelvinTegelaar Jun 14, 2025
b1a7451
teams meeting
KelvinTegelaar Jun 14, 2025
ea55af6
New alert
KelvinTegelaar Jun 14, 2025
979671d
fix casing and improve forwarding behavior
Zacgoose Jun 15, 2025
81c1595
Created a function to track new risky users and alert on new entries
Jr7468 Jun 15, 2025
904a9e1
Update alert format to make consistent and fix issue with formatting
Zacgoose Jun 16, 2025
3d764d3
Make BPA report list sorted
Zacgoose Jun 16, 2025
9bb55ca
Add standard to add DMARC record to MOERA domains
ngms-psh Jun 16, 2025
a69ebab
Add "DMARC", "MOERA", "onmicrosoft.com" to custom words
ngms-psh Jun 16, 2025
dc0eed6
Merge pull request #1505 from Zacgoose/emailforwarding-imporvement
JohnDuprey Jun 16, 2025
d0ddc5f
Merge pull request #1506 from Jr7468/NewRiskyUsersAlert
JohnDuprey Jun 16, 2025
10e3016
Merge pull request #1507 from Zacgoose/expiring-secret-alert
JohnDuprey Jun 16, 2025
48741f3
Merge pull request #1508 from Zacgoose/sorting-for-BPA-report
JohnDuprey Jun 16, 2025
db2e678
Alert for missing 'Domain Name Administrator' gdap role
ngms-psh Jun 16, 2025
b05704c
Chore: Update comments
ngms-psh Jun 16, 2025
a82676d
port manual credential option to ExecCombinedSetup
JohnDuprey Jun 16, 2025
e556a1f
Alert for missing GDAP Role, "enabled" the standard
ngms-psh Jun 16, 2025
7aafce2
Chore: Update comments
ngms-psh Jun 16, 2025
b78159b
Excluded 8x8 and Gamma domains
sfaxluke Jun 17, 2025
c7591ba
Fix null response from EXO and remove +=
Zacgoose Jun 17, 2025
46a49a8
fix duplicate autopilot profile
JohnDuprey Jun 17, 2025
292d64f
update errors to reference Setup Wizard instead of SAM
JohnDuprey Jun 17, 2025
9b6033d
improve reliability of editgroup
JohnDuprey Jun 17, 2025
5c483a2
Fix AssignedTo property
JohnDuprey Jun 17, 2025
8a8a06d
Enhance New-CIPPTAP function to support additional
kris6673 Jun 18, 2025
4d562fa
Fix report for QuarantineTemplate
ngms-psh Jun 18, 2025
32f7f9c
Merge pull request #1509 from ngms-psh/feat-DmarcMOERA
KelvinTegelaar Jun 18, 2025
e8f916e
Merge pull request #1513 from kris6673/feat-tap-actions
KelvinTegelaar Jun 18, 2025
c9eff83
Merge pull request #1512 from Zacgoose/alert-fix-limit
KelvinTegelaar Jun 18, 2025
b61a537
Merge pull request #1511 from sfaxluke/domain-exclusions
KelvinTegelaar Jun 18, 2025
281032a
Merge pull request #1510 from ngms-psh/Enable-DisableSelfServiceLicen…
KelvinTegelaar Jun 18, 2025
5d35bf9
improve tenant access check
JohnDuprey Jun 18, 2025
040aa69
exchange permission repair
JohnDuprey Jun 19, 2025
270897e
Update Invoke-ExecExchangeRoleRepair.ps1
JohnDuprey Jun 19, 2025
6b842b5
add RoleManagement.ReadWrite.Exchange
JohnDuprey Jun 19, 2025
5435419
Create CIPP-Permissions.json
JohnDuprey Jun 19, 2025
9f36283
fix: fix template application deployment
OfficialEsco Jun 19, 2025
f4ec86c
new standard
KelvinTegelaar Jun 19, 2025
280654e
SharePoint Admin URL lookup simplification
Jun 19, 2025
b3841e8
Merge pull request #1515 from Ren-Roros-Digital/AppDeploy
JohnDuprey Jun 19, 2025
000ac0e
Merge pull request #1514 from ngms-psh/fix-quaratinepolicy-report
JohnDuprey Jun 19, 2025
484854c
dont always return a success as that breaks resetForm=true
kris6673 Jun 19, 2025
c57970a
force add of report to every remediate standard.
KelvinTegelaar Jun 19, 2025
7613d60
Refactor Invoke-ExecSetOoO function to improve error handling and log…
kris6673 Jun 19, 2025
3b48379
Enhance Set-CIPPOutOfOffice function by enforcing mandatory parameter…
kris6673 Jun 19, 2025
8f58eae
fix idiotic bug
kris6673 Jun 19, 2025
ee06832
Change to return status code based on result of request
kris6673 Jun 19, 2025
f3b0051
Refactor Set-CIPPOutOfOffice and Invoke-ExecSetOoO functions to impro…
kris6673 Jun 19, 2025
eeac022
Re-add Set-CIPPCalendarPermission refactor code that was erroneously …
KelvinTegelaar Jun 10, 2025
8afde12
Refactor Invoke-ListDefenderTVM to return all properties and future o…
kris6673 Jun 19, 2025
0a375bd
Feat: add Get-CIPPAlertVulnerabilities alert
kris6673 Jun 19, 2025
248213d
More efficient continue placement
kris6673 Jun 19, 2025
81b2ffc
branding api
KelvinTegelaar Jun 19, 2025
7e5b8f4
stupid bug
KelvinTegelaar Jun 19, 2025
67fa371
secure score
KelvinTegelaar Jun 19, 2025
5c78dfc
Create Invoke-ListAdminPortalLicenses.ps1
JohnDuprey Jun 20, 2025
4e46f98
remove timer function for audit log cleanup
JohnDuprey Jun 20, 2025
bc720bd
improve table cleanup
JohnDuprey Jun 20, 2025
ed0d250
fix: PasswordExpireDisabled ignore notVerified
OfficialEsco Jun 20, 2025
9aa093e
local dev auth fix
KelvinTegelaar Jun 20, 2025
e020ac7
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Jun 20, 2025
33ef115
branding update
KelvinTegelaar Jun 20, 2025
b664a33
Merge pull request #1519 from kris6673/feat-vuln-stuffs
KelvinTegelaar Jun 20, 2025
1985b45
Merge pull request #1516 from kris6673/clear-form
KelvinTegelaar Jun 20, 2025
2a92d6b
Merge pull request #1520 from Ren-Roros-Digital/PasswordExpireDisabled
KelvinTegelaar Jun 20, 2025
086f442
Merge pull request #1517 from kris6673/OoO
KelvinTegelaar Jun 20, 2025
92fb8a3
Merge pull request #1518 from kris6673/fix-add-default-back
KelvinTegelaar Jun 20, 2025
3e067c8
fix: added missing alerts
OfficialEsco Jun 20, 2025
07616c7
Merge pull request #1521 from Ren-Roros-Digital/missingAlerts
KelvinTegelaar Jun 20, 2025
99a23b7
ensure the correct base role is selected
JohnDuprey Jun 20, 2025
1009b5f
Update Test-CIPPAccess.ps1
JohnDuprey Jun 20, 2025
5817139
add logdata to bec remediate log
JohnDuprey Jun 20, 2025
efaee28
fix for normalized error
KelvinTegelaar Jun 20, 2025
0ad30a6
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Jun 20, 2025
487a2ce
update error status code
JohnDuprey Jun 20, 2025
06f75e1
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
JohnDuprey Jun 20, 2025
b9e62a4
version up
KelvinTegelaar Jun 20, 2025
1c4d8dc
Resolves an issue with a parameter that is required for operation whe…
KelvinTegelaar Jun 20, 2025
663a190
add extra headers to sharepoint
KelvinTegelaar Jun 20, 2025
a06b461
final fix for sharepoint stuff
KelvinTegelaar Jun 20, 2025
578f421
Merge pull request #1522 from KelvinTegelaar/dev
KelvinTegelaar Jun 20, 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
789 changes: 789 additions & 0 deletions CIPP-Permissions.json

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions CIPPTimers.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@
"RunOnProcessor": true,
"PreferredProcessor": "standards"
},
{
"Id": "5113c66d-c040-42df-9565-39dff90ddd55",
"Command": "Start-CIPPGraphSubscriptionCleanupTimer",
"Description": "Orchestrator to cleanup old Graph subscriptions",
"Cron": "0 0 0 * * *",
"Priority": 5,
"RunOnProcessor": true
},
{
"Id": "97145a1d-28f0-4bb2-b929-5a43517d23cc",
"Command": "Start-SchedulerOrchestrator",
Expand Down
29 changes: 29 additions & 0 deletions Config/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,35 @@
"powershellEquivalent": "New-ProtectionAlert and Set-ProtectionAlert",
"recommendedBy": []
},
{
"name": "standards.SafeLinksTemplatePolicy",
"label": "SafeLinks Policy Template",
"cat": "Templates",
"multiple": false,
"disabledFeatures": {
"report": false,
"warn": false,
"remediate": false
},
"impact": "Medium Impact",
"addedDate": "2025-04-29",
"helpText": "Deploy and manage SafeLinks policy templates to protect against malicious URLs in emails and Office documents.",
"addedComponent": [
{
"type": "autoComplete",
"multiple": true,
"creatable": false,
"name": "standards.SafeLinksTemplatePolicy.TemplateIds",
"label": "Select SafeLinks Policy Templates",
"api": {
"url": "/api/ListSafeLinksPolicyTemplates",
"labelField": "TemplateName",
"valueField": "GUID",
"queryKey": "ListSafeLinksPolicyTemplates"
}
}
]
},
{
"name": "standards.SafeLinksPolicy",
"cat": "Defender Standards",
Expand Down
25 changes: 13 additions & 12 deletions Modules/CIPPCore/Public/Add-CIPPGroupMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@ function Add-CIPPGroupMember(
[string]$APIName = 'Add Group Member'
) {
try {
if ($member -like '*#EXT#*') { $member = [System.Web.HttpUtility]::UrlEncode($member) }
$MemberIDs = 'https://graph.microsoft.com/v1.0/directoryObjects/' + (New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users/$($member)" -tenantid $TenantFilter).id
$addmemberbody = "{ `"members@odata.bind`": $(ConvertTo-Json @($MemberIDs)) }"
if ($Member -like '*#EXT#*') { $Member = [System.Web.HttpUtility]::UrlEncode($Member) }
$MemberIDs = 'https://graph.microsoft.com/v1.0/directoryObjects/' + (New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users/$($Member)" -tenantid $TenantFilter).id
$AddMemberBody = "{ `"members@odata.bind`": $(ConvertTo-Json @($MemberIDs)) }"
if ($GroupType -eq 'Distribution list' -or $GroupType -eq 'Mail-Enabled Security') {
$Params = @{ Identity = $GroupId; Member = $member; BypassSecurityGroupManagerCheck = $true }
$null = New-ExoRequest -tenantid $TenantFilter -cmdlet 'Add-DistributionGroupMember' -cmdParams $params -UseSystemMailbox $true
$Params = @{ Identity = $GroupId; Member = $Member; BypassSecurityGroupManagerCheck = $true }
$null = New-ExoRequest -tenantid $TenantFilter -cmdlet 'Add-DistributionGroupMember' -cmdParams $Params -UseSystemMailbox $true
} else {
$null = New-GraphPostRequest -uri "https://graph.microsoft.com/beta/groups/$($GroupId)" -tenantid $TenantFilter -type patch -body $addmemberbody -Verbose
$null = New-GraphPostRequest -uri "https://graph.microsoft.com/beta/groups/$($GroupId)" -tenantid $TenantFilter -type patch -body $AddMemberBody -Verbose
}
$Message = "Successfully added user $($Member) to $($GroupId)."
Write-LogMessage -headers $Headers -API $APIName -tenant $TenantFilter -message $Message -Sev 'Info'
return $message
$Results = "Successfully added user $($Member) to $($GroupId)."
Write-LogMessage -headers $Headers -API $APIName -tenant $TenantFilter -message $Results -Sev 'Info'
return $Results
} catch {
$message = "Failed to add user $($Member) to $($GroupId) - $($_.Exception.Message)"
Write-LogMessage -headers $Headers -API $APIName -tenant $TenantFilter -message $message -Sev 'error' -LogData (Get-CippException -Exception $_)
return $message
$ErrorMessage = Get-CippException -Exception $_
$Results = "Failed to add user $($Member) to $($GroupId) - $($ErrorMessage.NormalizedError)"
Write-LogMessage -headers $Headers -API $APIName -tenant $TenantFilter -message $Results -Sev 'error' -LogData $ErrorMessage
throw $Results
}
}
13 changes: 11 additions & 2 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertAppSecretExpiry.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ function Get-CIPPAlertAppSecretExpiry {
return
}

$AlertData = foreach ($App in $applist) {
$AlertData = [System.Collections.Generic.List[PSCustomObject]]::new()

foreach ($App in $applist) {
Write-Host "checking $($App.displayName)"
if ($App.passwordCredentials) {
foreach ($Credential in $App.passwordCredentials) {
if ($Credential.endDateTime -lt (Get-Date).AddDays(30) -and $Credential.endDateTime -gt (Get-Date).AddDays(-7)) {
Write-Host ("Application '{0}' has secrets expiring on {1}" -f $App.displayName, $Credential.endDateTime)
@{ DisplayName = $App.displayName; Expires = $Credential.endDateTime }

$Message = [PSCustomObject]@{
AppName = $App.displayName
AppId = $App.appId
Expires = $Credential.endDateTime
Tenant = $TenantFilter
}
$AlertData.Add($Message)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function Get-CIPPAlertGlobalAdminNoAltEmail {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
)
try {
# Get all Global Admin accounts using the role template ID
$globalAdmins = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/directoryRoles/roleTemplateId=62e90394-69f5-4237-9190-012177145e10/members?`$select=id,displayName,userPrincipalName,otherMails" -tenantid $($TenantFilter) -AsApp $true | Where-Object {
$_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' -and $_.'@odata.type' -eq '#microsoft.graph.user'
}

# Filter for Global Admins without alternate email addresses
$adminsWithoutAltEmail = $globalAdmins | Where-Object {
$null -eq $_.otherMails -or $_.otherMails.Count -eq 0
}

if ($adminsWithoutAltEmail.Count -gt 0) {
$AlertData = "The following Global Admin accounts do not have an alternate email address set: $($adminsWithoutAltEmail.userPrincipalName -join ', ')"
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
}
} catch {
Write-LogMessage -message "Failed to check alternate email status for Global Admins: $($_.exception.message)" -API 'Global Admin Alt Email Alerts' -tenant $TenantFilter -sev Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ function Get-CIPPAlertHuntressRogueApps {
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter,
[Parameter(Mandatory = $false)]
[bool]$IgnoreDisabledApps = $false
[bool]$InputValue = $false,
$TenantFilter
)

try {
$RogueApps = Invoke-RestMethod -Uri 'https://raw.githubusercontent.com/huntresslabs/rogueapps/main/public/rogueapps.json'
$RogueAppFilter = $RogueApps.appId -join "','"
$ServicePrincipals = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/servicePrincipals?`$filter=appId in ('$RogueAppFilter')" -tenantid $TenantFilter
# If IgnoreDisabledApps is true, filter out disabled service principals
if ($IgnoreDisabledApps) {
if ($InputValue) {
$ServicePrincipals = $ServicePrincipals | Where-Object { $_.accountEnabled -eq $true }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,60 @@ function Get-CIPPAlertInactiveLicensedUsers {
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
[Parameter(Mandatory = $false)]
[switch]$IncludeNeverSignedIn, # Include users who have never signed in (default is to skip them), future use would allow this to be set in an alert configuration
$TenantFilter
)

try {
try {
$Lookup = (Get-Date).AddDays(-90).ToUniversalTime()

# Build base filter - cannot filter assignedLicenses server-side
$BaseFilter = if ($InputValue -eq $true) { "accountEnabled eq true" } else { "" }

$Lookup = (Get-Date).AddDays(-90).ToUniversalTime().ToString('o')
$GraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/users?`$filter=(signInActivity/lastNonInteractiveSignInDateTime le $Lookup)&`$select=id,UserPrincipalName,signInActivity,mail,userType,accountEnabled,assignedLicenses" -scope 'https://graph.microsoft.com/.default' -tenantid $TenantFilter |
Where-Object { $null -ne $_.assignedLicenses.skuId }
$Uri = if ($BaseFilter) {
"https://graph.microsoft.com/beta/users?`$filter=$BaseFilter&`$select=id,UserPrincipalName,signInActivity,mail,userType,accountEnabled,assignedLicenses"
} else {
"https://graph.microsoft.com/beta/users?`$select=id,UserPrincipalName,signInActivity,mail,userType,accountEnabled,assignedLicenses"
}

$GraphRequest = New-GraphGetRequest -uri $Uri -scope 'https://graph.microsoft.com/.default' -tenantid $TenantFilter |
Where-Object { $null -ne $_.assignedLicenses -and $_.assignedLicenses.Count -gt 0 }

# true = only active users
if ($InputValue -eq $true) { $GraphRequest = $GraphRequest | Where-Object { $_.accountEnabled -eq $true } }
$AlertData = foreach ($user in $GraphRequest) {
$Message = 'User {0} has been inactive for 90 days, but still has a license assigned.' -f $user.UserPrincipalName
$user | Select-Object -Property UserPrincipalName, signInActivity, @{Name = 'Message'; Expression = { $Message } }
$lastInteractive = $user.signInActivity.lastSignInDateTime
$lastNonInteractive = $user.signInActivity.lastNonInteractiveSignInDateTime

}
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
# Find most recent sign-in
$lastSignIn = $null
if ($lastInteractive -and $lastNonInteractive) {
$lastSignIn = if ([DateTime]$lastInteractive -gt [DateTime]$lastNonInteractive) { $lastInteractive } else { $lastNonInteractive }
} elseif ($lastInteractive) {
$lastSignIn = $lastInteractive
} elseif ($lastNonInteractive) {
$lastSignIn = $lastNonInteractive
}

} catch {}
# Check if inactive
$isInactive = (-not $lastSignIn) -or ([DateTime]$lastSignIn -le $Lookup)
# Skip users who have never signed in by default (unless IncludeNeverSignedIn is specified)
if (-not $IncludeNeverSignedIn -and -not $lastSignIn) { continue }
# Only process inactive users
if ($isInactive) {
if (-not $lastSignIn) {
$Message = 'User {0} has never signed in but still has a license assigned.' -f $user.UserPrincipalName
} else {
$daysSinceSignIn = [Math]::Round(((Get-Date) - [DateTime]$lastSignIn).TotalDays)
$Message = 'User {0} has been inactive for {1} days but still has a license assigned. Last sign-in: {2}' -f $user.UserPrincipalName, $daysSinceSignIn, $lastSignIn
}

$user | Select-Object -Property UserPrincipalName, signInActivity, @{Name = 'Message'; Expression = { $Message } }
}
}

Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
} catch {}
} catch {
Write-AlertMessage -tenant $($TenantFilter) -message "Failed to check inactive users with licenses for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
}
Expand Down
25 changes: 25 additions & 0 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertLowDomainScore.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function Get-CIPPAlertLowDomainScore {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory)]
$TenantFilter,
[Alias('input')]
[ValidateRange(0, 100)]
[int]$InputValue = 70
)

$DomainData = Get-CIPPDomainAnalyser -TenantFilter $TenantFilter
$LowScoreDomains = $DomainData | Where-Object {
$_.ScorePercentage -lt $InputValue -and $_.ScorePercentage -ne ''
} | ForEach-Object {
"$($_.Domain): Domain security score is $($_.ScorePercentage)%, which is below the threshold of $InputValue%. Issues: $($_.ScoreExplanation)"
}

if ($LowScoreDomains) {
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $LowScoreDomains
}
}
77 changes: 77 additions & 0 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertNewRiskyUsers.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
function Get-CIPPAlertNewRiskyUsers {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$TenantFilter
)
$Deltatable = Get-CIPPTable -Table DeltaCompare
try {
# Check if tenant has P2 capabilities
$Capabilities = Get-CIPPTenantCapabilities -TenantFilter $TenantFilter
if (-not $Capabilities.AADPremiumService) {
Write-AlertMessage -tenant $($TenantFilter) -message 'Tenant does not have Azure AD Premium P2 licensing required for risky users detection'
return
}

$Filter = "PartitionKey eq 'RiskyUsersDelta' and RowKey eq '{0}'" -f $TenantFilter
$RiskyUsersDelta = (Get-CIPPAzDataTableEntity @Deltatable -Filter $Filter).delta | ConvertFrom-Json -ErrorAction SilentlyContinue

# Get current risky users with more detailed information
$NewDelta = (New-GraphGetRequest -uri 'https://graph.microsoft.com/v1.0/identityProtection/riskyUsers' -tenantid $TenantFilter) | Select-Object userPrincipalName, riskLevel, riskState, riskDetail, riskLastUpdatedDateTime, isProcessing, history

$NewDeltatoSave = $NewDelta | ConvertTo-Json -Depth 10 -Compress -ErrorAction SilentlyContinue | Out-String
$DeltaEntity = @{
PartitionKey = 'RiskyUsersDelta'
RowKey = [string]$TenantFilter
delta = "$NewDeltatoSave"
}
Add-CIPPAzDataTableEntity @DeltaTable -Entity $DeltaEntity -Force

if ($RiskyUsersDelta) {
$AlertData = $NewDelta | Where-Object {
$_.userPrincipalName -notin $RiskyUsersDelta.userPrincipalName
} | ForEach-Object {
$riskHistory = if ($_.history) {
$latestHistory = $_.history | Sort-Object -Property riskLastUpdatedDateTime -Descending | Select-Object -First 1
"Previous Risk Level: $($latestHistory.riskLevel), Last Updated: $($latestHistory.riskLastUpdatedDateTime)"
}
else {
'No previous risk history'
}

# Map risk level to severity
$severity = switch ($_.riskLevel) {
'high' { 'Critical' }
'medium' { 'Warning' }
'low' { 'Info' }
default { 'Info' }
}

@{
Message = "New risky user detected: $($_.userPrincipalName)"
Details = @{
RiskLevel = $_.riskLevel
RiskState = $_.riskState
RiskDetail = $_.riskDetail
LastUpdated = $_.riskLastUpdatedDateTime
IsProcessing = $_.isProcessing
RiskHistory = $riskHistory
Severity = $severity
}
}
}

if ($AlertData) {
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
}
}
}
catch {
Write-AlertMessage -tenant $($TenantFilter) -message "Could not get risky users for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
}
}
46 changes: 46 additions & 0 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertOnedriveQuota.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
function Get-CIPPAlertOneDriveQuota {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory)]
$TenantFilter,
[Alias('input')]
[ValidateRange(0,100)]
[int]$InputValue = 90
)

try {
$Usage = New-GraphGetRequest -tenantid $TenantFilter -uri "https://graph.microsoft.com/beta/reports/getOneDriveUsageAccountDetail(period='D7')?`$format=application/json&`$top=999" -AsApp $true
if (!$Usage) {
Write-AlertMessage -tenant $($TenantFilter) -message "OneDrive quota Alert: Unable to get OneDrive usage: Error occurred: No data returned from API."
return
}
}
catch {
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message
Write-AlertMessage -tenant $($TenantFilter) -message "OneDrive quota Alert: Unable to get OneDrive usage: Error occurred: $ErrorMessage"
return
}

#Check if the OneDrive quota is over the threshold
$OverQuota = $Usage | ForEach-Object {
if ($_.StorageUsedInBytes -eq 0 -or $_.storageAllocatedInBytes -eq 0) { return }
try {
$UsagePercent = [math]::Round(($_.storageUsedInBytes / $_.storageAllocatedInBytes) * 100)
} catch { $UsagePercent = 100 }

if ($UsagePercent -gt $InputValue) {
$GBLeft = [math]::Round(($_.storageAllocatedInBytes - $_.storageUsedInBytes) / 1GB)
"$($_.ownerPrincipalName): OneDrive is $UsagePercent% full. OneDrive has $($GBLeft)GB storage left"
}

}

#If the quota is over the threshold, send an alert
if ($OverQuota) {
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $OverQuota
}
}
Loading