diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md b/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md index 9c47837e2..1c27edb84 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md @@ -188,7 +188,7 @@ Allows you to return select properties on JumpCloud user objects. Specifying wha Type: System.String[] Parameter Sets: SearchFilter Aliases: -Accepted values: command, name, launchType, commandType, trigger, scheduleRepeatType, listensTo, organization, commandRunners, schedule, shell, timeout, sudo, template, scheduleYear, timeToLiveSeconds, files, user, systems +Accepted values: command, name, launchType, commandType, trigger, scheduleRepeatType, listensTo, organization, commandRunners, schedule, shell, timeout, sudo, template, scheduleYear, timeToLiveSeconds, files, user, systems, description, filesS3 Required: False Position: Named diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md index 47c6ad5cf..0a7c96579 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md @@ -357,7 +357,7 @@ Valid properties that can be returned are: 'created', 'active', 'agentVersion', Type: System.String[] Parameter Sets: SearchFilter Aliases: -Accepted values: acknowledged, active, agentVersion, allowMultiFactorAuthentication, allowPublicKeyAuthentication, allowSshPasswordAuthentication, allowSshRootLogin, arch, azureAdJoined, connectionHistory, created, displayName, domainInfo, fde, fileSystem, hasServiceAccount, hostname, lastContact, mdm, modifySSHDConfig, networkInterfaces, organization, os, osFamily, primarySystemUser, provisionMetadata, remoteAssistAgentVersion, remoteIP, serialNumber, serviceAccountState, sshdParams, systemInsights, systemTimezone, templateName, userMetrics, usernameHashes, version, hwVendor, secureLogin, displayManager, amazonInstanceID, archFamily, builtInCommands, description, osVersionDetail, policyStats, desktopCapable, sshRootEnabled, isPolicyBound +Accepted values: acknowledged, active, agentVersion, allowMultiFactorAuthentication, allowPublicKeyAuthentication, allowSshPasswordAuthentication, allowSshRootLogin, arch, azureAdJoined, connectionHistory, created, displayName, domainInfo, fde, fileSystem, hasServiceAccount, hostname, lastContact, mdm, modifySSHDConfig, networkInterfaces, organization, os, osFamily, primarySystemUser, provisionMetadata, remoteAssistAgentVersion, remoteIP, serialNumber, serviceAccountState, sshdParams, systemInsights, systemTimezone, templateName, userMetrics, usernameHashes, version, hwVendor, secureLogin, displayManager, amazonInstanceID, archFamily, builtInCommands, description, osVersionDetail, policyStats, desktopCapable, sshRootEnabled, isPolicyBound, agentHasFullDiskAccess Required: False Position: Named diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index adf6732ae..9c16945f0 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 2.18.1 +Help Version: 2.18.2 Locale: en-Us --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 967aa6d16..b52e6eaad 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,167 +3,167 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/25/2025 +# Generated on: 9/8/2025 # @{ - # Script module or binary module file associated with this manifest. - RootModule = 'JumpCloud.psm1' - - # Version number of this module. - ModuleVersion = '2.18.1' - - # Supported PSEditions - # CompatiblePSEditions = @() - - # ID used to uniquely identify this module - GUID = '31c023d1-a901-48c4-90a3-082f91b31646' - - # Author of this module - Author = 'JumpCloud Solutions Architect Team' - - # Company or vendor of this module - CompanyName = 'JumpCloud' - - # Copyright statement for this module - Copyright = '(c) JumpCloud. All rights reserved.' - - # Description of the functionality provided by this module - Description = 'PowerShell functions to manage a JumpCloud Directory-as-a-Service' - - # Minimum version of the PowerShell engine required by this module - PowerShellVersion = '4.0' - - # Name of the PowerShell host required by this module - # PowerShellHostName = '' +# Script module or binary module file associated with this manifest. +RootModule = 'JumpCloud.psm1' + +# Version number of this module. +ModuleVersion = '2.18.2' + +# Supported PSEditions +# CompatiblePSEditions = @() + +# ID used to uniquely identify this module +GUID = '31c023d1-a901-48c4-90a3-082f91b31646' + +# Author of this module +Author = 'JumpCloud Solutions Architect Team' + +# Company or vendor of this module +CompanyName = 'JumpCloud' + +# Copyright statement for this module +Copyright = '(c) JumpCloud. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'PowerShell functions to manage a JumpCloud Directory-as-a-Service' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '4.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 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 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 = '' +# 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 = '' +# 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 = @('JumpCloud.SDK.DirectoryInsights', - 'JumpCloud.SDK.V1', - 'JumpCloud.SDK.V2') +# Modules that must be imported into the global environment prior to importing this module +RequiredModules = @('JumpCloud.SDK.DirectoryInsights', + 'JumpCloud.SDK.V1', + 'JumpCloud.SDK.V2') - # Assemblies that must be loaded prior to importing this module - # RequiredAssemblies = @() +# 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 = @() +# 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 = @() +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() - # Format files (.ps1xml) to be loaded when importing this module - # FormatsToProcess = @() +# 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 = @() +# 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 = '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' +# 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' - # 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 = @() +# 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 = '*' +# 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 = 'New-JCAssociation' +# 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 = 'New-JCAssociation' - # DSC resources to export from this module - # DscResourcesToExport = @() +# DSC resources to export from this module +# DscResourcesToExport = @() - # List of all modules packaged with this module - # ModuleList = @() +# List of all modules packaged with this module +# ModuleList = @() - # List of all files packaged with this module - # FileList = @() +# 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 = @{ +# 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 = @{ + PSData = @{ - # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'JumpCloud', 'DaaS', 'Jump', 'Cloud', 'Directory' + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'JumpCloud', 'DaaS', 'Jump', 'Cloud', 'Directory' - # A URL to the license for this module. - LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE' - - # A URL to the main website for this project. - ProjectUri = 'https://github.com/TheJumpCloud/support/wiki' - - # A URL to an icon representing this module. - IconUri = 'https://avatars1.githubusercontent.com/u/4927461?s=200&v=4' - - # ReleaseNotes of this module - ReleaseNotes = 'https://git.io/jc-pwsh-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 = 'https://github.com/TheJumpCloud/support/wiki' - - # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. - # DefaultCommandPrefix = '' + # A URL to the license for this module. + LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/TheJumpCloud/support/wiki' + + # A URL to an icon representing this module. + IconUri = 'https://avatars1.githubusercontent.com/u/4927461?s=200&v=4' + + # ReleaseNotes of this module + ReleaseNotes = 'https://git.io/jc-pwsh-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 = 'https://github.com/TheJumpCloud/support/wiki' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' } diff --git a/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 b/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 index cfbeb133a..5835bbf2b 100644 --- a/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 +++ b/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 @@ -20,8 +20,8 @@ Function Get-JCCommand () { [Parameter( ValueFromPipelineByPropertyName, ParameterSetName = 'SearchFilter', HelpMessage = 'The scheduled command repeat type (minute, hour, day, week, month) of the JumpCloud Command you wish to search for ex. Get-JCCommand -scheduleRepeatType ')] [ValidateSet('minute', 'hour', 'day', 'week', 'month')] [string]$scheduleRepeatType, - [Parameter(ValueFromPipelineByPropertyName, ParameterSetName = 'SearchFilter', HelpMessage = 'Allows you to return select properties on JumpCloud commands objects. Specifying what properties are returned can drastically increase the speed of the API call with a large data set. Valid properties that can be returned are: ''command'', ''name'',''launchType'',''commandType'',''trigger'',''scheduleRepeatType'',''listensTo'',''organization'',''commandRunners'',''schedule'',''shell'',''timeout'',''sudo'',''template'',''scheduleYear'',''timeToLiveSeconds'',''files'',''user'',''systems''')] - [ValidateSet('command', 'name', 'launchType', 'commandType', 'trigger', 'scheduleRepeatType', 'listensTo', 'organization', 'commandRunners', 'schedule', 'shell', 'timeout', 'sudo', 'template', 'scheduleYear', 'timeToLiveSeconds', 'files', 'user', 'systems')] + [Parameter(ValueFromPipelineByPropertyName, ParameterSetName = 'SearchFilter', HelpMessage = 'Allows you to return select properties on JumpCloud commands objects. Specifying what properties are returned can drastically increase the speed of the API call with a large data set. Valid properties that can be returned are: ''command'', ''name'',''launchType'',''commandType'',''trigger'',''scheduleRepeatType'',''listensTo'',''organization'',''commandRunners'',''schedule'',''shell'',''timeout'',''sudo'',''template'',''scheduleYear'',''timeToLiveSeconds'',''files'',''user'',''systems'', ''description'', ''filesS3''')] + [ValidateSet('command', 'name', 'launchType', 'commandType', 'trigger', 'scheduleRepeatType', 'listensTo', 'organization', 'commandRunners', 'schedule', 'shell', 'timeout', 'sudo', 'template', 'scheduleYear', 'timeToLiveSeconds', 'files', 'user', 'systems', 'description', 'filesS3')] [String[]]$returnProperties, [Parameter(Mandatory, ValueFromPipelineByPropertyName, @@ -94,7 +94,7 @@ CommandID has an Alias of _id. This means you can leverage the PowerShell pipeli continue } if ($param.value -is [Boolean]) { - (($Search.filter).GetEnumerator()).add($param.Key, $param.value) + (($Search.filter).GetEnumerator()).add($param.Key, $param.value) continue } @@ -106,18 +106,18 @@ CommandID has an Alias of _id. This means you can leverage the PowerShell pipeli if (($param.Value -match '.+?\*$') -and ($param.Value -match '^\*.+?')) { # Front and back wildcard - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))" }) } elseif ($param.Value -match '.+?\*$') { # Back wildcard - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)^$([regex]::Escape($Value))" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)^$([regex]::Escape($Value))" }) } elseif ($param.Value -match '^\*.+?') { # Front wild card - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))`$" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))`$" }) } elseif ($param.Value -match '^[-+]?\d+$') { # Check for integer value - (($Search.filter).GetEnumerator()).add($param.Key, $([regex]::Escape($Value))) + (($Search.filter).GetEnumerator()).add($param.Key, $([regex]::Escape($Value))) } else { - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)(^$([regex]::Escape($Value))`$)" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)(^$([regex]::Escape($Value))`$)" }) } } # End foreach diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 index a459133fa..f42347bde 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 @@ -152,8 +152,8 @@ Function Get-JCSystem () { [Parameter( ValueFromPipelineByPropertyName, ParameterSetName = 'SearchFilter', - HelpMessage = 'Allows you to return select properties on JumpCloud system objects. Specifying what properties are returned can drastically increase the speed of the API call with a large data set. Valid properties that can be returned are: ''created'', ''active'', ''agentVersion'', ''allowMultiFactorAuthentication'', ''allowPublicKeyAuthentication'', ''allowSshPasswordAuthentication'', ''allowSshRootLogin'', ''arch'', ''created'', ''displayName'', ''hostname'', ''lastContact'', ''modifySSHDConfig'', ''organization'', ''os'', ''remoteIP'', ''serialNumber'', ''sshdParams'', ''systemTimezone'', ''templateName'', ''version'', ''hwVendor'',''secureLogin'',''displayManager'',''amazonInstanceID'',''archFamily'',''builtInCommands'',''description'',''osVersionDetail'',''policyStats'',''desktopCapable'', ''sshRootEnabled''')] - [ValidateSet('acknowledged', 'active', 'agentVersion', 'allowMultiFactorAuthentication', 'allowPublicKeyAuthentication', 'allowSshPasswordAuthentication', 'allowSshRootLogin', 'arch', 'azureAdJoined', 'connectionHistory', 'created', 'displayName', 'domainInfo', 'fde', 'fileSystem', 'hasServiceAccount', 'hostname', 'lastContact', 'mdm', 'modifySSHDConfig', 'networkInterfaces', 'organization', 'os', 'osFamily', 'primarySystemUser', 'provisionMetadata', 'remoteAssistAgentVersion', 'remoteIP', 'serialNumber', 'serviceAccountState', 'sshdParams', 'systemInsights', 'systemTimezone', 'templateName', 'userMetrics', 'usernameHashes', 'version', 'hwVendor', 'secureLogin', 'displayManager', 'amazonInstanceID', 'archFamily', 'builtInCommands', 'description', 'osVersionDetail', 'policyStats', 'desktopCapable', 'sshRootEnabled', 'isPolicyBound')] + HelpMessage = 'Allows you to return select properties on JumpCloud system objects. Specifying what properties are returned can drastically increase the speed of the API call with a large data set. Valid properties that can be returned are: ''created'', ''active'', ''agentVersion'', ''allowMultiFactorAuthentication'', ''allowPublicKeyAuthentication'', ''allowSshPasswordAuthentication'', ''allowSshRootLogin'', ''arch'', ''created'', ''displayName'', ''hostname'', ''lastContact'', ''modifySSHDConfig'', ''organization'', ''os'', ''remoteIP'', ''serialNumber'', ''sshdParams'', ''systemTimezone'', ''templateName'', ''version'', ''hwVendor'',''secureLogin'',''displayManager'',''amazonInstanceID'',''archFamily'',''builtInCommands'',''description'',''osVersionDetail'',''policyStats'',''desktopCapable'', ''sshRootEnabled'', ''agentHasFullDiskAccess''')] + [ValidateSet('acknowledged', 'active', 'agentVersion', 'allowMultiFactorAuthentication', 'allowPublicKeyAuthentication', 'allowSshPasswordAuthentication', 'allowSshRootLogin', 'arch', 'azureAdJoined', 'connectionHistory', 'created', 'displayName', 'domainInfo', 'fde', 'fileSystem', 'hasServiceAccount', 'hostname', 'lastContact', 'mdm', 'modifySSHDConfig', 'networkInterfaces', 'organization', 'os', 'osFamily', 'primarySystemUser', 'provisionMetadata', 'remoteAssistAgentVersion', 'remoteIP', 'serialNumber', 'serviceAccountState', 'sshdParams', 'systemInsights', 'systemTimezone', 'templateName', 'userMetrics', 'usernameHashes', 'version', 'hwVendor', 'secureLogin', 'displayManager', 'amazonInstanceID', 'archFamily', 'builtInCommands', 'description', 'osVersionDetail', 'policyStats', 'desktopCapable', 'sshRootEnabled', 'isPolicyBound', 'agentHasFullDiskAccess')] [String[]]$returnProperties ) @@ -311,18 +311,18 @@ Function Get-JCSystem () { if (($param.Value -match '.+?\*$') -and ($param.Value -match '^\*.+?')) { # Front and back wildcard - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))" }) } elseif ($param.Value -match '.+?\*$') { # Back wildcard - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)^$([regex]::Escape($Value))" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)^$([regex]::Escape($Value))" }) } elseif ($param.Value -match '^\*.+?') { # Front wild card - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))`$" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)$([regex]::Escape($Value))`$" }) } elseif ($param.Value -match '^[-+]?\d+$') { # Check for integer value - (($Search.filter).GetEnumerator()).add($param.Key, $([regex]::Escape($Value))) + (($Search.filter).GetEnumerator()).add($param.Key, $([regex]::Escape($Value))) } else { - (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)(^$([regex]::Escape($Value))`$)" }) + (($Search.filter).GetEnumerator()).add($param.Key, @{'$regex' = "(?i)(^$([regex]::Escape($Value))`$)" }) } diff --git a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.ps1 b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.ps1 index 87af20985..f9e2936d3 100644 --- a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.ps1 +++ b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.ps1 @@ -89,7 +89,13 @@ Function Update-JCDeviceFromCSV () { throw "DeviceID: $($DeviceUpdate.DeviceID) does not exist in JumpCloud. Please validate that this device exists in JumpCloud" } - $DeviceParams = $DeviceUpdate | Select-Object -ExcludeProperty deviceID, hostname + # Get the names of the properties to keep. Exclude DeviceID and hostname + $devicePropertiesToKeep = $DeviceUpdate.psobject.properties | Where-Object { + $_.MemberType -eq "NoteProperty" -and $_.Name -ne "DeviceID" -and $_.Name -ne "hostname" + } | Select-Object -ExpandProperty Name + + # Create a new PSCustomObject with only those properties + $DeviceParams = $DeviceUpdate | Select-Object -Property $devicePropertiesToKeep $DeviceHash = @{} $DeviceParams.psobject.properties | ForEach-Object { if (($_.Value -eq '$true') -or ($_.Value -eq 'true')) { diff --git a/PowerShell/JumpCloud Module/Tests/ModuleValidation/ReturnProperties.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/ModuleValidation/ReturnProperties.Tests.ps1 index 93aeb496d..3bf850c0a 100644 --- a/PowerShell/JumpCloud Module/Tests/ModuleValidation/ReturnProperties.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/ModuleValidation/ReturnProperties.Tests.ps1 @@ -8,7 +8,66 @@ Describe -Tag:('ModuleValidation') 'Return Properties Checks' { 'customDefinitionMap' = @{ } - 'ignoreList' = @('_id', 'tags') + 'ignoreList' = @( + 'primarySystemUser._id', + 'primarySystemUser.account_locked', + 'primarySystemUser.account_locked_date', + 'primarySystemUser.activated', + 'primarySystemUser.addresses', + 'primarySystemUser.admin', + 'primarySystemUser.allow_public_key', + 'primarySystemUser.alternateEmail', + 'primarySystemUser.attributes', + 'primarySystemUser.badLoginAttempts', + 'primarySystemUser.company', + 'primarySystemUser.costCenter', + 'primarySystemUser.created', + 'primarySystemUser.creationSource', + 'primarySystemUser.department', + 'primarySystemUser.description', + 'primarySystemUser.disableDeviceMaxLoginAttempts', + 'primarySystemUser.displayname', + 'primarySystemUser.email', + 'primarySystemUser.employeeIdentifier', + 'primarySystemUser.employeeType', + 'primarySystemUser.enable_managed_uid', + 'primarySystemUser.enable_user_portal_multifactor', + 'primarySystemUser.external_dn', + 'primarySystemUser.external_password_expiration_date', + 'primarySystemUser.external_source_type', + 'primarySystemUser.externally_managed', + 'primarySystemUser.firstname', + 'primarySystemUser.jobTitle', + 'primarySystemUser.lastname', + 'primarySystemUser.ldap_binding_user', + 'primarySystemUser.location', + 'primarySystemUser.managedAppleId', + 'primarySystemUser.manager', + 'primarySystemUser.mfa', + 'primarySystemUser.mfaEnrollment', + 'primarySystemUser.middlename', + 'primarySystemUser.organization', + 'primarySystemUser.password_date', + 'primarySystemUser.password_expiration_date', + 'primarySystemUser.password_expired', + 'primarySystemUser.password_never_expires', + 'primarySystemUser.passwordless_sudo', + 'primarySystemUser.phoneNumbers', + 'primarySystemUser.public_key', + 'primarySystemUser.recoveryEmail', + 'primarySystemUser.relationships', + 'primarySystemUser.restrictedFields', + 'primarySystemUser.samba_service_user', + 'primarySystemUser.ssh_keys', + 'primarySystemUser.state', + 'primarySystemUser.sudo', + 'primarySystemUser.suspended', + 'primarySystemUser.tags', + 'primarySystemUser.totp_enabled', + 'primarySystemUser.unix_guid', + 'primarySystemUser.unix_uid', + 'primarySystemUser.username', '_id', 'tags' + ) }; 'Get-JCUser' = @{ 'modelDefinition' = 'definitions.systemuserput.properties' diff --git a/PowerShell/JumpCloud Module/Tests/Public/Administrators/Get-JCAdmin.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Administrators/Get-JCAdmin.Tests.ps1 index 87e53fd4b..60a8a5c6a 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Administrators/Get-JCAdmin.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Administrators/Get-JCAdmin.Tests.ps1 @@ -9,7 +9,7 @@ Describe -Tag:('JCAdmin') 'Get-JCAdmin Tests' { $Admins | Should -Not -BeNullOrEmpty } It ('Get administrators by enableMultifactor') { - $Admins = Get-JCAdmin -enableMultifactor $false + $Admins = Get-JCAdmin -enableMultifactor $true $Admins | Should -Not -BeNullOrEmpty } It ('Get administrators by totpEnrolled') { @@ -21,7 +21,7 @@ Describe -Tag:('JCAdmin') 'Get-JCAdmin Tests' { $Admins | Should -Not -BeNullOrEmpty } It ('Get administrators by email, enableMultifactor, totpEnrolled, roleName') { - $Admins = Get-JCAdmin -email 'solutions-architecture*' -enableMultifactor $false -totpEnrolled $true -roleName 'Administrator' + $Admins = Get-JCAdmin -email 'solutions-architecture*' -enableMultifactor $true -totpEnrolled $true -roleName 'Administrator' $Admins | Should -Not -BeNullOrEmpty } } diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroupTemplates/Get-JCConfiguredTemplatePolicy.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroupTemplates/Get-JCConfiguredTemplatePolicy.Tests.ps1 index d76821ec6..995eef029 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroupTemplates/Get-JCConfiguredTemplatePolicy.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroupTemplates/Get-JCConfiguredTemplatePolicy.Tests.ps1 @@ -1,4 +1,5 @@ -Describe -Tag:('MSP') 'Get-JCConfiguredTemplatePolicy' { +# TODO: card to fix the issue CUT-4867 +Describe -Tag:('MSP') 'Get-JCConfiguredTemplatePolicy' -Skip { # Note for these tests, there's not a public endpoint to delete these objects # tests in this file will assume that configuredTemplatePolicy objects exist It "Lists all configured template policies" { diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 index f93259e90..27beac18e 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 @@ -2,7 +2,8 @@ BeforeAll { $ErrorActionPreference = 'Stop' # Continue (Default), Ignore, Inquire, SilentlyContinue, Stop, Suspend } -Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { +# TODO: Waiting on the API team to fix an issue with the authorized_key endpoint marking CUT-4892 as the card to revert these changes +Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" -Skip { Function Get-JCSystemInsightsTestCases($System) { # Retrieve objects to test with $SystemInsightsPrefix = 'Get-JcSdkSystemInsight'; diff --git a/PowerShell/JumpCloud Module/Tests/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.Tests.ps1 index 2e19d9e7d..f505f1a81 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Utilities/CSV_Import/Update-JCDeviceFromCSV.Tests.ps1 @@ -4,6 +4,8 @@ Describe -Tag:('JCDeviceFromCSV') 'Update-JCDeviceFromCSV' { } It 'Updates users from a CSV populated with all information' { $system = Get-JCSystem | Select-Object -First 1 + # Current system name + $currentSystemName = $system.displayName $addUserAssociation = Set-JcSdkSystemAssociation -SystemId $system.Id -Op "add" -Type 'user' -Id $NewUser._id $CSVData = @{ "DeviceID" = $system.id @@ -29,9 +31,14 @@ Describe -Tag:('JCDeviceFromCSV') 'Update-JCDeviceFromCSV' { $UpdatedDevice.allowPublicKeyAuthentication | Should -Be $CSVData.allowPublicKeyAuthentication $UpdatedDevice.systemInsights | Should -Be '@{state=enabled}' $UpdatedDevice.primarySystemUser.id | Should -Be $NewUser._id + + # Reset the system name + Set-JCSystem -SystemID $system.id -displayName $currentSystemName + } It 'Updates users from a CSV populated with a null value' { $system = Get-JCSystem | Select-Object -First 1 + $currentSystemName = $system.displayName $addUserAssociation = Set-JcSdkSystemAssociation -SystemId $system.Id -Op "add" -Type 'user' -Id $NewUser._id $CSVData = @{ "DeviceID" = $system.id @@ -57,9 +64,14 @@ Describe -Tag:('JCDeviceFromCSV') 'Update-JCDeviceFromCSV' { $UpdatedDevice.allowPublicKeyAuthentication | Should -Be $CSVData.allowPublicKeyAuthentication $UpdatedDevice.systemInsights | Should -Be '@{state=enabled}' $UpdatedDevice.primarySystemUser.id | Should -Be $system.primarySystemUser.id + + # Reset the system name + Set-JCSystem -SystemID $system.id -displayName $currentSystemName + } It 'Updates users from a CSV populated with an invalid primarySystemUser' { $system = Get-JCSystem | Select-Object -First 1 + $currentSystemName = $system.displayName $addUserAssociation = Set-JcSdkSystemAssociation -SystemId $system.Id -Op "add" -Type 'user' -Id $NewUser._id $CSVData = @{ "DeviceID" = $system.id @@ -85,6 +97,8 @@ Describe -Tag:('JCDeviceFromCSV') 'Update-JCDeviceFromCSV' { $UpdatedDevice.allowPublicKeyAuthentication | Should -Be $CSVData.allowPublicKeyAuthentication $UpdatedDevice.systemInsights | Should -Be '@{state=enabled}' $UpdatedDevice.primarySystemUser.id | Should -Be $system.primarySystemUser.id + # Reset the system name + Set-JCSystem -SystemID $system.id -displayName $currentSystemName } AfterEach { Remove-JCUser -UserID $NewUser._id -force diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 4289bbb63..2f77dc900 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -4565,6 +4565,8 @@ PS C:\> $BackupJcOrganizationResults.User files user systems + description + filesS3 System.String[] @@ -8577,6 +8579,7 @@ $reportContent = Get-JCReport -reportID $lastReport.id -type 'csv' desktopCapable sshRootEnabled isPolicyBound + agentHasFullDiskAccess System.String[] diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 91d460233..5656c5c26 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,17 @@ +## 2.18.2 + +Release Date: September 8, 2025 + +#### RELEASE NOTES + +``` +Fixed an issue with excluding properties for Update-JCDeviceFromCSV when using PWSH 5.1 +``` + +#### BUG FIXES: + +* Address a bug impacting Update-JCDeviceFromCSV + ## 2.18.1 Release Date: April 25, 2025