Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 30 additions & 50 deletions PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,56 +25,36 @@ $ApprovedFunctions = [Ordered]@{
# Destination = '/Public/Reports';
# }
);
#'JumpCloud.SDK.V2' = @(
# [PSCustomObject]@{
# Name = 'Get-JcSdkAppleMdm';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Remove-JcSdkAppleMdm';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Set-JcSdkAppleMdm';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Get-JcSdkAppleMdmCsr';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Get-JcSdkAppleMdmDepKey';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Clear-JcSdkAppleMdmDevice';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Get-JcSdkAppleMdmDevice';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Lock-JcSdkAppleMdmDevice';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Restart-JcSdkAppleMdmDevice';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Stop-JcSdkAppleMdmDevice';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Sync-JcSdkAppleMdmDevice';
# Destination = '/Public/AppleMdm';
# },
# [PSCustomObject]@{
# Name = 'Get-JcSdkAppleMdmEnrollmentProfile';
# Destination = '/Public/AppleMdm';
# }
#)
'JumpCloud.SDK.V2' = @(
[PSCustomObject]@{
Name = 'Get-JcSdkSystemGroup';
Destination = '/Public/Groups/SystemGroups';
},
[PSCustomObject]@{
Name = 'Get-JcSdkUserGroup';
Destination = '/Public/Groups/UserGroups';
},
[PSCustomObject]@{
Name = 'Get-JcSdkPolicyGroup';
Destination = '/Public/Groups/PolicyGroups';
},
[PSCustomObject]@{
Name = 'New-JcSdkPolicyGroup';
Destination = '/Public/Groups/PolicyGroups';
},
[PSCustomObject]@{
Name = 'Remove-JcSdkPolicyGroup';
Destination = '/Public/Groups/PolicyGroups';
},
[PSCustomObject]@{
Name = 'Get-JcSdkPolicyGroupMember';
Destination = '/Public/Groups/PolicyGroups';
},
[PSCustomObject]@{
Name = 'Set-JcSdkPolicyGroupMember';
Destination = '/Public/Groups/PolicyGroups';
}
)
}
$SdkPrefix = 'JcSdk'
$JumpCloudModulePrefix = 'JC'
Expand Down
85 changes: 43 additions & 42 deletions PowerShell/JumpCloud Module/JumpCloud.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: JumpCloud Solutions Architect Team
#
# Generated on: 1/22/2026
# Generated on: 3/12/2026
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = 'JumpCloud.psm1'

# Version number of this module.
ModuleVersion = '3.0.2'
ModuleVersion = '3.1.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -51,8 +51,8 @@ PowerShellVersion = '4.0'
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
'JumpCloud.SDK.V1',
RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
'JumpCloud.SDK.V1',
'JumpCloud.SDK.V2')

