Skip to content

Commit

Permalink
Merge pull request #1 from BNWEIN/Dev
Browse files Browse the repository at this point in the history
Upped Version
  • Loading branch information
BNWEIN authored Jun 14, 2024
2 parents 66369df + 14472e9 commit 6b713ec
Show file tree
Hide file tree
Showing 25 changed files with 542 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CIPPAPIModule.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'CIPPAPIModule.psm1'

# Version number of this module.
ModuleVersion = '1.0.8'
ModuleVersion = '1.0.9'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
18 changes: 18 additions & 0 deletions public/CIPP/Core/Get-CIPPAccessCheck.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function Get-CIPPAccessCheck {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string[]]$CustomerTenantID
)

Write-Verbose "Running tenant access check for $CustomerTenantID"
$Endpoint = "/api/execaccesschecks"

$params = @{
tenants = "true"
}
$body = @{
tenantid = $CustomerTenantID
}
Invoke-CIPPRestMethod -Endpoint $Endpoint -Body $body -Params $params -Method POST
}
22 changes: 22 additions & 0 deletions public/CIPP/Core/Set-CIPPExecCPVPerms.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function Set-CIPPExecCPVPerms {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[guid]$CustomerTenantID,
[Parameter(Mandatory = $false)]
[ValidateSet(
"true",
"false"
)]
[string]$resetsp = "false"
)

Write-Verbose "Refreshing CPV for $CustomerTenantID"
$endpoint = "/api/execcpvpermissions"
$params = @{
tenantfilter = $CustomerTenantID
ResetSP = $resetsp
}
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}

28 changes: 28 additions & 0 deletions public/Email-Exchange/Set-CIPPCopyToSent.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function Set-CIPPCopyToSent {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[string]$UserID,
[Parameter(Mandatory = $false)]
[ValidateSet(
"true",
"false"
)]
[string]$MessageCopyForSentAsEnabled = "true"
)


Write-Verbose "Copy Sent Items to Shared Mailbox for $userID $MessageCopyForSentAsEnabled"

$endpoint = "/api/execcopyforsent"
$params = @{
tenantfilter = $CustomerTenantID
id = $UserID
MessageCopyForSentAsEnabled = $MessageCopyForSentAsEnabled
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}

20 changes: 20 additions & 0 deletions public/Email-Exchange/Set-CIPPEnableArchive.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function Set-CIPPEnableArchive {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[string]$UserID
)


Write-Verbose "Enabling Email Archive for $userID"

$endpoint = "/api/execenablearchive"
$params = @{
tenantfilter = $CustomerTenantID
id = $UserID
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}
26 changes: 26 additions & 0 deletions public/Email-Exchange/Set-CIPPHideFromGAL.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function Set-CIPPHideFromGAL {
param (
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[string]$UserID,
[Parameter(Mandatory = $true)]
[validateset(
'true',
'false'
)]
[string]$hidefromgal
)

Write-Verbose "Setting hide from GAL to $hidefromgal for $UserID"

$endpoint = "/api/exechidefromgal"
$params = @{
tenantfilter = $CustomerTenantID
id = $UserID
hidefromgal = $hidefromgal
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params

}
40 changes: 40 additions & 0 deletions public/Email-Exchange/Set-CIPPMailboxMobileDevices.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
function Set-CIPPMailboxMobileDevices {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $false)]
[string]$DeviceID,
[Parameter(Mandatory = $true)]
[string]$UserID,
[Parameter(Mandatory = $false)]
[ValidateSet("true", "False")]
[string]$Quarantine,
[Parameter(Mandatory = $false)]
[ValidateSet("true", "False")]
[string]$Delete = "False",
[Parameter(Mandatory = $false)]
[guid]$DeviceGUID
)

Write-Verbose "Editing Mobile Device for $UserID"
$endpoint = "/api/execmailboxmobiledevices"
if ($Quarantine) {
$params = @{
tenantfilter = $CustomerTenantID
DeviceID = $DeviceID
Userid = $UserID
Quarantine = $Quarantine
}
} else {
$params = @{
tenantfilter = $CustomerTenantID
Userid = $UserID
Delete = $Delete
GUID = $DeviceGUID
}
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}

