Skip to content

Commit b578a57

Browse files
committed
Squashed commit of the following:
commit b9c3159 Merge: ada0f46 b579ef9 Author: KelvinTegelaar <[email protected]> Date: Wed May 28 18:59:39 2025 +0200 Merge pull request KelvinTegelaar#1452 from KelvinTegelaar/dev Dev to release commit b579ef9 Author: John Duprey <[email protected]> Date: Wed May 28 12:45:01 2025 -0400 cleanup duplicate auth checks commit e3c423d Merge: 7fe5d5c 56db9be Author: KelvinTegelaar <[email protected]> Date: Wed May 28 18:20:01 2025 +0200 Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev commit 7fe5d5c Author: KelvinTegelaar <[email protected]> Date: Wed May 28 18:19:59 2025 +0200 push version commit 56db9be Merge: 083400f 1c82197 Author: KelvinTegelaar <[email protected]> Date: Wed May 28 18:17:30 2025 +0200 Merge pull request KelvinTegelaar#1448 from kris6673/groupinfo-single-group Fix: Standardize variable casing and enhance groupInfo retrieval commit 083400f Author: John Duprey <[email protected]> Date: Wed May 28 12:07:23 2025 -0400 fix filters commit 8e64a0c Author: John Duprey <[email protected]> Date: Wed May 28 11:00:45 2025 -0400 Update Invoke-ListLogs.ps1 commit 41cc557 Author: John Duprey <[email protected]> Date: Wed May 28 09:49:08 2025 -0400 cleanup rule tweak commit 4735be7 Author: John Duprey <[email protected]> Date: Wed May 28 09:26:43 2025 -0400 add more tables to backup commit f86543a Merge: fe39335 8ef72df Author: KelvinTegelaar <[email protected]> Date: Wed May 28 15:12:00 2025 +0200 Merge pull request KelvinTegelaar#1449 from kris6673/feat-removeFromGroups Feat: Re-add remove from groups and streamline variable names commit 1c82197 Merge: ffa67d4 fe39335 Author: Kristian Kjærgård <[email protected]> Date: Wed May 28 15:08:56 2025 +0200 Merge branch 'dev' into groupinfo-single-group commit fe39335 Author: KelvinTegelaar <[email protected]> Date: Wed May 28 13:24:00 2025 +0200 fixes KelvinTegelaar/CIPP#4031 commit 6fc2c42 Author: KelvinTegelaar <[email protected]> Date: Wed May 28 13:19:06 2025 +0200 fixes license assign commit 925b6bc Author: KelvinTegelaar <[email protected]> Date: Wed May 28 13:10:34 2025 +0200 fix bulk assign licenses commit e8d61cc Merge: 6242c7f 0ca55a2 Author: KelvinTegelaar <[email protected]> Date: Wed May 28 12:45:17 2025 +0200 Merge pull request KelvinTegelaar#1451 from Ren-Roros-Digital/GroupExclude feat: Allow exclude when Group is included commit 6242c7f Merge: 2003b81 0116284 Author: KelvinTegelaar <[email protected]> Date: Wed May 28 12:42:51 2025 +0200 Merge pull request KelvinTegelaar#1450 from ngms-psh/feat-Custom-QuarantinePolicies Feat: Add Custom Quarantine Policies (Additional PR) commit 2003b81 Author: KelvinTegelaar <[email protected]> Date: Wed May 28 12:42:04 2025 +0200 removed troubleshooting info commit 512464b Author: KelvinTegelaar <[email protected]> Date: Wed May 28 11:58:41 2025 +0200 corrected token generation commit 02a318b Author: John Duprey <[email protected]> Date: Tue May 27 19:40:52 2025 -0400 fix cpv refresh for direct tenant commit b2972fc Author: John Duprey <[email protected]> Date: Tue May 27 19:16:39 2025 -0400 update dnshealth commit 0ff5451 Author: John Duprey <[email protected]> Date: Tue May 27 18:45:51 2025 -0400 update cpv to support directTenant commit e7cc8a0 Author: John Duprey <[email protected]> Date: Tue May 27 18:31:55 2025 -0400 fix edit protection policies commit 5520165 Author: John Duprey <[email protected]> Date: Tue May 27 18:19:36 2025 -0400 add sherweb to add user task commit 54d02c5 Author: John Duprey <[email protected]> Date: Tue May 27 18:14:33 2025 -0400 cleanup classic api token usage commit 769cf07 Author: John Duprey <[email protected]> Date: Tue May 27 17:43:48 2025 -0400 improve logging commit 7027184 Author: John Duprey <[email protected]> Date: Tue May 27 17:25:45 2025 -0400 fix group issues commit d57feaa Author: John Duprey <[email protected]> Date: Tue May 27 13:40:24 2025 -0400 logbook improvements commit fd3834a Author: John Duprey <[email protected]> Date: Tue May 27 12:41:56 2025 -0400 Update Start-UpdateTokensTimer.ps1 commit f93af7c Author: John Duprey <[email protected]> Date: Tue May 27 12:37:33 2025 -0400 add automatic secret rotation commit bc71243 Author: John Duprey <[email protected]> Date: Tue May 27 10:53:28 2025 -0400 direct tenant token refreshes commit 95f17b3 Author: KelvinTegelaar <[email protected]> Date: Tue May 27 16:46:30 2025 +0200 good catch john commit 84e747d Author: KelvinTegelaar <[email protected]> Date: Tue May 27 16:43:43 2025 +0200 changes for kv commit 869354a Author: KelvinTegelaar <[email protected]> Date: Tue May 27 15:57:16 2025 +0200 add troubleshooting around kv secret add. commit 0116284 Author: ngms-psh <[email protected]> Date: Tue May 27 14:45:15 2025 +0200 Modified to use Get-Tenants instead of direct from table commit cc25135 Author: ngms-psh <[email protected]> Date: Tue May 27 14:44:29 2025 +0200 Convert function are now called using splatting commit ea12858 Author: ngms-psh <[email protected]> Date: Tue May 27 14:39:14 2025 +0200 Modified to calculate decimalValue from binary all values are now parameters and use parameterSetName commit 0ca55a2 Author: Esco <[email protected]> Date: Tue May 27 13:08:12 2025 +0200 feat: Allow exclude when Group is included commit 3af3902 Author: KelvinTegelaar <[email protected]> Date: Tue May 27 12:56:44 2025 +0200 stupid bug commit 58e3a36 Author: KelvinTegelaar <[email protected]> Date: Tue May 27 12:33:57 2025 +0200 appIdTroubleshooting commit 94f1013 Author: KelvinTegelaar <[email protected]> Date: Tue May 27 11:55:01 2025 +0200 typo commit 2c01e62 Author: KelvinTegelaar <[email protected]> Date: Tue May 27 11:47:44 2025 +0200 ExecSamApp commit d3e781a Author: KelvinTegelaar <[email protected]> Date: Tue May 27 11:47:00 2025 +0200 added appid detection to prevent cache hit commit b965f1f Author: KelvinTegelaar <[email protected]> Date: Tue May 27 11:22:07 2025 +0200 correction for custom roles commit c434360 Author: KelvinTegelaar <[email protected]> Date: Mon May 26 23:33:28 2025 +0200 why you no work. commit be7606c Author: KelvinTegelaar <[email protected]> Date: Mon May 26 23:27:02 2025 +0200 push commit a851aa4 Author: KelvinTegelaar <[email protected]> Date: Mon May 26 23:20:22 2025 +0200 fixes new appid commit 9a7afc8 Author: KelvinTegelaar <[email protected]> Date: Mon May 26 23:04:43 2025 +0200 test commit 7e45dd7 Merge: a143bbb 5640710 Author: KelvinTegelaar <[email protected]> Date: Mon May 26 22:35:19 2025 +0200 Merge pull request KelvinTegelaar#1444 from kris6673/feat-TransportRules-alltenants Feat: Add support for AllTenants in transport rules page commit a143bbb Author: KelvinTegelaar <[email protected]> Date: Mon May 26 22:32:50 2025 +0200 keyvault commit 8ef72df Author: Kristian Kjærgård <[email protected]> Date: Mon May 26 18:54:48 2025 +0200 another syntax thing commit 4777f16 Author: Kristian Kjærgård <[email protected]> Date: Mon May 26 18:45:25 2025 +0200 casing commit 3de0eae Author: Kristian Kjærgård <[email protected]> Date: Mon May 26 18:35:47 2025 +0200 add goose code: add calculatedGroupType to user group output commit 19ca56d Author: KelvinTegelaar <[email protected]> Date: Mon May 26 18:32:48 2025 +0200 updates to caches commit ac8b589 Author: KelvinTegelaar <[email protected]> Date: Mon May 26 16:39:06 2025 +0200 latest dev update commit bf388a7 Author: ngms-psh <[email protected]> Date: Sun May 25 00:08:57 2025 +0200 Updated to use new Set-CIPPQuarantinePolicy function commit ea04249 Author: ngms-psh <[email protected]> Date: Sun May 25 00:07:27 2025 +0200 New function for add/edit quarantine policies and global settings commit 9b939c5 Author: ngms-psh <[email protected]> Date: Sun May 25 00:06:06 2025 +0200 Added endpoints for new quarantine policies page. commit bc9d1f1 Author: ngms-psh <[email protected]> Date: Sun May 25 00:04:15 2025 +0200 Moved from StandardQuarantineTemplate to standalone Function, as it is now used by multiple functions commit 6552633 Author: ngms-psh <[email protected]> Date: Sun May 25 00:02:19 2025 +0200 Added api's for custom quarantine policies and global commit 2e2aaa8 Author: Kristian Kjærgård <[email protected]> Date: Sat May 24 14:43:58 2025 +0200 feat: re-add remove from groups and streamline various variable names and such commit ffa67d4 Author: Kristian Kjærgård <[email protected]> Date: Sat May 24 12:47:13 2025 +0200 fix: standardize variable casing and return more groupInfo for single groups commit 6ac1879 Merge: b8c4a7d e5cb86d Author: KelvinTegelaar <[email protected]> Date: Sat May 24 02:57:17 2025 +0200 Merge pull request KelvinTegelaar#1446 from kris6673/issue4112 commit b8c4a7d Merge: 85181ac 424d89f Author: KelvinTegelaar <[email protected]> Date: Sat May 24 02:56:15 2025 +0200 Merge pull request KelvinTegelaar#1447 from kris6673/issue4100 commit 85181ac Author: John Duprey <[email protected]> Date: Fri May 23 14:44:49 2025 -0400 fix support for addexconnector with limited tenants commit 51c421d Author: John Duprey <[email protected]> Date: Fri May 23 14:34:37 2025 -0400 fix named location endpoint for restricted tenant users commit e7fdbee Author: John Duprey <[email protected]> Date: Fri May 23 14:03:57 2025 -0400 fix logging commit 55a3f16 Merge: dc0df58 04c1cb7 Author: John Duprey <[email protected]> Date: Fri May 23 08:19:29 2025 -0400 Merge pull request KelvinTegelaar#1440 from Zacgoose/return-sorted-tenant-groups commit 424d89f Author: Kristian Kjærgård <[email protected]> Date: Fri May 23 14:08:51 2025 +0200 feat: add all missing ASR options fix: fix Check Signatures Before Scan feat: Add support for deploying ASR rules in audit mode fix: add a check if existing defender settings are incorrect commit e5cb86d Author: Kristian Kjærgård <[email protected]> Date: Fri May 23 12:37:13 2025 +0200 Feat: Add option to set password never expires commit 04c1cb7 Author: Zac Richards <[email protected]> Date: Thu May 22 08:45:11 2025 +0800 Review changes from John commit dc0df58 Author: John Duprey <[email protected]> Date: Wed May 21 17:54:50 2025 -0400 group template edit support also normalize property casing commit 5640710 Author: Kristian Kjærgård <[email protected]> Date: Wed May 21 23:46:06 2025 +0200 Fix up and make a bit prettier commit 3e8c11f Author: Kristian Kjærgård <[email protected]> Date: Wed May 21 23:45:51 2025 +0200 feat: add allTenants support for transport rules page commit 46cc031 Author: John Duprey <[email protected]> Date: Wed May 21 17:13:09 2025 -0400 fix CA check commit 0439ff3 Merge: 63e6f41 732ad86 Author: John Duprey <[email protected]> Date: Wed May 21 16:48:03 2025 -0400 Merge pull request KelvinTegelaar#1443 from kris6673/feat-jit-admin-all-tenants-list Feat: List JIT admin support for all tenants commit 732ad86 Author: Kristian Kjærgård <[email protected]> Date: Wed May 21 22:29:29 2025 +0200 feat:Make JIT admin support all tenants view commit 02be9d3 Author: Kristian Kjærgård <[email protected]> Date: Fri May 16 19:27:54 2025 +0200 progress stuffs commit 63e6f41 Merge: a65b81a 2b04950 Author: KelvinTegelaar <[email protected]> Date: Wed May 21 21:41:25 2025 +0200 Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev commit a65b81a Author: KelvinTegelaar <[email protected]> Date: Wed May 21 21:41:23 2025 +0200 notification fixes commit 2b04950 Author: John Duprey <[email protected]> Date: Wed May 21 14:13:04 2025 -0400 update editintunescript to support other script types commit c493e04 Merge: 559ee33 8e71041 Author: John Duprey <[email protected]> Date: Wed May 21 13:46:56 2025 -0400 Merge pull request KelvinTegelaar#1437 from Zacgoose/TAP-copy-username Add username to TAP response commit 559ee33 Merge: 93c2eff 58be7ea Author: John Duprey <[email protected]> Date: Wed May 21 13:45:56 2025 -0400 Merge pull request KelvinTegelaar#1439 from Jr7468/dev Enhance Set-CIPPCalendarPermission to include CanViewPrivateItems parameter for improved calendar access control commit 93c2eff Merge: 74ecd5f c89da90 Author: John Duprey <[email protected]> Date: Wed May 21 13:45:15 2025 -0400 Merge pull request KelvinTegelaar#1432 from lsmith090/fix-group-addedit fix logic for checking existing group membership commit 74ecd5f Merge: b1dea57 6998d43 Author: John Duprey <[email protected]> Date: Wed May 21 13:41:45 2025 -0400 Merge pull request KelvinTegelaar#1436 from kris6673/feat-EntraConnectSyncStatus-alert Feat: Add EntraConnectSyncStatus alert commit b1dea57 Merge: c62ddc4 9e04c5f Author: John Duprey <[email protected]> Date: Wed May 21 13:38:34 2025 -0400 Merge pull request KelvinTegelaar#1438 from ngms-psh/feat-Custom-QuarantinePolicies Feat: Add Custom Quarantine Policies commit c62ddc4 Merge: e143126 3b66cf0 Author: John Duprey <[email protected]> Date: Wed May 21 13:36:21 2025 -0400 Merge pull request KelvinTegelaar#1441 from kris6673/dkim-domain-exclusion Feat: Add DKIM domain exclusions commit e143126 Merge: d2aac3e 895d8d8 Author: John Duprey <[email protected]> Date: Wed May 21 13:32:18 2025 -0400 Merge pull request KelvinTegelaar#1442 from Ren-Roros-Digital/PhishSimSpoofIntelligence feat: PhishSimSpoofIntelligence replace switch commit d2aac3e Author: John Duprey <[email protected]> Date: Wed May 21 10:26:17 2025 -0400 log alerting tweaks commit 04ce9f6 Merge: 2f6e6ea fd635b6 Author: KelvinTegelaar <[email protected]> Date: Wed May 21 14:22:14 2025 +0200 Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev commit 2f6e6ea Author: KelvinTegelaar <[email protected]> Date: Wed May 21 14:22:12 2025 +0200 add single tenants improvements commit 895d8d8 Author: Esco <[email protected]> Date: Wed May 21 10:06:41 2025 +0200 feat: PhishingSimulations replace switch commit 67a642f Author: Esco <[email protected]> Date: Wed May 21 09:35:08 2025 +0200 feat: PhishSimSpoofIntelligence replace switch commit fd635b6 Author: John Duprey <[email protected]> Date: Tue May 20 23:23:48 2025 -0400 cleanup logging commit da70c01 Author: John Duprey <[email protected]> Date: Tue May 20 23:21:48 2025 -0400 fix ninja logging commit 62595cc Author: John Duprey <[email protected]> Date: Tue May 20 23:17:08 2025 -0400 add more logging commit 806de1c Author: John Duprey <[email protected]> Date: Tue May 20 23:15:42 2025 -0400 Update Push-CIPPStandard.ps1 commit 09c821d Author: John Duprey <[email protected]> Date: Tue May 20 19:44:35 2025 -0400 app deployment standard tweaks commit 497b750 Author: John Duprey <[email protected]> Date: Tue May 20 18:32:42 2025 -0400 app approval template support commit 75e73ce Author: John Duprey <[email protected]> Date: Tue May 20 17:36:03 2025 -0400 app approval template deployment commit c8c04b3 Author: KelvinTegelaar <[email protected]> Date: Tue May 20 23:32:26 2025 +0200 latest execsdsamapp commit f871ae2 Author: John Duprey <[email protected]> Date: Tue May 20 13:39:29 2025 -0400 Update Invoke-ExecAppPermissionTemplate.ps1 commit 1e982e6 Author: John Duprey <[email protected]> Date: Tue May 20 13:29:16 2025 -0400 Update Invoke-ExecAppPermissionTemplate.ps1 commit 40a5b84 Author: John Duprey <[email protected]> Date: Tue May 20 10:02:40 2025 -0400 add import logic for AppPermissions commit 8f5ae25 Author: John Duprey <[email protected]> Date: Tue May 20 09:38:08 2025 -0400 rename apis commit 288c9ef Author: John Duprey <[email protected]> Date: Mon May 19 21:48:09 2025 -0400 app deployment templates commit d3b92b7 Author: John Duprey <[email protected]> Date: Mon May 19 20:07:21 2025 -0400 permission sets commit 763cb4b Author: KelvinTegelaar <[email protected]> Date: Mon May 19 23:47:32 2025 +0200 updates commit 3b66cf0 Author: Kristian Kjærgård <[email protected]> Date: Mon May 19 22:39:09 2025 +0200 Add DKIM domain exclusions add comment commit e269eee Author: KelvinTegelaar <[email protected]> Date: Mon May 19 22:12:35 2025 +0200 remove directTenant from CPV commit 55c1b0d Author: John Duprey <[email protected]> Date: Mon May 19 15:02:13 2025 -0400 fix links commit 76044a9 Author: John Duprey <[email protected]> Date: Mon May 19 13:23:18 2025 -0400 Update Test-CIPPAccess.ps1 commit a3c90a8 Author: John Duprey <[email protected]> Date: Mon May 19 13:17:02 2025 -0400 Update Get-GraphToken.ps1 commit 1b4a7a6 Author: John Duprey <[email protected]> Date: Mon May 19 12:48:25 2025 -0400 Entra Group Auth commit fef71a1 Author: KelvinTegelaar <[email protected]> Date: Mon May 19 17:38:03 2025 +0200 version update commit 4954806 Author: Zac Richards <[email protected]> Date: Mon May 19 18:29:17 2025 +0800 brrrrr commit 4b5b11b Author: Zac Richards <[email protected]> Date: Mon May 19 17:56:54 2025 +0800 Sort both tenant groups and tenants in a group commit e05affb Author: Zac Richards <[email protected]> Date: Mon May 19 17:45:16 2025 +0800 Return sorted tenant groups commit 1947b31 Author: KelvinTegelaar <[email protected]> Date: Mon May 19 10:59:57 2025 +0200 changes commit 3822556 Author: KelvinTegelaar <[email protected]> Date: Mon May 19 10:35:15 2025 +0200 direct tenant add commit 875df46 Author: KelvinTegelaar <[email protected]> Date: Sun May 18 23:22:29 2025 +0200 New APIs for single tenant mode commit c7de828 Author: KelvinTegelaar <[email protected]> Date: Sun May 18 01:11:49 2025 +0200 updates to new sam wizard commit 0695179 Author: KelvinTegelaar <[email protected]> Date: Sat May 17 12:58:35 2025 +0200 new sam wizard steps commit 58be7ea Author: Jr7468 <[email protected]> Date: Fri May 16 21:54:12 2025 +0100 Enhance Set-CIPPCalendarPermission to include CanViewPrivateItems parameter for improved calendar access control commit 9e04c5f Author: ngms-psh <[email protected]> Date: Fri May 16 22:28:12 2025 +0200 Ran Update-StandardsComments commit 5f43d86 Author: ngms-psh <[email protected]> Date: Fri May 16 22:27:35 2025 +0200 Added function for Custom Quarantine Policies commit 5579488 Author: John Duprey <[email protected]> Date: Fri May 16 16:01:53 2025 -0400 Fix HaloPSA ticket creation add _novalidate - thanks to Rewst community Add PSA test option for notification settings commit 8e71041 Author: Zac Richards <[email protected]> Date: Sat May 17 02:08:45 2025 +0800 Add username to TAP response commit 6998d43 Author: Kristian Kjærgård <[email protected]> Date: Fri May 16 19:13:50 2025 +0200 feat: add EntraConnectSyncStatus alert commit 02b234e Author: John Duprey <[email protected]> Date: Fri May 16 12:33:03 2025 -0400 fix listgraphrequest alltenants commit 3c66a35 Merge: 89f8e20 058d8ef Author: KelvinTegelaar <[email protected]> Date: Fri May 16 12:46:33 2025 +0200 Merge pull request KelvinTegelaar#1431 from kris6673/feat-max-email-size Feat: Add action to set max send/receive size for mailboxes commit 89f8e20 Merge: 110f073 cc8e91f Author: KelvinTegelaar <[email protected]> Date: Fri May 16 12:46:10 2025 +0200 Merge pull request KelvinTegelaar#1433 from kris6673/fix-standard-profile-photo Fix: Re-enable Graph functionality for profile photo updates commit 110f073 Merge: 6df9611 eb9bcaa Author: KelvinTegelaar <[email protected]> Date: Fri May 16 12:45:56 2025 +0200 Merge pull request KelvinTegelaar#1434 from kris6673/feat-intune-primary-user Feat: Add change primary user action and refactor functions for better logging commit 6df9611 Merge: 7c09f63 d605650 Author: KelvinTegelaar <[email protected]> Date: Fri May 16 12:45:40 2025 +0200 Merge pull request KelvinTegelaar#1435 from Ren-Roros-Digital/SkypeFix fix: Skype Consumer Interoperability with Teams is no longer supported commit d605650 Author: Esco <[email protected]> Date: Fri May 16 10:41:17 2025 +0200 fix: Skype Consumer Interoperability with Teams is no longer supported commit 7c09f63 Author: KelvinTegelaar <[email protected]> Date: Fri May 16 02:41:51 2025 +0200 DeviceCodeLogin API commit eb9bcaa Author: Kristian Kjærgård <[email protected]> Date: Thu May 15 23:35:32 2025 +0200 Refactor Invoke-ExecDeviceAction and New-CIPPDeviceAction to improve logging and add support for changing primary user commit cc8e91f Author: Kristian Kjærgård <[email protected]> Date: Thu May 15 19:51:37 2025 +0200 clumsy looking but functional commit 0abaa44 Author: Kristian Kjærgård <[email protected]> Date: Thu May 15 19:13:26 2025 +0200 Fix: enable graph part of standard again, now that it works via GDAP commit c89da90 Merge: 4b03379 7e5fe3c Author: lsmith090 <[email protected]> Date: Thu May 15 13:13:45 2025 -0400 Merge branch 'fix-group-addedit' of https://github.com/lsmith090/CIPP-API into fix-group-addedit commit 4b03379 Author: lsmith090 <[email protected]> Date: Thu May 15 13:00:24 2025 -0400 fix logic for checking existing group membership commit 7e5fe3c Author: lsmith090 <[email protected]> Date: Thu May 15 13:00:24 2025 -0400 fix logic for checking existing group membership commit 058d8ef Author: Kristian Kjærgård <[email protected]> Date: Thu May 15 18:29:46 2025 +0200 feat: Add Invoke-ExecSetMailboxEmailSize and Set-CippMaxEmailSize functions to set max send/receive size for mailboxes commit 1efed26 Merge: e4b7e80 34b3f76 Author: KelvinTegelaar <[email protected]> Date: Thu May 15 02:27:20 2025 +0200 Merge pull request KelvinTegelaar#1424 from kris6673/fix-mailboxrules-orchestrator Fix: Fix mailbox rules orchestrator to handle multiple starts gracefully commit e4b7e80 Merge: 8679171 df997af Author: KelvinTegelaar <[email protected]> Date: Thu May 15 02:27:02 2025 +0200 Merge pull request KelvinTegelaar#1425 from Zacgoose/tenantblock-fix Add ip type to returned block/allow listed items returned via API commit 8679171 Merge: a7bd06e adf260d Author: KelvinTegelaar <[email protected]> Date: Thu May 15 02:26:37 2025 +0200 Merge pull request KelvinTegelaar#1426 from kris6673/issue4068 Feat: Add Exchange Outbound Spam Limits standard commit a7bd06e Merge: e0e15f3 31fb2be Author: KelvinTegelaar <[email protected]> Date: Thu May 15 02:26:25 2025 +0200 Merge pull request KelvinTegelaar#1427 from CHRIS-BRANNON/dev Fix 90 Day Guest Filter commit e0e15f3 Merge: f592192 4f3fb33 Author: KelvinTegelaar <[email protected]> Date: Thu May 15 02:26:05 2025 +0200 Merge pull request KelvinTegelaar#1428 from kris6673/fix-remove-type Fix: Remove 'Device' type from Invoke-ListDeletedItems function commit f592192 Merge: 2a2c0a3 46124ab Author: KelvinTegelaar <[email protected]> Date: Thu May 15 02:25:53 2025 +0200 Merge pull request KelvinTegelaar#1429 from kris6673/feat-perma-delete-action Feat: Add permanently delete action commit 2a2c0a3 Merge: 360dadc ccd9c4f Author: KelvinTegelaar <[email protected]> Date: Thu May 15 02:25:38 2025 +0200 Merge pull request KelvinTegelaar#1430 from kris6673/fix-del-user-logging Fix: Enhance user deletion logging commit ccd9c4f Author: Kristian Kjærgård <[email protected]> Date: Wed May 14 17:49:11 2025 +0200 Enhance user deletion logging in Invoke-RemoveUser function commit 46124ab Author: Kristian Kjærgård <[email protected]> Date: Wed May 14 17:41:16 2025 +0200 Change so the error is at the end commit 3b8bcc2 Author: Kristian Kjærgård <[email protected]> Date: Wed May 14 16:56:20 2025 +0200 Add Invoke-RemoveDeletedObject function for permanently deleting directory items commit 7b2d292 Author: Kristian Kjærgård <[email protected]> Date: Wed May 14 16:56:14 2025 +0200 Fix casing of tenantFilter in Invoke-ExecRestoreDeleted function and enhance logging messages for restored items commit 360dadc Author: John Duprey <[email protected]> Date: Tue May 13 15:32:04 2025 -0400 increase concurrency commit 4f3fb33 Author: Kristian Kjærgård <[email protected]> Date: Tue May 13 18:04:48 2025 +0200 fix: Remove 'Device' from types in Invoke-ListDeletedItems function commit 31fb2be Author: Chris Brannon <[email protected]> Date: Tue May 13 11:47:10 2025 -0400 Fix 90 Day Guest Filter commit 0b38f07 Author: Roel van der Wegen <[email protected]> Date: Tue May 13 17:18:09 2025 +0200 Fix alert no MFA user alert commit d5763a0 Author: Roel van der Wegen <[email protected]> Date: Tue May 13 17:17:29 2025 +0200 Fix alert no MFA admin alert commit adf260d Author: Kristian Kjærgård <[email protected]> Date: Tue May 13 16:54:36 2025 +0200 feat: Add new Set Exchange Outbound Spam Limits standard commit 316755d Author: Kristian Kjærgård <[email protected]> Date: Tue May 13 15:21:19 2025 +0200 only compare to default policy Update standard comments commit df997af Author: Zac Richards <[email protected]> Date: Tue May 13 12:06:02 2025 +0800 Add ip type to returned block/allow listed items commit 77b65b2 Merge: 01531ac 8f8d65d Author: Zacgoose <[email protected]> Date: Tue May 13 11:54:03 2025 +0800 Merge pull request #1 from KelvinTegelaar/dev [pull] dev from KelvinTegelaar:dev commit 8f8d65d Author: KelvinTegelaar <[email protected]> Date: Mon May 12 23:47:57 2025 +0200 audit log tenant searches improvements commit 34b3f76 Author: Kristian Kjærgård <[email protected]> Date: Mon May 12 20:56:48 2025 +0200 forgive me for i have sinned commit f244911 Author: Kristian Kjærgård <[email protected]> Date: Mon May 12 20:56:39 2025 +0200 fix: mailbox rules orchestrator cant start multiple times if the user refreshes before its done anymore commit b919903 Merge: f0c1c68 5fee4fe Author: John Duprey <[email protected]> Date: Mon May 12 10:06:42 2025 -0400 Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev commit f0c1c68 Author: John Duprey <[email protected]> Date: Mon May 12 10:06:40 2025 -0400 Update SAMManifest.json commit 5fee4fe Merge: 133193c 5454d32 Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:22:51 2025 +0200 Merge pull request KelvinTegelaar#1414 from Zacgoose/Room-Mailboxes Feat: Add advanced options for Room Mailboxes commit 133193c Merge: 49b4772 38b1e35 Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:21:57 2025 +0200 Merge pull request KelvinTegelaar#1416 from Zacgoose/update-mailbox-report Updated mailbox report api for new frontend page commit 49b4772 Merge: a62c1ed 63ea0e4 Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:21:06 2025 +0200 Merge pull request KelvinTegelaar#1418 from Zacgoose/tenantblockallow-fix Handles individual and multiple values correctly commit a62c1ed Merge: 093c146 bd6aa3e Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:20:30 2025 +0200 Merge pull request KelvinTegelaar#1419 from kris6673/feat-cleaner-TAP-copy Fix: Prettier TAP copy action commit 093c146 Merge: 173a251 9bb4001 Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:19:52 2025 +0200 Merge pull request KelvinTegelaar#1420 from Ren-Roros-Digital/OutOfOffice chore: SetOoO consistent variables commit 173a251 Merge: 7c7e0f4 ec3dfb1 Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:19:16 2025 +0200 Merge pull request KelvinTegelaar#1421 from Ren-Roros-Digital/AntiPhishing feat: Anti-Phishing additional defaults commit 7c7e0f4 Merge: 2811231 4722027 Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:18:52 2025 +0200 Merge pull request KelvinTegelaar#1422 from sfaxluke/patch-1 Fix: Hudu adjusted Microsoft URL's commit 2811231 Merge: 01531ac d2ef2a2 Author: KelvinTegelaar <[email protected]> Date: Mon May 12 07:18:42 2025 +0200 Merge pull request KelvinTegelaar#1423 from Zacgoose/ninja-links Fix ninja ms365 admin links commit d2ef2a2 Author: Zac Richards <[email protected]> Date: Sun May 11 07:38:28 2025 +0800 fix ninja ms365 admin links commit 4722027 Author: Luke Steward <[email protected]> Date: Fri May 9 14:07:34 2025 +0100 Adjusted Microsoft URL's Adjusted URL's to match the new format for Exchange and Admin centre and aligned the Intune URL's to new endpoint commit ec3dfb1 Author: Esco <[email protected]> Date: Thu May 8 15:03:08 2025 +0200 feat: Anti-Phishing additional defaults * Enable user to protect by default * Enable include custom domains by default * Resolves https://discord.com/channels/905453405936447518/1199069319850639410/1370012245488046112 commit 9bb4001 Author: Esco <[email protected]> Date: Thu May 8 10:06:52 2025 +0200 fix: use correct Intune Template PolicyName commit 765f70a Author: Esco <[email protected]> Date: Thu May 8 10:00:06 2025 +0200 chore: SetOoO consistent variables commit bd6aa3e Author: Kristian Kjærgård <[email protected]> Date: Wed May 7 19:46:19 2025 +0200 Refactor New-CIPPTAP to return object thats better to copy in the frontend, while adding properties to make API module ease of use better commit effedec Author: Kristian Kjærgård <[email protected]> Date: Wed May 7 19:45:09 2025 +0200 Refactor password assignment logic in Invoke-ExecJITAdmin function for clarity commit 01531ac Merge: a32bdf9 11d7a16 Author: Roel van der Wegen <[email protected]> Date: Wed May 7 06:47:55 2025 -0400 Merge pull request KelvinTegelaar#1417 from kris6673/fix-alert-deduplication Fix: Alert deduplication bug commit 11d7a16 Author: Kristian Kjærgård <[email protected]> Date: Wed May 7 12:47:51 2025 +0200 Update SAMManifest.json commit 5229aaf Merge: bdf1815 a32bdf9 Author: Kristian Kjærgård <[email protected]> Date: Wed May 7 12:47:28 2025 +0200 Merge branch 'dev' into fix-alert-deduplication commit a32bdf9 Merge: c98fbbe 4e9540c Author: Roel van der Wegen <[email protected]> Date: Wed May 7 06:45:02 2025 -0400 Merge pull request KelvinTegelaar#1415 from Ren-Roros-Digital/normalize chore: CRLF to LF commit 63ea0e4 Author: Zac Richards <[email protected]> Date: Tue May 6 10:39:25 2025 +0800 handles individual and multiple values correctly commit bdf1815 Author: Kristian Kjærgård <[email protected]> Date: Mon May 5 23:51:56 2025 +0200 change encoding to LF commit e12b481 Author: Kristian Kjærgård <[email protected]> Date: Mon May 5 23:50:12 2025 +0200 fix: alert deduplication logData JSON conversion bug that caused identical logdata to trigger an alert commit 38b1e35 Author: Zac Richards <[email protected]> Date: Sun May 4 20:02:17 2025 +0800 updated mailbox report api for frontend commit 4e9540c Author: Esco <[email protected]> Date: Thu May 1 16:01:33 2025 +0200 chore: CRLF to LF commit c98fbbe Author: John Duprey <[email protected]> Date: Thu May 1 09:00:35 2025 -0400 durable cleanup fix part 2 commit 5454d32 Author: Zac Richards <[email protected]> Date: Thu May 1 18:42:37 2025 +0800 addition of new options commit 6ce3831 Author: Roel van der Wegen <[email protected]> Date: Thu May 1 00:20:25 2025 +0200 Remove un-used/overprivileged Mail.Send commit 68a6fc3 Author: Roel van der Wegen <[email protected]> Date: Thu May 1 00:19:58 2025 +0200 Remove un-used/overprivileged Mail.Send b633e1c5-b582-4048-a93e-9f11b44c7e96
1 parent 0c66838 commit b578a57