# Assemblies that must be loaded prior to importing this module
Expand All @@ -71,42 +71,43 @@ RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
# 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 = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Add-JCGsuiteMember',
'Add-JCOffice365Member', 'Add-JCRadiusReplyAttribute',
'Add-JCSystemGroupMember', 'Add-JCSystemUser',
'Add-JCUserGroupMember', 'Backup-JCOrganization', 'Connect-JCOnline',
'Copy-JCAssociation', 'Get-JCAdmin', 'Get-JCAssociation',
'Get-JCBackup', 'Get-JCCloudDirectory', 'Get-JCCommand',
'Get-JCCommandResult', 'Get-JCCommandTarget',
'Get-JCConfiguredTemplatePolicy', 'Get-JCEvent', 'Get-JCEventCount',
'Get-JCGroup', 'Get-JCOrganization', 'Get-JCPolicy',
'Get-JCPolicyGroup', 'Get-JCPolicyGroupMember',
'Get-JCPolicyGroupTemplate', 'Get-JCPolicyGroupTemplateMember',
'Get-JCPolicyResult', 'Get-JCPolicyTargetGroup',
'Get-JCPolicyTargetSystem', 'Get-JCRadiusReplyAttribute',
'Get-JCRadiusServer', 'Get-JCReport', 'Get-JCScheduledUserstate',
'Get-JCSystem', 'Get-JCSystemApp', 'Get-JCSystemGroupMember',
'Get-JCSystemInsights', 'Get-JCSystemKB', 'Get-JCSystemUser',
'Get-JCUser', 'Get-JCUserGroupMember', 'Import-JCCommand',
'Import-JCMSPFromCSV', 'Import-JCUsersFromCSV', 'Invoke-JCCommand',
'Invoke-JCDeployment', 'New-JCCommand', 'New-JCDeploymentTemplate',
'New-JCDeviceUpdateTemplate', 'New-JCImportTemplate',
'New-JCMSPImportTemplate', 'New-JCPolicy', 'New-JCPolicyGroup',
'New-JCRadiusServer', 'New-JCReport', 'New-JCSystemGroup', 'New-JCUser',
'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand',
'Remove-JCCommandResult', 'Remove-JCCommandTarget',
'Remove-JCGsuiteMember', 'Remove-JCOffice365Member',
'Remove-JCPolicy', 'Remove-JCPolicyGroup',
'Remove-JCPolicyGroupTemplate', 'Remove-JCRadiusReplyAttribute',
'Remove-JCRadiusServer', 'Remove-JCSystem', 'Remove-JCSystemGroup',
'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser',
'Remove-JCUserGroup', 'Remove-JCUserGroupMember',
'Send-JCPasswordReset', 'Set-JCCloudDirectory', 'Set-JCCommand',
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCPolicyGroup',
'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer',
'Set-JCSettingsFile', 'Set-JCSystem', 'Set-JCSystemUser', 'Set-JCUser',
'Set-JCUserGroupLDAP', 'Update-JCDeviceFromCSV', 'Update-JCModule',
'Update-JCMSPFromCSV', 'Update-JCUsersFromCSV'
FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Add-JCGsuiteMember',
'Add-JCOffice365Member', 'Add-JCRadiusReplyAttribute',
'Add-JCSystemGroupMember', 'Add-JCSystemUser',
'Add-JCUserGroupMember', 'Backup-JCOrganization', 'Connect-JCOnline',
'Copy-JCAssociation', 'Get-JCAdmin', 'Get-JCAssociation',
'Get-JCBackup', 'Get-JCCloudDirectory', 'Get-JCCommand',
'Get-JCCommandResult', 'Get-JCCommandTarget',
'Get-JCConfiguredTemplatePolicy', 'Get-JCEvent', 'Get-JCEventCount',
'Get-JCGroup', 'Get-JCOrganization', 'Get-JCPolicy',
'Get-JCPolicyGroup', 'Get-JCPolicyGroupMember',
'Get-JCPolicyGroupTemplate', 'Get-JCPolicyGroupTemplateMember',
'Get-JCPolicyResult', 'Get-JCPolicyTargetGroup',
'Get-JCPolicyTargetSystem', 'Get-JCRadiusReplyAttribute',
'Get-JCRadiusServer', 'Get-JCReport', 'Get-JCScheduledUserstate',
'Get-JCSystem', 'Get-JCSystemApp', 'Get-JCSystemGroupMember',
'Get-JCSystemInsights', 'Get-JCSystemKB', 'Get-JCSystemUser',
'Get-JCUser', 'Get-JCUserGroupMember', 'Import-JCCommand',
'Import-JCMSPFromCSV', 'Import-JCUsersFromCSV', 'Invoke-JCCommand',
'Invoke-JCDeployment', 'New-JCCommand', 'New-JCDeploymentTemplate',
'New-JCDeviceUpdateTemplate', 'New-JCImportTemplate',
'New-JCMSPImportTemplate', 'New-JCPolicy', 'New-JCPolicyGroup',
'New-JCRadiusServer', 'New-JCReport', 'New-JCSystemGroup', 'New-JCUser',
'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand',
'Remove-JCCommandResult', 'Remove-JCCommandTarget',
'Remove-JCGsuiteMember', 'Remove-JCOffice365Member',
'Remove-JCPolicy', 'Remove-JCPolicyGroup',
'Remove-JCPolicyGroupTemplate', 'Remove-JCRadiusReplyAttribute',
'Remove-JCRadiusServer', 'Remove-JCSystem', 'Remove-JCSystemGroup',
'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser',
'Remove-JCUserGroup', 'Remove-JCUserGroupMember',
'Send-JCPasswordReset', 'Set-JCCloudDirectory', 'Set-JCCommand',
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCPolicyGroup',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set-JCPolicyGroup exported but implementation file deleted