33 changes: 33 additions & 0 deletions public/Email-Exchange/Set-CIPPQuarantineManagement.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function Set-CIPPQuarantineManagement {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[string]$ID,
[Parameter(Mandatory = $false)]
[ValidateSet(
'true',
'false'
)]
[string]$AllowSender,
[Parameter(Mandatory = $true)]
[ValidateSet(
'Deny',
'Release,
')]
[string]$Type

)

Write-Verbose "Managing Quarentine for $CustomerTenantID"
$endpoint = "/api/execquarantinemanagement"
$params = @{
tenantfilter = $CustomerTenantID
id = $ID
allowSender = $AllowSender
type = $Type
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}
25 changes: 25 additions & 0 deletions public/Identity/Administration/Groups/Remove-CIPPGroup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function Remove-CIPPGroup {
param (
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[guid]$GroupID,
[Parameter(Mandatory = $true)]
[string]$Grouptype,
[Parameter(Mandatory = $true)]
[string]$DisplayName
)

Write-Verbose "Removing group: $GroupID"

$endpoint = "/api/execgroupsdelete"
$params = @{
tenantfilter = $CustomerTenantID
id = $GroupID
grouptype = $Grouptype
displayname = $DisplayName
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
function Set-CIPPGroupDeliveryManagement {
param (
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[guid]$GroupID,
[Parameter(Mandatory = $true)]
[validateset(
'Distribution List',
'Mail-Enabled Security',
'Microsoft 365'
)]
[string]$Grouptype,
[Parameter(Mandatory = $true)]
[validateset(
'true',
'false'
)]
[string]$onlyallowinternal
)

Write-Verbose "Setting delivery management for group: $GroupID"

$endpoint = "/api/execgroupsdeliverymanagement"
$params = @{
tenantfilter = $CustomerTenantID
id = $GroupID
grouptype = $Grouptype
onlyallowinternal = $onlyallowinternal
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params

}
35 changes: 35 additions & 0 deletions public/Identity/Administration/Groups/Set-CIPPGroupHideFromGAL.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
function Set-CIPPGroupHideFromGAL {
param (
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[guid]$GroupID,
[Parameter(Mandatory = $true)]
[validateset(
'Distribution List',
'Mail-Enabled Security',
'Microsoft 365',
'Security'
)]
[string]$Grouptype,
[Parameter(Mandatory = $true)]
[validateset(
'true',
'false'
)]
[string]$hidefromgal
)

Write-Verbose "Setting hide from GAL to $hidefromgal for $GroupID"

$endpoint = "/api/execgroupshidefromgal"
$params = @{
tenantfilter = $CustomerTenantID
id = $GroupID
grouptype = $Grouptype
hidefromgal = $hidefromgal
}

Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params

}
16 changes: 16 additions & 0 deletions public/Identity/Administration/Users/Get-CIPPUniversalSearch.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function Get-CIPPUniversalSearch {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$Name
)

Write-Verbose "Searching for $Name"

$endpoint = "/api/execuniversalsearch"
$params = @{
name = $Name
}
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}

19 changes: 19 additions & 0 deletions public/Identity/Administration/Users/Send-CIPPPush.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function Send-CIPPPush {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[string]$UserEmail
)

Write-Verbose "Sending Push Notification to $UserEmail"

$endpoint = "/api/execsendpush"
$params = @{
tenantfilter = $CustomerTenantID
Useremail = $UserEmail
}
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}

19 changes: 19 additions & 0 deletions public/Identity/Administration/Users/Set-CIPPCreateTap.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function Set-CIPPCreateTap {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[string]$UserID
)

Write-Verbose "Creating TAP for User: $userID"

$endpoint = "/api/execcreatetap"
$params = @{
tenantfilter = $CustomerTenantID
Id = $UserID
}
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}

27 changes: 27 additions & 0 deletions public/Identity/Administration/Users/Set-CIPPResetPassword.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function Set-CIPPResetPassword {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$CustomerTenantID,
[Parameter(Mandatory = $true)]
[string]$UserID,
[Parameter(Mandatory = $false)]
[ValidateSet(
"true",
"false"
)]
[string]$MustChange = "true"

)

Write-Verbose "Resetting password for $UserID"

$endpoint = "/api/execresetpass"
$params = @{
tenantfilter = $CustomerTenantID
Id = $UserID
MustChange = $MustChange
}
Invoke-CIPPRestMethod -Endpoint $endpoint -Params $params
}

Loading

0 comments on commit 6b713ec

Please sign in to comment.