File tree

166 files changed

+10121
-6659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+10121
-6659
lines changed

Cache_SAMSetup/PermissionsTranslator.json

Lines changed: 5350 additions & 5350 deletions
Large diffs are not rendered by default.

Cache_SAMSetup/SAMManifest.json

Lines changed: 193 additions & 194 deletions
Large diffs are not rendered by default.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
function Convert-QuarantinePermissionsValue {
2+
[CmdletBinding(DefaultParameterSetName = 'DecimalValue')]
3+
param (
4+
[Parameter(Mandatory, Position = 0, ParameterSetName = "StringValue")]
5+
[ValidateNotNullOrEmpty()]
6+
[string]$InputObject,
7+
8+
[Parameter(Position = 0, ParameterSetName = "DecimalValue")]
9+
[int]$PermissionToViewHeader = 0,
10+
[Parameter(Position = 1, ParameterSetName = "DecimalValue")]
11+
[int]$PermissionToDownload = 0,
12+
[Parameter(Mandatory, Position = 2, ParameterSetName = "DecimalValue")]
13+
[int]$PermissionToAllowSender,
14+
[Parameter(Mandatory, Position = 3, ParameterSetName = "DecimalValue")]
15+
[int]$PermissionToBlockSender,
16+
[Parameter(Mandatory, Position = 4, ParameterSetName = "DecimalValue")]
17+
[int]$PermissionToRequestRelease,
18+
[Parameter(Mandatory, Position = 5, ParameterSetName = "DecimalValue")]
19+
[int]$PermissionToRelease,
20+
[Parameter(Mandatory, Position = 6, ParameterSetName = "DecimalValue")]
21+
[int]$PermissionToPreview,
22+
[Parameter(Mandatory, Position = 7, ParameterSetName = "DecimalValue")]
23+
[int]$PermissionToDelete
24+
)
25+
26+
#Converts string value with EndUserQuarantinePermissions received from Get-QuarantinePolicy
27+
if (($PSCmdlet.ParameterSetName) -eq "StringValue") {
28+
try {
29+
# Remove square brackets and split into lines
30+
$InputObject = $InputObject.Trim('[', ']')
31+
$hashtable = @{}
32+
$InputObject -split "`n" | ForEach-Object {
33+
$key, $value = $_ -split ":\s*"
34+
$hashtable[$key.Trim()] = [System.Convert]::ToBoolean($value.Trim())
35+
}
36+
return $hashtable
37+
}
38+
catch {
39+
throw "Convert-QuarantinePermissionsValue: Failed to convert string to hashtable."
40+
}
41+
}
42+
43+
#Converts selected end user quarantine permissions to decimal value used by EndUserQuarantinePermissionsValue property in New-QuarantinePolicy and Set-QuarantinePolicy
44+
elseif (($PSCmdlet.ParameterSetName) -eq "DecimalValue") {
45+
try {
46+
# both PermissionToRequestRelease and PermissionToRelease cannot be set to true at the same time
47+
if($PermissionToRequestRelease -eq 1 -and $PermissionToRelease -eq 1) {
48+
throw "PermissionToRequestRelease and PermissionToRelease cannot both be set to true."
49+
}
50+
51+
# Convert each permission to a binary string
52+
$BinaryValue = [string]@(
53+
$PermissionToViewHeader,
54+
$PermissionToDownload,
55+
$PermissionToAllowSender,
56+
$PermissionToBlockSender,
57+
$PermissionToRequestRelease,
58+
$PermissionToRelease,
59+
$PermissionToPreview,
60+
$PermissionToDelete
61+
) -replace '\s',''
62+
63+
# Convert the binary string to an Decimal value
64+
return [convert]::ToInt32($BinaryValue,2)
65+
}
66+
catch {
67+
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message
68+
throw "Convert-QuarantinePermissionsValue: Failed to convert QuarantinePermissions to QuarantinePermissionsValue. Error: $ErrorMessage"
69+
}
70+
}
71+
}

