Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c89a4a6
Merge pull request #668 from TheJumpCloud/JumpCloudModule_2.18
kmaranionjc Apr 11, 2025
afa651f
Merge pull request #668 from TheJumpCloud/JumpCloudModule_2.18
kmaranionjc Apr 11, 2025
91fe783
test nuget
kmaranionjc Apr 16, 2025
eee0536
dates
kmaranionjc Apr 16, 2025
647c06d
nuget test
kmaranionjc Apr 16, 2025
17e31be
nuget action
kmaranionjc Apr 16, 2025
ccf907a
test
kmaranionjc Apr 16, 2025
801457a
test dotnet nuget
kmaranionjc Apr 16, 2025
41ea840
test dotnet
kmaranionjc Apr 16, 2025
f0f6a13
dotnet
kmaranionjc Apr 16, 2025
f542526
test
kmaranionjc Apr 16, 2025
6f58cb4
nuspec
kmaranionjc Apr 16, 2025
9959d71
nowarn
kmaranionjc Apr 16, 2025
e39cc2c
nuget install
kmaranionjc Apr 16, 2025
adbe06e
install mono and nuget manually
kmaranionjc Apr 16, 2025
f61af39
nuget
kmaranionjc Apr 16, 2025
648d547
provider
kmaranionjc Apr 16, 2025
532454b
force install nuget
kmaranionjc Apr 16, 2025
d62f897
test setup
kmaranionjc Apr 16, 2025
363edd8
nuget
kmaranionjc Apr 16, 2025
73559f6
extra validation
kmaranionjc Apr 16, 2025
734f679
release nuget
kmaranionjc Apr 16, 2025
e4b0d17
test nuspec pack before adding to release workflow
kmaranionjc Apr 17, 2025
e63422d
test nuspec pack before adding to release workflow
kmaranionjc Apr 17, 2025
dfa4b20
remove mono dependency
kmaranionjc Apr 17, 2025
0dcb4dc
test
kmaranionjc Apr 17, 2025
568ff79
test
kmaranionjc Apr 17, 2025
528428d
validate nupkg
kmaranionjc Apr 17, 2025
e0d6cfa
aws error fix
kmaranionjc Apr 17, 2025
9e471f7
override aws install
kmaranionjc Apr 17, 2025
6e3c0c9
test
kmaranionjc Apr 17, 2025
c9e20ae
clobber
kmaranionjc Apr 17, 2025
1d2274b
test
kmaranionjc Apr 17, 2025
7d3a878
dependency test on windows
kmaranionjc Apr 17, 2025
e4a86eb
dates
kmaranionjc Apr 17, 2025
fee148f
dependency
kmaranionjc Apr 17, 2025
47aa912
validate
kmaranionjc Apr 17, 2025
a1aac08
module validation
kmaranionjc Apr 17, 2025
21bbcf1
module validation
kmaranionjc Apr 17, 2025
bcc5d9d
test
kmaranionjc Apr 17, 2025
81e6351
module validation
kmaranionjc Apr 17, 2025
132ae08
load jc
kmaranionjc Apr 17, 2025
d234289
module install
kmaranionjc Apr 17, 2025
803d378
update
kmaranionjc Apr 17, 2025
ab09e1e
import
kmaranionjc Apr 17, 2025
a9e1488
validation
kmaranionjc Apr 17, 2025
3515b46
validate
kmaranionjc Apr 17, 2025
b113dc8
remove cache
kmaranionjc Apr 17, 2025
160cc49
cache
kmaranionjc Apr 17, 2025
b843f94
nuspec
kmaranionjc Apr 17, 2025
958a550
path
kmaranionjc Apr 17, 2025
1256c6c
validation module
kmaranionjc Apr 17, 2025
9b45adc
test deploy path
kmaranionjc Apr 17, 2025
5485bfc
nuspec
kmaranionjc Apr 17, 2025
975d738
nupkg path
kmaranionjc Apr 17, 2025
fa4c736
path
kmaranionjc Apr 17, 2025
6cf5476
pack
kmaranionjc Apr 17, 2025
9d2edaa
path
kmaranionjc Apr 17, 2025
04fd3b4
validate artifact pack
kmaranionjc Apr 17, 2025
21d09fd
workflows update
kmaranionjc Apr 18, 2025
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
30 changes: 13 additions & 17 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,25 @@ jobs:

Setup-Build-Dependancies:
needs: ["Filter-Branch", "Check-PR-Labels"]
runs-on: ubuntu-latest
runs-on: windows-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup PowerShell Module Cache
id: cacher
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: "/home/runner/.local/share/powershell/Modules/"
path: 'C:\Users\runneradmin\Documents\PowerShell\Modules\'
key: PS-Dependancies
- name: Install System Dependencies
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
run: |
Install-PackageProvider -Name:('NuGet') -Scope:('CurrentUser') -Force
- name: Install dependencies
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted

If (!(Get-PackageProvider -Name:('NuGet') -ListAvailable -ErrorAction:('SilentlyContinue'))) {
Write-Host ('[status]Installing package provider NuGet');
Install-PackageProvider -Name:('NuGet') -Scope:('CurrentUser') -Force
}

