diff --git a/CIPPAPIModule/CIPPAPIModule.psd1 b/CIPPAPIModule/CIPPAPIModule.psd1 index 9284966..ce70e10 100644 --- a/CIPPAPIModule/CIPPAPIModule.psd1 +++ b/CIPPAPIModule/CIPPAPIModule.psd1 @@ -8,124 +8,125 @@ @{ -# Script module or binary module file associated with this manifest. -RootModule = 'CIPPAPIModule.psm1' - -# Version number of this module. -ModuleVersion = '1.1.9' - -# Supported PSEditions -# CompatiblePSEditions = @() - -# ID used to uniquely identify this module -GUID = '7a30dce3-8696-410b-84cc-4f3ca97b4202' - -# Author of this module -Author = 'Ben Weinberg - Bweinberg@prime-networks.co.uk' - -# Company or vendor of this module -CompanyName = 'Prime Networks' - -# Copyright statement for this module -Copyright = '(c) Ben Weinberg. All rights reserved.' - -# Description of the functionality provided by this module -Description = 'Powershell Module for CIPP-API' - -# Minimum version of the PowerShell engine required by this module -PowerShellVersion = '7.0' - -# Name of the PowerShell host required by this module -# PowerShellHostName = '' - -# Minimum version of the PowerShell host required by this module -# PowerShellHostVersion = '' - -# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# DotNetFrameworkVersion = '' - -# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# ClrVersion = '' - -# Processor architecture (None, X86, Amd64) required by this module -# ProcessorArchitecture = '' - -# Modules that must be imported into the global environment prior to importing this module -# RequiredModules = @() - -# Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() - -# Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @() - -# Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() - -# Format files (.ps1xml) to be loaded when importing this module -# FormatsToProcess = @() - -# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -# NestedModules = @() - -# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = @() - -# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. -CmdletsToExport = @() - -# Variables to export from this module -VariablesToExport = '*' - -# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -AliasesToExport = @() - -# DSC resources to export from this module -# DscResourcesToExport = @() - -# List of all modules packaged with this module -# ModuleList = @() - -# List of all files packaged with this module -# FileList = @() - -# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. -PrivateData = @{ - - PSData = @{ - - # Tags applied to this module. These help with module discovery in online galleries. - # Tags = @() - - # A URL to the license for this module. - # LicenseUri = '' - - # A URL to the main website for this project. - ProjectUri = 'https://github.com/BNWEIN/CIPPAPIModule/' - - # A URL to an icon representing this module. - # IconUri = '' - - # ReleaseNotes of this module - # ReleaseNotes = '' - - # Prerelease string of this module - # Prerelease = '' - - # Flag to indicate whether the module requires explicit user acceptance for install/update/save - # RequireLicenseAcceptance = $false - - # External dependent modules of this module - # ExternalModuleDependencies = @() - - } # End of PSData hashtable - -} # End of PrivateData hashtable - -# HelpInfo URI of this module -# HelpInfoURI = '' - -# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. -# DefaultCommandPrefix = '' - -} + # Script module or binary module file associated with this manifest. + RootModule = 'CIPPAPIModule.psm1' + + # Version number of this module. + ModuleVersion = '1.2.0' + + # Supported PSEditions + # CompatiblePSEditions = @() + + # ID used to uniquely identify this module + GUID = '7a30dce3-8696-410b-84cc-4f3ca97b4202' + + # Author of this module + Author = 'Ben Weinberg - Bweinberg@prime-networks.co.uk' + + # Company or vendor of this module + CompanyName = 'Prime Networks' + + # Copyright statement for this module + Copyright = '(c) Ben Weinberg. All rights reserved.' + + # Description of the functionality provided by this module + Description = 'Powershell Module for CIPP-API' + + # Minimum version of the PowerShell engine required by this module + PowerShellVersion = '7.0' + + # Name of the PowerShell host required by this module + # PowerShellHostName = '' + + # Minimum version of the PowerShell host required by this module + # PowerShellHostVersion = '' + + # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # DotNetFrameworkVersion = '' + + # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # ClrVersion = '' + + # Processor architecture (None, X86, Amd64) required by this module + # ProcessorArchitecture = '' + + # Modules that must be imported into the global environment prior to importing this module + # RequiredModules = @() + + # Assemblies that must be loaded prior to importing this module + # RequiredAssemblies = @() + + # Script files (.ps1) that are run in the caller's environment prior to importing this module. + # ScriptsToProcess = @() + + # Type files (.ps1xml) to be loaded when importing this module + # TypesToProcess = @() + + # Format files (.ps1xml) to be loaded when importing this module + # FormatsToProcess = @() + + # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess + # NestedModules = @() + + # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. + FunctionsToExport = @() + + # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. + CmdletsToExport = @() + + # Variables to export from this module + VariablesToExport = '*' + + # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. + AliasesToExport = @() + + # DSC resources to export from this module + # DscResourcesToExport = @() + + # List of all modules packaged with this module + # ModuleList = @() + + # List of all files packaged with this module + # FileList = @() + + # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. + PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + # Tags = @() + + # A URL to the license for this module. + # LicenseUri = '' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/BNWEIN/CIPPAPIModule/' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + # ReleaseNotes = '' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + + # HelpInfo URI of this module + # HelpInfoURI = '' + + # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. + # DefaultCommandPrefix = '' + + } + \ No newline at end of file diff --git a/CIPPAPIModule/public/Tenant/GDAP/Get-CIPPGDAPInvite.ps1 b/CIPPAPIModule/public/Tenant/GDAP/New-CIPPGDAPInvite.ps1 similarity index 88% rename from CIPPAPIModule/public/Tenant/GDAP/Get-CIPPGDAPInvite.ps1 rename to CIPPAPIModule/public/Tenant/GDAP/New-CIPPGDAPInvite.ps1 index 42cc711..3100167 100644 --- a/CIPPAPIModule/public/Tenant/GDAP/Get-CIPPGDAPInvite.ps1 +++ b/CIPPAPIModule/public/Tenant/GDAP/New-CIPPGDAPInvite.ps1 @@ -3,7 +3,7 @@ Creates a GDAP (Granular Delegated Admin Privileges) invite. .DESCRIPTION -The Get-CIPPGDAPInvite function sends a request to create a GDAP invite using the specified GDAP roles. +The New-CIPPGDAPInvite function sends a request to create a GDAP invite using the specified GDAP roles. You can either provide a custom set of roles using the `-GDAPRoles` parameter or include all existing roles by using the `-UseAllExistingRoles` switch. .PARAMETER GDAPRoles @@ -17,12 +17,12 @@ An array of GDAP roles to be included in the invite. Each role is represented as A switch parameter that, when specified, includes all existing roles in the GDAP invite. This is mutually exclusive with `-GDAPRoles`. .EXAMPLE -PS C:\> Get-CIPPGDAPInvite -GDAPRoles @(@{GroupName="M365 GDAP Cloud Device Administrator";GroupId="fa03defa-27c4-4639-8e50-14cbb746a78d";RoleName="Cloud Device Administrator";roleDefinitionId="7698a772-787b-4ac8-901f-60d6b08affd2"},@{GroupName="M365 GDAP Intune Administrator";GroupId="3d1c917f-8d1e-4a1e-a61c-df3263a0d1bc";RoleName="Intune Administrator";roleDefinitionId="3a2c62db-5318-420d-8d74-23affee5d9d5"}) +PS C:\> New-CIPPGDAPInvite -GDAPRoles @(@{GroupName="M365 GDAP Cloud Device Administrator";GroupId="fa03defa-27c4-4639-8e50-14cbb746a78d";RoleName="Cloud Device Administrator";roleDefinitionId="7698a772-787b-4ac8-901f-60d6b08affd2"},@{GroupName="M365 GDAP Intune Administrator";GroupId="3d1c917f-8d1e-4a1e-a61c-df3263a0d1bc";RoleName="Intune Administrator";roleDefinitionId="3a2c62db-5318-420d-8d74-23affee5d9d5"}) This example creates a GDAP invite with the roles "Cloud Device Administrator" and "Intune Administrator." .EXAMPLE -PS C:\> Get-CIPPGDAPInvite -UseAllExistingRoles +PS C:\> New-CIPPGDAPInvite -UseAllExistingRoles This example creates a GDAP invite including all existing roles retrieved by the `Get-CIPPGDAPRoles` function. @@ -32,7 +32,7 @@ This example creates a GDAP invite including all existing roles retrieved by the - Ensure the GDAP roles are valid and correctly formatted before calling this function. #> -function Get-CIPPGDAPInvite { +function New-CIPPGDAPInvite { [CmdletBinding()] Param( [Parameter(Mandatory = $false)] @@ -59,8 +59,8 @@ function Get-CIPPGDAPInvite { $endpoint = '/api/ExecGDAPInvite' $Body = @{ - gdapRoles = $GDAPRoles + roleMappings = $GDAPRoles } - Invoke-CIPPRestMethod -Endpoint $endpoint -Body $Body + Invoke-CIPPRestMethod -Endpoint $endpoint -Body $Body -Method Post } diff --git a/CIPPAPIModule/public/Tenant/Tools/Get-CIPPGraphRequest.ps1 b/CIPPAPIModule/public/Tenant/Tools/Get-CIPPGraphRequest.ps1 index 8786437..11b1a4a 100644 --- a/CIPPAPIModule/public/Tenant/Tools/Get-CIPPGraphRequest.ps1 +++ b/CIPPAPIModule/public/Tenant/Tools/Get-CIPPGraphRequest.ps1 @@ -79,7 +79,7 @@ function Get-CIPPGraphRequest { } $optionalParams = @{ - '$count' = $count + '$count' = if ($count -eq $true) { 'true' } else { $null } '$select' = $Select 'NoPagination' = if ($DisablePagination) { 'true' } else { 'false' } '$top' = $Top diff --git a/Docs/Add-CIPPRoomMailbox.md b/Docs/Add-CIPPRoomMailbox.md index 02cfdfc..cc3fff7 100644 --- a/Docs/Add-CIPPRoomMailbox.md +++ b/Docs/Add-CIPPRoomMailbox.md @@ -1,41 +1,206 @@ # Add-CIPPRoomMailbox ## SYNOPSIS Adds a room mailbox to a specified tenant. - ## DESCRIPTION -This function adds a room mailbox to a specified tenant by calling the CIPP API endpoint '/api/AddRoomMailbox'. -It requires the tenant ID, display name, domain, and username as mandatory parameters. +This function adds a room mailbox to a specified tenant by calling the CIPP API endpoint '/api/AddRoomMailbox'. +It requires the tenant ID, display name, domain, and username as mandatory parameters. Optionally, the resource capacity can also be specified. - # PARAMETERS ## **-CustomerTenantID** -![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) +> ![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) \ The ID of the customer tenant where the room mailbox will be added. Either TenantID or Default domain can be used to identify the tenant. -## **-DisplayName** -![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) + ## **-DisplayName** +> ![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) \ The display name for the room mailbox. -## **-Domain** -![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) + ## **-Domain** +> ![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) \ The domain for the room mailbox. -## **-Username** -![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) + ## **-Username** +> ![Foo](https://img.shields.io/badge/Type-String-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-TRUE-Red?) \ The username for the room mailbox. -## **-ResourceCapacity** -![Foo](https://img.shields.io/badge/Type-Int32-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-FALSE-Green?) ![Foo](https://img.shields.io/badge/DefaultValue-0-Blue?color=5547a8) + ## **-ResourceCapacity** +> ![Foo](https://img.shields.io/badge/Type-Int32-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-FALSE-Green?) ![Foo](https://img.shields.io/badge/DefaultValue-0-Blue?color=5547a8)\ The resource capacity for the room mailbox. This parameter is optional. ---- - -#### EXAMPLE 1 - + #### EXAMPLE 1 ```powershell -Add-CIPPRoomMailbox -CustomerTenantID "7e3effb6-6efe-42f2-b071-48ce318eaf95" ` - -DisplayName "Conference Room 1" ` - -Domain "example.com" ` - -Username "confroom1" ` - -ResourceCapacity 10 +P +> + +A +d +d +- +R +o +o +m +M +a +i +l +b +o +x + +- +C +u +s +t +o +m +e +r +T +e +n +a +n +t +I +D + +" +7 +e +3 +e +f +f +b +6 +- +6 +e +f +e +- +4 +2 +f +2 +- +b +0 +7 +1 +- +4 +8 +c +e +3 +1 +8 +e +a +f +9 +5 +" + +- +D +i +s +p +l +a +y +N +a +m +e + +" +C +o +n +f +e +r +e +n +c +e + +R +o +o +m + +1 +" + +- +D +o +m +a +i +n + +" +e +x +a +m +p +l +e +. +c +o +m +" + +- +U +s +e +r +n +a +m +e + +" +c +o +n +f +r +o +o +m +1 +" + +- +R +e +s +o +u +r +c +e +C +a +p +a +c +i +t +y + +1 +0 +``` + diff --git a/Docs/New-CIPPGDAPInvite.md b/Docs/New-CIPPGDAPInvite.md new file mode 100644 index 0000000..696bece --- /dev/null +++ b/Docs/New-CIPPGDAPInvite.md @@ -0,0 +1,29 @@ +# New-CIPPGDAPInvite +## SYNOPSIS +Creates a GDAP (Granular Delegated Admin Privileges) invite. +## DESCRIPTION +The New-CIPPGDAPInvite function sends a request to create a GDAP invite using the specified GDAP roles. +You can either provide a custom set of roles using the `-GDAPRoles` parameter or include all existing roles by using the `-UseAllExistingRoles` switch. +# PARAMETERS + +## **-GDAPRoles** +> ![Foo](https://img.shields.io/badge/Type-Array-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-FALSE-Green?) \ +An array of GDAP roles to be included in the invite. Each role is represented as a hashtable with the following keys: - `GroupName`: The name of the role group. - `GroupId`: The unique identifier of the role group. - `RoleName`: The name of the specific role. - `roleDefinitionId`: The unique identifier for the role definition. + + ## **-UseAllExistingRoles** +> ![Foo](https://img.shields.io/badge/Type-SwitchParameter-Blue?) ![Foo](https://img.shields.io/badge/Mandatory-FALSE-Green?) ![Foo](https://img.shields.io/badge/DefaultValue-False-Blue?color=5547a8)\ +A switch parameter that, when specified, includes all existing roles in the GDAP invite. This is mutually exclusive with `-GDAPRoles`. + + #### EXAMPLE 1 +```powershell +PS C:\>New-CIPPGDAPInvite -GDAPRoles @(@{GroupName="M365 GDAP Cloud Device Administrator";GroupId="fa03defa-27c4-4639-8e50-14cbb746a78d";RoleName="Cloud Device Administrator";roleDefinitionId="7698a772-787b-4ac8-901f-60d6b08affd2"},@{GroupName="M365 GDAP Intune Administrator";GroupId="3d1c917f-8d1e-4a1e-a61c-df3263a0d1bc";RoleName="Intune Administrator";roleDefinitionId="3a2c62db-5318-420d-8d74-23affee5d9d5"}) + +This example creates a GDAP invite with the roles "Cloud Device Administrator" and "Intune Administrator." +``` + #### EXAMPLE 2 +```powershell +PS C:\>New-CIPPGDAPInvite -UseAllExistingRoles + +This example creates a GDAP invite including all existing roles retrieved by the `Get-CIPPGDAPRoles` function. +``` + diff --git a/README.md b/README.md index 8943ab4..45282f9 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,6 @@ Get-CIPPLogs - [Get-CIPPLogs](./Docs/Get-CIPPLogs.md) - [Get-CIPPPublicPhishingCheck](./Docs/Get-CIPPPublicPhishingCheck.md) - [Set-CIPPExecCPVPerms](./Docs/Set-CIPPExecCPVPerms.md) -- Scheduler - Settings - [Get-CIPPExcludedLicenses](./Docs/Get-CIPPExcludedLicenses.md) - [Get-CIPPExcludedTenants](./Docs/Get-CIPPExcludedTenants.md) @@ -61,7 +60,6 @@ Get-CIPPLogs - [Set-CIPPExcludeTenant](./Docs/Set-CIPPExcludeTenant.md) - [Set-CIPPExtensionMappingHaloPSA](./Docs/Set-CIPPExtensionMappingHaloPSA.md) - [Set-CIPPPasswordSettings](./Docs/Set-CIPPPasswordSettings.md) -- Setup - [Get-CIPPAccessCheck](./Docs/Get-CIPPAccessCheck.md) - [Get-CIPPExecAPIPermissionsList](./Docs/Get-CIPPExecAPIPermissionsList.md) - [Get-CIPPFunctionParameters](./Docs/Get-CIPPFunctionParameters.md) @@ -135,7 +133,6 @@ Get-CIPPLogs - [Get-CIPPDevices](./Docs/Get-CIPPDevices.md) ## Identity - Administration - - [Devices](./Docs/Devices.md) - [Groups](./Docs/Groups.md) - [Users](./Docs/Users.md) - [Get-CIPPRoles](./Docs/Get-CIPPRoles.md) @@ -144,7 +141,6 @@ Get-CIPPLogs - [Get-CIPPInactiveAccounts](./Docs/Get-CIPPInactiveAccounts.md) - [Get-CIPPMFAUsers](./Docs/Get-CIPPMFAUsers.md) - [Get-CIPPSignIns](./Docs/Get-CIPPSignIns.md) -- Devices - Groups - [Get-CIPPGroups](./Docs/Get-CIPPGroups.md) - [Get-CIPPGroupTemplates](./Docs/Get-CIPPGroupTemplates.md) @@ -268,8 +264,6 @@ Get-CIPPLogs - [Get-CIPPTeamsVoice](./Docs/Get-CIPPTeamsVoice.md) ## Tenant - Administration - - [Alerts](./Docs/Alerts.md) - - [Tenant](./Docs/Tenant.md) - [Get-CIPPAppConsentReqs](./Docs/Get-CIPPAppConsentReqs.md) - [Get-CIPPDomains](./Docs/Get-CIPPDomains.md) - Conditional @@ -278,8 +272,8 @@ Get-CIPPLogs - [Get-CIPPNamedLocations](./Docs/Get-CIPPNamedLocations.md) - [Set-CIPPCAPolicy](./Docs/Set-CIPPCAPolicy.md) - GDAP - - [Get-CIPPGDAPInvite](./Docs/Get-CIPPGDAPInvite.md) - [Get-CIPPGDAPRoles](./Docs/Get-CIPPGDAPRoles.md) + - [New-CIPPGDAPInvite](./Docs/New-CIPPGDAPInvite.md) - [Remove-CIPPGDAPRelationship](./Docs/Remove-CIPPGDAPRelationship.md) - Reports - [Get-CIPPLicenses](./Docs/Get-CIPPLicenses.md) @@ -299,7 +293,6 @@ Get-CIPPLogs - [Get-CIPPGraphRequest](./Docs/Get-CIPPGraphRequest.md) - Alerts - [Get-CIPPAlerts](./Docs/Get-CIPPAlerts.md) -- Application Approval - Tenant - [Get-CIPPADConnectStatus](./Docs/Get-CIPPADConnectStatus.md) - [Get-CIPPOrg](./Docs/Get-CIPPOrg.md) @@ -318,8 +311,8 @@ Get-CIPPLogs - [Get-CIPPCATemplates](./Docs/Get-CIPPCATemplates.md) - [Get-CIPPNamedLocations](./Docs/Get-CIPPNamedLocations.md) - [Set-CIPPCAPolicy](./Docs/Set-CIPPCAPolicy.md) -- [Get-CIPPGDAPInvite](./Docs/Get-CIPPGDAPInvite.md) - [Get-CIPPGDAPRoles](./Docs/Get-CIPPGDAPRoles.md) +- [New-CIPPGDAPInvite](./Docs/New-CIPPGDAPInvite.md) - [Remove-CIPPGDAPRelationship](./Docs/Remove-CIPPGDAPRelationship.md) - [Get-CIPPLicenses](./Docs/Get-CIPPLicenses.md) - [Get-CIPPOAuthApps](./Docs/Get-CIPPOAuthApps.md) @@ -377,3 +370,4 @@ Special thanks to [@KelvinTegelaar](https://github.com/KelvinTegelaar/), [@JohnD +