Modules/CIPPCore/Public/Add-CIPPApplicationPermission.ps1

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ function Add-CIPPApplicationPermission {
22
[CmdletBinding()]
33
param(
44
$RequiredResourceAccess,
5+
$TemplateId,
56
$ApplicationId,
67
$Tenantfilter
78
)
@@ -31,7 +32,34 @@ function Add-CIPPApplicationPermission {
3132

3233
$RequiredResourceAccess.Add($Resource)
3334
}
35+
} else {
36+
if (!$RequiredResourceAccess -and $TemplateId) {
37+
Write-Information "Adding application permissions for template $TemplateId"
38+
$TemplateTable = Get-CIPPTable -TableName 'templates'
39+
$Filter = "RowKey eq '$TemplateId' and PartitionKey eq 'AppApprovalTemplate'"
40+
$Template = (Get-CIPPAzDataTableEntity @TemplateTable -Filter $Filter).JSON | ConvertFrom-Json -ErrorAction SilentlyContinue
41+
$ApplicationId = $Template.AppId
42+
$Permissions = $Template.Permissions
43+
$RequiredResourceAccess = [System.Collections.Generic.List[object]]::new()
44+
foreach ($AppId in $Permissions.PSObject.Properties.Name) {
45+
$AppPermissions = @($Permissions.$AppId.applicationPermissions)
46+
$Resource = @{
47+
resourceAppId = $AppId
48+
resourceAccess = [System.Collections.Generic.List[object]]::new()
49+
}
50+
foreach ($Permission in $AppPermissions) {
51+
$Resource.ResourceAccess.Add(@{
52+
id = $Permission.id
53+
type = 'Role'
54+
})
55+
}
56+
57+
$RequiredResourceAccess.Add($Resource)
58+
}
59+
}
3460
}
61+
62+
3563
$ServicePrincipalList = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/servicePrincipals?`$select=AppId,id,displayName&`$top=999" -skipTokenCache $true -tenantid $Tenantfilter -NoAuthCheck $true
3664
$ourSVCPrincipal = $ServicePrincipalList | Where-Object -Property AppId -EQ $ApplicationId
3765
if (!$ourSVCPrincipal) {
@@ -59,7 +87,7 @@ function Add-CIPPApplicationPermission {
5987
}
6088
}
6189
foreach ($SingleResource in $App.ResourceAccess | Where-Object -Property Type -EQ 'Role') {
62-
if ($SingleResource.id -In $CurrentRoles.appRoleId) { continue }
90+
if ($SingleResource.id -in $CurrentRoles.appRoleId) { continue }
6391
[pscustomobject]@{
6492
principalId = $($ourSVCPrincipal.id)
6593
resourceId = $($svcPrincipalId.id)

Modules/CIPPCore/Public/Add-CIPPDelegatedPermission.ps1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ function Add-CIPPDelegatedPermission {
22
[CmdletBinding()]
33
param(
44
$RequiredResourceAccess,
5+
$TemplateId,
56
$ApplicationId,
67
$NoTranslateRequired,
78
$Tenantfilter
@@ -40,7 +41,34 @@ function Add-CIPPDelegatedPermission {
4041
# remove the partner center permission if not pushing to partner tenant
4142
$RequiredResourceAccess = $RequiredResourceAccess | Where-Object { $_.resourceAppId -ne 'fa3d9a0c-3fb0-42cc-9193-47c7ecd2edbd' }
4243
}
44+
} else {
45+
if (!$RequiredResourceAccess -and $TemplateId) {
46+
Write-Information "Adding delegated permissions for template $TemplateId"
47+
$TemplateTable = Get-CIPPTable -TableName 'templates'
48+
$Filter = "RowKey eq '$TemplateId' and PartitionKey eq 'AppApprovalTemplate'"
49+
$Template = (Get-CIPPAzDataTableEntity @TemplateTable -Filter $Filter).JSON | ConvertFrom-Json -ErrorAction SilentlyContinue
50+
$ApplicationId = $Template.AppId
51+
$Permissions = $Template.Permissions
52+
$NoTranslateRequired = $true
53+
$RequiredResourceAccess = [System.Collections.Generic.List[object]]::new()
54+
foreach ($AppId in $Permissions.PSObject.Properties.Name) {
55+
$DelegatedPermissions = @($Permissions.$AppId.delegatedPermissions)
56+
$ResourceAccess = [System.Collections.Generic.List[object]]::new()
57+
foreach ($Permission in $DelegatedPermissions) {
58+
$ResourceAccess.Add(@{
59+
id = $Permission.value
60+
type = 'Scope'
61+
})
62+
}
63+
$Resource = @{
64+
resourceAppId = $AppId
65+
resourceAccess = @($ResourceAccess)
66+
}
67+
$RequiredResourceAccess.Add($Resource)
68+
}
69+
}
4370
}
71+
4472
$Translator = Get-Content '.\PermissionsTranslator.json' | ConvertFrom-Json
4573
$ServicePrincipalList = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/servicePrincipals?`$select=appId,id,displayName&`$top=999" -tenantid $Tenantfilter -skipTokenCache $true -NoAuthCheck $true
4674
$ourSVCPrincipal = $ServicePrincipalList | Where-Object -Property appId -EQ $ApplicationId
@@ -66,6 +94,7 @@ function Add-CIPPDelegatedPermission {
6694
}
6795

6896
$DelegatedScopes = $App.resourceAccess | Where-Object -Property type -EQ 'Scope'
97+
6998
if ($NoTranslateRequired) {
7099
$NewScope = @($DelegatedScopes | ForEach-Object { $_.id } | Sort-Object -Unique) -join ' '
71100
} else {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
function Get-CIPPAlertEntraConnectSyncStatus {
3+
<#
4+
.FUNCTIONALITY
5+
Entrypoint
6+
#>
7+
[CmdletBinding()]
8+
param(
9+
[Parameter(Mandatory = $false)]
10+
[Alias('input')]
11+
$InputValue,
12+
$TenantFilter
13+
)
14+
try {
15+
# Set Hours with fallback to 72 hours
16+
$Hours = if ($InputValue) { [int]$InputValue } else { 72 }
17+
$ConnectSyncStatus = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/organization?$select=onPremisesLastPasswordSyncDateTime,onPremisesLastSyncDateTime,onPremisesSyncEnabled' -tenantid $TenantFilter
18+
19+
if ($ConnectSyncStatus.onPremisesSyncEnabled -eq $true) {
20+
$LastPasswordSync = $ConnectSyncStatus.onPremisesLastPasswordSyncDateTime
21+
$SyncDateTime = $ConnectSyncStatus.onPremisesLastSyncDateTime
22+
# Get the older of the two sync times
23+
$LastSync = if ($SyncDateTime -lt $LastPasswordSync) { $SyncDateTime } else { $LastPasswordSync }
24+
25+
if ($LastSync -lt (Get-Date).AddHours(-$Hours).ToUniversalTime()) {
26+
$AlertData = "Entra Connect Sync for $($TenantFilter) has not run for over $Hours hours. Last sync was at $($LastSync.ToString('o'))"
27+
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
28+
}
29+
}
30+
} catch {
31+
Write-AlertMessage -tenant $($TenantFilter) -message "Could not get Entra Connect Sync Status for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
32+
}
33+
}

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertMFAAdmins.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function Get-CIPPAlertMFAAdmins {
1818
}
1919
}
2020
if (!$DuoActive) {
21-
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq true and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
21+
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq true and isMfaRegistered eq false and userType eq 'member'&`$select=userDisplayName,userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
2222
if ($users.UserPrincipalName) {
2323
$AlertData = "The following admins do not have MFA registered: $($users.UserPrincipalName -join ', ')"
2424
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertMFAAlertUsers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Get-CIPPAlertMFAAlertUsers {
1212
)
1313
try {
1414

15-
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq false and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
15+
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq false and isMfaRegistered eq false and userType eq 'member'&`$select=userDisplayName,userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
1616
if ($users.UserPrincipalName) {
1717
$AlertData = "The following $($users.Count) users do not have MFA registered: $($users.UserPrincipalName -join ', ')"
1818
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
function Get-CIPPAccessRole {
2+
<#
3+
.SYNOPSIS
4+
Get the access role for the current user
5+
6+
.DESCRIPTION
7+
Get the access role for the current user
8+
9+
.PARAMETER TenantID
10+
The tenant ID to check the access role for
11+
12+
.EXAMPLE
13+
Get-CippAccessRole -UserId $UserId
14+
15+
.FUNCTIONALITY
16+
Internal
17+
#>
18+
[CmdletBinding()]
19+
param($Request)
20+
21+
$CacheAccessUserRoleTable = Get-CIPPTable -tablename 'cacheAccessUserRole'
22+
$CachedRoles = Get-CIPPAzDataTableEntity @CacheAccessUserRoleTable -Filter "PartitionKey eq 'AccessUser' and RowKey eq '$($Request.Headers.'x-ms-client-principal-name')'" | Select-Object -ExpandProperty Role | ConvertFrom-Json
23+
24+
$SwaCreds = ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($request.headers.'x-ms-client-principal')) | ConvertFrom-Json)
25+
$SwaRoles = $SwaCreds.userRoles
26+
27+
# Combine SWA roles and cached roles into a single deduplicated list
28+
$AllRoles = [System.Collections.Generic.List[string]]::new()
29+
if ($null -ne $SwaRoles) {
30+
$AllRoles.AddRange($SwaRoles)
31+
}
32+
if ($null -ne $CachedRoles) {
33+
$AllRoles.AddRange($CachedRoles)
34+
}
35+
36+
# Remove duplicates and ensure we have a clean array
37+
$CombinedRoles = $AllRoles | Select-Object -Unique
38+
39+
# For debugging
40+
Write-Information "Combined Roles: $($CombinedRoles -join ', ')"
41+
return $CombinedRoles
42+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
function Set-CIPPAccessRole {
2+
<#
3+
.SYNOPSIS
4+
Set the access role mappings
5+
6+
.DESCRIPTION
7+
Set the access role mappings for Entra groups
8+
9+
.PARAMETER Role
10+
The role to set (e.g. 'superadmin','admin','editor','readonly','customrole')
11+
12+
.PARAMETER Group
13+
The Entra group to set the role for
14+
15+
.FUNCTIONALITY
16+
Internal
17+
#>
18+
[CmdletBinding(SupportsShouldProcess = $true)]
19+
Param(
20+
[Parameter(Mandatory = $true)]
21+
[string]$Role,
22+
[Parameter(Mandatory = $true)]
23+
[string]$Group
24+
)
25+
26+
$BlacklistedRoles = @('authenticated', 'anonymous')
27+
28+
if ($BlacklistedRoles -contains $Role) {
29+
throw 'Role group cannot be set for authenticated or anonymous roles'
30+
}
31+
32+
if (!$Group.id -or !$Group.displayName) {
33+
throw 'Group is not valid'
34+
}
35+
36+
$Role = $Role.ToLower().Trim() -replace ' ', ''
37+
38+
$Table = Get-CippTable -TableName AccessRoleGroups
39+
$AccessGroup = Get-CIPPAzDataTableEntity @Table -Filter "RowKey = '$Role'"
40+
41+
$AccessGroup = [PSCustomObject]@{
42+
PartitionKey = [string]'AccessRole'
43+
RowKey = [string]$Role
44+
GroupId = [string]$Group.id
45+
GroupName = [string]$Group.displayName
46+
}
47+
48+
if ($PSCmdlet.ShouldProcess("Setting access role $Role for group $($Group.displayName)")) {
49+
Add-CIPPAzDataTableEntity -Table $Table -Entity $AccessGroup -Force
50+
}
51+
}

0 commit comments

Comments
 (0)