-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from BNWEIN/Dev
Dev
- Loading branch information
Showing
213 changed files
with
5,731 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,4 +129,4 @@ | |
# DefaultCommandPrefix = '' | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function ConvertTo-UnixTime { | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] | ||
[datetime]$DateTime | ||
) | ||
|
||
$unixEpoch = [DateTime]::new(1970, 1, 1, 0, 0, 0, [DateTimeKind]::Utc) | ||
$unixTime = ([int64]($DateTime.ToUniversalTime() - $unixEpoch).TotalSeconds) | ||
return $unixTime | ||
} |
25 changes: 25 additions & 0 deletions
25
CIPPAPIModule/public/CIPP/Core/Get-CIPPApplicationQueue.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<# | ||
.SYNOPSIS | ||
Retrieves a list of applications from the queue for a specific customer. | ||
.DESCRIPTION | ||
The Get-CIPPApplicationQueue function retrieves a list of applications from the queue for a specific customer identified by their tenant ID. | ||
.EXAMPLE | ||
Get-CIPPApplicationQueue | ||
Retrieves the applications from the queue for the customer with the tenant ID "7ced1621-b8f7-4231-868c-bc6b1a2f1778". | ||
.NOTES | ||
Requires appropriate permissions to access queue information. | ||
#> | ||
|
||
function Get-CIPPApplicationQueue { | ||
[CmdletBinding()] | ||
Param() | ||
|
||
Write-Verbose "Getting Application Queue for customer: $CustomerTenantID" | ||
$endpoint = '/api/ListApplicationQueue' | ||
$params = @{ | ||
} | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params | ||
} |
57 changes: 57 additions & 0 deletions
57
CIPPAPIModule/public/CIPP/Core/Get-CIPPAuditLogSearches.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<# | ||
.SYNOPSIS | ||
Retrieves audit log searches for a specific customer. | ||
.DESCRIPTION | ||
The Get-CIPPAuditLogSearches function retrieves audit log searches for a specific customer identified by their tenant ID. | ||
.PARAMETER CustomerTenantID | ||
The tenant ID of the customer for whom to retrieve the audit log searches. | ||
.PARAMETER SearchId | ||
The ID of the search to retrieve results for. | ||
.PARAMETER Days | ||
The number of days to retrieve audit log searches for. | ||
.PARAMETER Type | ||
The type of search to perform (e.g., 'Searches', 'SearchResults'). | ||
.EXAMPLE | ||
Get-CIPPAuditLogSearches -CustomerTenantID "7ced1621-b8f7-4231-868c-bc6b1a2f1778" -Type "Searches" | ||
Retrieves the audit log searches for the customer with the tenant ID "7ced1621-b8f7-4231-868c-bc6b1a2f1778". | ||
.EXAMPLE | ||
Get-CIPPAuditLogSearches -CustomerTenantID "7ced1621-b8f7-4231-868c-bc6b1a2f1778" -SearchId "12345" -Type "SearchResults" | ||
Retrieves the results of the audit log search with ID "12345" for the customer with the tenant ID "7ced1621-b8f7-4231-868c-bc6b1a2f1778". | ||
.NOTES | ||
Requires appropriate permissions to access audit log information. | ||
#> | ||
|
||
function Get-CIPPAuditLogSearches { | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$CustomerTenantID, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$SearchId, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[int]$Days, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$Type | ||
) | ||
|
||
Write-Verbose "Getting Audit Log Searches for customer: $CustomerTenantID" | ||
$endpoint = '/api/ListAuditLogSearches' | ||
$params = @{ | ||
tenantFilter = $CustomerTenantID | ||
SearchId = $SearchId | ||
Days = $Days | ||
Type = $Type | ||
} | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<# | ||
.SYNOPSIS | ||
Lists CIPP backups. | ||
.DESCRIPTION | ||
The Get-CIPPBackup function retrieves a list of CIPP backups, with optional filtering capabilities. | ||
.PARAMETER Type | ||
Optional. Filter backups by type. | ||
.PARAMETER TenantFilter | ||
Optional. Filter backups by tenant. | ||
.PARAMETER BackupName | ||
Optional. Filter backups by name. | ||
.PARAMETER NameOnly | ||
Optional. When specified, returns only backup names and timestamps. | ||
.EXAMPLE | ||
Get-CIPPBackup | ||
Returns all backups. | ||
.EXAMPLE | ||
Get-CIPPBackup -Type "Configuration" -TenantFilter "contoso.com" | ||
Returns configuration backups for the specified tenant. | ||
.EXAMPLE | ||
Get-CIPPBackup -NameOnly | ||
Returns a list of backup names and timestamps. | ||
.NOTES | ||
Requires CIPP.Backup.Read permissions. | ||
#> | ||
|
||
function Get-CIPPBackup { | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $false)] | ||
[string]$Type, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$TenantFilter, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$BackupName, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[switch]$NameOnly | ||
) | ||
|
||
Write-Verbose 'Getting backup information' | ||
|
||
$endpoint = '/api/ExecListBackup' | ||
$params = @{} | ||
|
||
if ($Type) { | ||
Write-Verbose "Filtering by type: $Type" | ||
$params['Type'] = $Type | ||
} | ||
if ($TenantFilter) { | ||
Write-Verbose "Filtering by tenant: $TenantFilter" | ||
$params['TenantFilter'] = $TenantFilter | ||
} | ||
if ($BackupName) { | ||
Write-Verbose "Filtering by name: $BackupName" | ||
$params['BackupName'] = $BackupName | ||
} | ||
if ($NameOnly) { | ||
Write-Verbose 'Returning names only' | ||
$params['NameOnly'] = $true | ||
} | ||
|
||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params -Method GET | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<# | ||
.SYNOPSIS | ||
Retrieves a list of community repositories and adds them to the database if they are missing. | ||
.DESCRIPTION | ||
The Get-CIPPCommunityRepos function retrieves a list of community repositories and adds them to the database if they are missing. | ||
.EXAMPLE | ||
Get-CIPPCommunityRepos | ||
Retrieves the community repositories | ||
.NOTES | ||
Requires appropriate permissions to access repository information. | ||
#> | ||
|
||
function Get-CIPPCommunityRepos { | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$CustomerTenantID | ||
) | ||
|
||
Write-Verbose 'Getting Community Repositories' | ||
$endpoint = '/api/ListCommunityRepos' | ||
$params = @{ | ||
} | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params | ||
} |
46 changes: 46 additions & 0 deletions
46
CIPPAPIModule/public/CIPP/Core/Get-CIPPConditionalAccessPolicyChanges.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<# | ||
.SYNOPSIS | ||
Retrieves conditional access policy changes for a specific customer. | ||
.DESCRIPTION | ||
The Get-CIPPConditionalAccessPolicyChanges function retrieves conditional access policy changes for a specific customer identified by their tenant ID. | ||
.PARAMETER CustomerTenantID | ||
The tenant ID of the customer for whom to retrieve the conditional access policy changes. | ||
.PARAMETER PolicyId | ||
The ID of the policy for which to retrieve changes. | ||
.PARAMETER PolicyDisplayName | ||
The display name of the policy for which to retrieve changes. | ||
.EXAMPLE | ||
Get-CIPPConditionalAccessPolicyChanges -CustomerTenantID "7ced1621-b8f7-4231-868c-bc6b1a2f1778" -PolicyId "12345" -PolicyDisplayName "Example Policy" | ||
Retrieves the conditional access policy changes for the policy with ID "12345" and display name "Example Policy" for the customer with the tenant ID "7ced1621-b8f7-4231-868c-bc6b1a2f1778". | ||
.NOTES | ||
Requires appropriate permissions to access conditional access policy information. | ||
#> | ||
|
||
function Get-CIPPConditionalAccessPolicyChanges { | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$CustomerTenantID, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$PolicyId, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$PolicyDisplayName | ||
) | ||
|
||
Write-Verbose "Getting Conditional Access Policy Changes for customer: $CustomerTenantID" | ||
$endpoint = '/api/ListConditionalAccessPolicyChanges' | ||
$params = @{ | ||
tenantFilter = $CustomerTenantID | ||
id = $PolicyId | ||
displayName = $PolicyDisplayName | ||
} | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params | ||
} |
32 changes: 32 additions & 0 deletions
32
CIPPAPIModule/public/CIPP/Core/Get-CIPPConnectionFilterTemplates.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<# | ||
.SYNOPSIS | ||
Retrieves connection filter templates for a specific customer. | ||
.DESCRIPTION | ||
The Get-CIPPConnectionFilterTemplates function retrieves connection filter templates for a specific customer identified by their tenant ID. | ||
.PARAMETER CustomerTenantID | ||
The tenant ID of the customer for whom to retrieve the connection filter templates. | ||
.EXAMPLE | ||
Get-CIPPConnectionFilterTemplates -CustomerTenantID "7ced1621-b8f7-4231-868c-bc6b1a2f1778" | ||
Retrieves the connection filter templates for the customer with the tenant ID "7ced1621-b8f7-4231-868c-bc6b1a2f1778". | ||
.NOTES | ||
Requires appropriate permissions to access connection filter templates. | ||
#> | ||
|
||
function Get-CIPPConnectionFilterTemplates { | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$CustomerTenantID | ||
) | ||
|
||
Write-Verbose "Getting Connection Filter Templates for customer: $CustomerTenantID" | ||
$endpoint = '/api/ListConnectionFilterTemplates' | ||
$params = @{ | ||
tenantFilter = $CustomerTenantID | ||
} | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<# | ||
.SYNOPSIS | ||
Retrieves custom roles for a specific customer. | ||
.DESCRIPTION | ||
The Get-CIPPCustomRole function retrieves custom roles for a specific customer identified by their tenant ID. | ||
.EXAMPLE | ||
Get-CIPPCustomRole | ||
Retrieves the custom roles for the customer. | ||
.NOTES | ||
Requires appropriate permissions to access custom role information. | ||
#> | ||
|
||
function Get-CIPPCustomRole { | ||
[CmdletBinding()] | ||
Param() | ||
|
||
Write-Verbose 'Getting Custom Roles' | ||
$endpoint = '/api/ListCustomRole' | ||
$params = @{} | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<# | ||
.SYNOPSIS | ||
Returns an empty result. | ||
.DESCRIPTION | ||
The Get-CIPPEmptyResult function is a utility function that purposely returns an empty array. | ||
This can be useful for testing, initialization scenarios, or as a placeholder when no data is expected. | ||
.EXAMPLE | ||
Get-CIPPEmptyResult | ||
Returns an empty array. | ||
.NOTES | ||
Requires CIPP.Core permissions. | ||
This is a utility function that always returns an empty array. | ||
#> | ||
|
||
function Get-CIPPEmptyResult { | ||
[CmdletBinding()] | ||
param() | ||
|
||
Write-Verbose 'Retrieving empty result' | ||
|
||
$endpoint = '/api/ListEmptyResults' | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Method GET | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<# | ||
.SYNOPSIS | ||
Retrieves Exo requests for a specific customer. | ||
.DESCRIPTION | ||
The Get-CIPPExoRequest function retrieves Exo requests for a specific customer identified by their tenant ID. | ||
.PARAMETER CustomerTenantID | ||
The tenant ID of the customer for whom to retrieve the Exo requests. | ||
.EXAMPLE | ||
Get-CIPPExoRequest -CustomerTenantID "7ced1621-b8f7-4231-868c-bc6b1a2f1778" | ||
Retrieves the Exo requests for the customer with the tenant ID "7ced1621-b8f7-4231-868c-bc6b1a2f1778". | ||
.NOTES | ||
Requires appropriate permissions to access Exo request information. | ||
#> | ||
|
||
function Get-CIPPExoRequest { | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$CustomerTenantID | ||
) | ||
|
||
Write-Verbose "Getting Exo Requests for customer: $CustomerTenantID" | ||
$endpoint = '/api/ListExoRequest' | ||
$params = @{ | ||
tenantFilter = $CustomerTenantID | ||
} | ||
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params | ||
} |
Oops, something went wrong.