$PSDependencies = @{
'PowerShellGet' = @{Repository = 'PSGallery'; RequiredVersion = '3.0.12-beta' }
'PackageManagement' = @{Repository = 'PSGallery'; RequiredVersion = '1.4.8.1' }
Expand All @@ -81,22 +74,25 @@ jobs:
'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = '0.0.39'}
'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = '0.0.23'}
}

foreach ($RequiredModule in $PSDependencies.Keys) {
If ([System.String]::IsNullOrEmpty((Get-InstalledModule | Where-Object { $_.Name -eq $RequiredModule }))) {
Write-Host("[status]Installing module: '$RequiredModule'; version: $($PSDependencies[$RequiredModule].RequiredVersion) from $($PSDependencies[$RequiredModule].Repository)")
Install-Module -Name $RequiredModule -Repository:($($PSDependencies[$RequiredModule].Repository)) -RequiredVersion:($($PSDependencies[$RequiredModule].RequiredVersion)) -AllowPrerelease -Force
if ($($PSDependencies[$RequiredModule].RequiredVersion) -eq "latest"){
Install-Module -Name $RequiredModule -Repository:($($PSDependencies[$RequiredModule].Repository)) -AllowPrerelease -Force
} else {
Install-Module -Name $RequiredModule -Repository:($($PSDependencies[$RequiredModule].Repository)) -RequiredVersion:($($PSDependencies[$RequiredModule].RequiredVersion)) -AllowPrerelease -Force -AllowClobber
}
}
}

Build-Nuspec-Nupkg:
needs: Setup-Build-Dependancies
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: "/home/runner/.local/share/powershell/Modules/"
path: 'C:\Users\runneradmin\Documents\PowerShell\Modules\'
key: PS-Dependancies
- name: Build Nuspec
shell: pwsh
Expand Down Expand Up @@ -126,7 +122,7 @@ jobs:
uses: ./.github/actions/upload-secure-artifact
with:
name: jumpcloud-module-nupkg
path: /home/runner/work/support/support/JumpCloud.*.nupkg
path: D:/a/support/support/JumpCloud.*.nupkg
retention-days: 1

Manual-Approval-Release:
Expand Down Expand Up @@ -156,7 +152,7 @@ jobs:

Deploy-Nupkg:
needs: [Manual-Approval-Release, Build-Nuspec-Nupkg]
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Download nupkg artifact
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Module/Docs/Get-JCSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, provisionMetadata, 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