Medium Severity

Set-JCPolicyGroup is still listed in FunctionsToExport at line 105, but its implementation file (Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1) was deleted in this PR and no replacement was added. Users calling Set-JCPolicyGroup will get a "command not found" error. It needs to be removed from the exports list.

Fix in Cursor Fix in Web

'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer',
'Set-JCSettingsFile', 'Set-JCSystem', 'Set-JCSystemUser', 'Set-JCUser',
'Set-JCUserGroupLDAP', 'Update-JCDeviceFromCSV', 'Update-JCModule',
'Update-JCMSPFromCSV', 'Update-JCUsersFromCSV', 'Get-JCSystemGroup',
'Get-JCUserGroup', 'Set-JCPolicyGroupMember'

# 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 = @()
Expand All @@ -132,7 +133,7 @@ PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'JumpCloud', 'DaaS', 'Jump', 'Cloud', 'Directory'
Tags = 'JumpCloud','DaaS','Jump','Cloud','Directory'

# A URL to the license for this module.
LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE'
Expand All @@ -157,7 +158,7 @@ PrivateData = @{

} # End of PSData hashtable

} # End of PrivateData hashtable
} # End of PrivateData hashtable

# HelpInfo URI of this module
HelpInfoURI = 'https://github.com/TheJumpCloud/support/wiki'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Function Get-DynamicHash () {
function Get-DynamicHash () {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $true)][ValidateSet('System', 'User', 'Command', 'Group')][string]$Object,
[Parameter(Position = 1, Mandatory = $true)][ValidateNotNullOrEmpty()][string[]]$returnProperties
)
DynamicParam {
dynamicparam {
if ($Object -eq 'Group') {
$paramDictionary = New-Object -Type System.Management.Automation.RuntimeDefinedParameterDictionary
$paramAttributesCollect = New-Object -Type System.Collections.ObjectModel.Collection[System.Attribute]

$paramAttributes = New-Object -Type System.Management.Automation.ParameterAttribute
$paramAttributes.Mandatory = $true
$paramAttributesCollect.Add($paramAttributes)
$paramAttributesCollect.Add((New-Object -Type System.Management.Automation.ValidateSetAttribute('System', 'User')))
$paramAttributesCollect.Add((New-Object -Type System.Management.Automation.ValidateSetAttribute('System', 'User', 'Policy')))

$dynParam1 = New-Object -Type System.Management.Automation.RuntimeDefinedParameter("GroupType", [string], $paramAttributesCollect)

Expand Down Expand Up @@ -48,6 +48,9 @@ Function Get-DynamicHash () {
User {
$ResultsHash = Get-JCGroup -Type User | Select-Object -Property $returnProperties
}
Policy {
$ResultsHash = Get-JCGroup -Type Policy | Select-Object -Property $returnProperties
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,10 @@ Query the API for Directory Insights events
```
curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}'
```
.Example
PS C:\> Get-JCEvent -Service:('all') -StartTime:((Get-date).AddDays(-30))

Pull all event records from the last thirty days
.Example
PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddHours(-1)) -Limit:('10')

Get directory results from the last hour limit to the last 10 results in the time range
.Example
PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Sort:("DESC") -EndTime:((Get-date).AddDays(-5))

Get directory results between 30 and 5 days ago, sort timestamp by descending value
.Example
PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Limit:('10') -searchTermAnd:@{"event_type" = "group_create"}

Get only group_create from the last thirty days
.Example
PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermOr @{"initiated_by.username" = @("user.1", "user.2")}

Get login events initiated by either "user.1" or "user.2" between a universal time zone range
.Example
PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"}

Get all events between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com
.Example
PS C:\> Get-JCEvent -Service:('sso') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"initiated_by.username" = "user.1"}

Get sso events with the search term initiated_by: username with value "user.1"
.Example
PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "organization_update"}

Get all events filtered by organization_update term between a date range
.Example
Get-JCEvent -Service:(<string[]>) -StartTime:(<datetime>) -EndTime:(<datetime>) -ExactMatch:(<string>) -Fields:(<string[]>) -Limit:(<long>) -Q:(<string>) -SearchAfter:(<string[]>) -SearchTermAnd:(<hashtable>) -SearchTermNot:(<hashtable>) -SearchTermOr:(<hashtable>) -Skip:(<long>) -Sort:(<string>)
.Example
Get-JCEvent -Body:(<JumpCloud.SDK.DirectoryInsights.Models.EventQuery>)

.Inputs
JumpCloud.SDK.DirectoryInsights.Models.IEventQuery
Expand All @@ -69,7 +41,7 @@ BODY <IEventQuery>: EventQuery is the users' command to search our auth logs
[Skip <Int64?>]: optional offset into the result set to start with when returning
[Sort <String>]: ASC or DESC order for timestamp
.Link
https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md
https://github.com/TheJumpCloud/jcapi-powershell/tree/CUT-4981_v2EUSupport/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation links point to feature branch not master

Low Severity

The .Link URLs in Get-JCEvent.ps1 and Get-JCEventCount.ps1 were changed from pointing to master branch to CUT-4981_v2EUSupport, a feature branch. This appears to be an accidental commit from SDK generation and will produce broken documentation links once the feature branch is deleted.

Additional Locations (1)
Fix in Cursor Fix in Web

#>
Function Get-JCEvent {
[OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,10 @@ Query the API for a count of matching events
```
curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events/count' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}'
```
.Example
PS C:\> Get-JCEventCount -Service:('all') -StartTime:((Get-date).AddDays(-30))

Pull all event records from a specified time and count the results
.Example
PS C:\> Get-JCEventCount -Service:('sso') -StartTime:('2020-04-14T00:00:00Z')

Pull all SSO event records from a specified time and count the results
.Example
PS C:\> Get-JCEventCount -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"}

Get all events counts between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com
.Example
PS C:\> Get-JCEventCount -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -searchTermAnd:@{"event_type" = "group_create"}

Get only group_create event counts the last thirty days
.Example
Get-JCEventCount -Service:(<string[]>) -StartTime:(<datetime>) -EndTime:(<datetime>) -ExactMatch:(<string>) -Fields:(<string[]>) -Q:(<string>) -SearchAfter:(<string[]>) -SearchTermAnd:(<hashtable>) -SearchTermNot:(<hashtable>) -SearchTermOr:(<hashtable>) -Sort:(<string>)
.Example
Get-JCEventCount -Body:(<JumpCloud.SDK.DirectoryInsights.Models.EventQuery>)

.Inputs
JumpCloud.SDK.DirectoryInsights.Models.IEventQuery
Expand All @@ -53,7 +41,7 @@ BODY <IEventQuery>: EventQuery is the users' command to search our auth logs
[Skip <Int64?>]: optional offset into the result set to start with when returning
[Sort <String>]: ASC or DESC order for timestamp
.Link
https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md
https://github.com/TheJumpCloud/jcapi-powershell/tree/CUT-4981_v2EUSupport/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md
#>
Function Get-JCEventCount {
[OutputType([JumpCloud.SDK.DirectoryInsights.Models.IEventCount])]
Expand Down
Loading
Loading