Required: False
Position: Named
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If searching for a User Group using the GroupID populate the GroupID in the -ByI
```yaml
Type: System.String
Parameter Sets: ByID
Aliases:
Aliases: GroupID

Required: True
Position: Named
Expand Down
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Module/Docs/JumpCloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.17.0
Help Version: 2.18.0
Locale: en-Us
---

Expand Down
8 changes: 8 additions & 0 deletions PowerShell/JumpCloud Module/Docs/New-JCPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ PS C:\> New-JCPolicy -TemplateName windows_Advanced:_Custom_Registry_Keys -Name

This command would create a new Windows Custom Registry Policy named "Windows - Imported Custom Registry Settings" and populate the values from a registry file. .Reg registry files can be passed into New-JCPolicy as long as the TemplateName is specified with the corresponding "windows_Advanced:\_Custom_Registry_Keys" template. .Reg files will be converted and uploaded to the JumpCloud policy as long as they contain "DWORD", "EXPAND_SZ", "MULTI_SZ", "SZ" or "QWORD" type data.

### Example 6

```PowerShell
PS C:\> New-JCPolicy -TemplateName custom_oma_uri_mdm_windows -Name "Windows - Custom OMA MDM Policy" -uriList '(@( @{format = "string"; uri = "./Vendor/MSFT/Policy/Config/DeviceLock/EnforceLockScreenAndLogonImage; value = "pathToImage" }, @{format = "int"; uri = "./Device/Vendor/MSFT/Policy/Config/DeviceLock/AccountLockoutPolicy"; value = "1" } ))'
```

This command creates a JumpCloud policy named "Windows - Custom OMA MDM Policy" using the custom_oma_uri_mdm_windows template. It defines two OMA-URI configurations: a string value for EnforceLockScreenAndLogonImage and an integer value for AccountLockoutPolicy.

## PARAMETERS

### -Name
Expand Down
8 changes: 8 additions & 0 deletions PowerShell/JumpCloud Module/Docs/Set-JCPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ PS C:\> Set-JCPolicy -PolicyName "Windows - Imported Custom Registry Settings"

This command would overwrite the registry policy's existing values with the imported set of .Reg keys specified by the "RegistryFile" parameter. .Reg files will be converted and uploaded to the JumpCloud policy as long as they contain "DWORD", "EXPAND_SZ", "MULTI_SZ", "SZ" or "QWORD" type data.

### Example 7

```powershell
PS C:\> Set-JCPolicy -PolicyName "Windows - Custom OMA MDM Policy" -uriList '(@( @{format = "string"; uri = "./Vendor/MSFT/Policy/Config/DeviceLock/EnforceLockScreenAndLogonImage; value = "pathToImage" }, @{format = "int"; uri = "./Device/Vendor/MSFT/Policy/Config/DeviceLock/AccountLockoutPolicy"; value = "2" } ))'
```

This command modifies the existing JumpCloud policy named "Windows - Custom OMA MDM Policy". It updates the policy's OMA-URI settings using the -uriList parameter. The EnforceLockScreenAndLogonImage setting, a string, remains set to "pathToImage". The AccountLockoutPolicy setting, an integer, is updated from its previous value to "2", effectively changing the account lockout policy configuration.

## PARAMETERS

### -NewName
Expand Down
4 changes: 2 additions & 2 deletions PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Updates the JumpCloud Module Settings File
## SYNTAX

```
Set-JCSettingsFile [-moduleBannerMessageCount <PSObject>]
[-parallelOverride <PSObject>] [<CommonParameters>]
Set-JCSettingsFile [-parallelOverride <PSObject>]
[-moduleBannerMessageCount <PSObject>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down
18 changes: 17 additions & 1 deletion PowerShell/JumpCloud Module/Docs/Set-JCSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Updates an existing JumpCloud System
Set-JCSystem [-SystemID] <String> [-displayName <String>] [-description <String>]
[-allowSshPasswordAuthentication <Boolean>] [-allowSshRootLogin <Boolean>]
[-allowMultiFactorAuthentication <Boolean>] [-allowPublicKeyAuthentication <Boolean>]
[-systemInsights <Boolean>] [<CommonParameters>]
[-systemInsights <Boolean>] [-primarySystemUser <Object>]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -133,6 +134,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -primarySystemUser
A string value indicating a JumpCloud users email, username or userID. This will add the user to the device associations

```yaml
Type: System.Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SystemID
The _id of the System which you want to remove from JumpCloud.
The SystemID will be the 24 character string populated for the _id field.
Expand Down
4 changes: 2 additions & 2 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/3/2025
# Generated on: 4/18/2025
#

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

# Version number of this module.
ModuleVersion = '2.17.0'
ModuleVersion = '2.18.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
function Convert-JCUserToID {
[CmdletBinding(DefaultParameterSetName = 'Default')]
Param(
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0, HelpMessage = 'The username, id or email of a user')][ValidateNotNullOrEmpty()]
[System.String]$UserIdentifier
)
process {
# First check if UserIdentifier returns valid user with id
# Regex match a userid
$regexPattern = [Regex]'^[a-z0-9]{24}$'
if (((Select-String -InputObject $UserIdentifier -Pattern $regexPattern).Matches.value)::IsNullOrEmpty) {
# if we have a 24 characterid, try to match the id using the search endpoint
$UserIdentifierSearch = @{
filter = @{
'and' = @(
@{'_id' = @{'$eq' = "$($UserIdentifier)" } }
)
}
fields = 'id'
}
$UserIdentifierResults = Search-JcSdkUser -Body:($UserIdentifierSearch)
# Set UserIdentifierValue; this is a validated user id
$UserIdentifierValue = $UserIdentifierResults.id
} else {
# Use class mailaddress to check if $_.value is email
try {
$null = [mailaddress]$UserIdentifier
Write-Debug "This is true"
# Search for UserIdentifier using email
$UserIdentifierSearch = @{
filter = @{
'and' = @(
@{'email' = @{'$regex' = "(?i)(`^$($UserIdentifier)`$)" } }
)
}
fields = 'email'
}
$UserIdentifierResults = Search-JcSdkUser -Body:($UserIdentifierSearch)
# Set UserIdentifierValue; this is a validated user id
$UserIdentifierValue = $UserIdentifierResults.id
# if no value was returned, then assume the case this is actually a username and search
if (!$UserIdentifierValue) {
$UserIdentifierSearch = @{
filter = @{
'and' = @(
@{'username' = @{'$regex' = "(?i)(`^$($UserIdentifier)`$)" } }
)
}
fields = 'username'
}
$UserIdentifierResults = Search-JcSdkUser -Body:($UserIdentifierSearch)
# Set UserIdentifierValue from the matched username
$UserIdentifierValue = $UserIdentifierResults.id
}
} catch {
# search the username in the search endpoint
$UserIdentifierSearch = @{
filter = @{
'and' = @(
@{'username' = @{'$regex' = "(?i)(`^$($UserIdentifier)`$)" } }
)
}
fields = 'username'
}
$UserIdentifierResults = Search-JcSdkUser -Body:($UserIdentifierSearch)
# Set UserIdentifierValue from the matched username
$UserIdentifierValue = $UserIdentifierResults.id
}
}
}
end {
if ($null -eq $UserIdentifierValue) {
throw "Could not validate $UserIdentifier. Please ensure the information was entered correctly."
} else {
return $UserIdentifierValue
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function Get-JCPolicyTemplateConfigField {
file = 'file'
select = 'multi'
number = 'int'
multiList = 'multilist'
}
}
process {
Expand Down
Loading
Loading