Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JumpCloud PowerShell Module v2.7.0 #505

Merged
merged 84 commits into from
Aug 1, 2023
Merged

JumpCloud PowerShell Module v2.7.0 #505

merged 84 commits into from
Aug 1, 2023

Conversation

gweinjc
Copy link
Contributor

@gweinjc gweinjc commented Jul 31, 2023

Issues

  • SA-3176 - New/Set-JCPolicy Import Reg Files
  • SA-3406 - Get-JCResults Sequential Bug

What does this solve?

This feature will allow admins to upload .reg files into new or existing Windows - Advanced: Custom Registry Keys Policy JumpCloud Policies to deploy to their Windows machines.

This also resolves a bug where Get-JCResults was not adding all indexes of an object to the parent array as expected and was instead adding a single instance to the array containing all objects which was causing issues with counts and object manipulation

Is there anything particularly tricky?

Currently, Windows - Advanced: Custom Registry Keys Policy only accepts registry keys that belong in the HKEY_LOCAL_MACHINE (HKLM) hive. If a .reg file is attempted to be uploaded that contains a non-HKLM key, it will not be valid.

How should this be tested?

Registry File Work

  1. Download the sample .reg file and unzip
    i. SampleRegFile.reg.zip

  2. Run the following function:
    ii. New-JCPolicy -TemplateName windows_Advanced:_Custom_Registry_Keys -Name "Test - Registry File Upload" -registryFile "/path/to/SampleRegFile.reg"

  3. Validate that the "Test - Registry File Upload" Policy was successfully created and contains the expected registry values

  4. Run the following function:
    iv. Set-JCPolicy -PolicyName "Test - Registry File Upload" -registryFile "/path/to/SampleRegFile.reg"

  5. Validate that the "Test - Registry File Upload" Policy now has 10 values instead of the original 5

  6. Run the following function to replace the existing values of the policy with just the values from the SampleRegFile:
    iv. Set-JCPolicy -PolicyName "Test - Registry File Upload" -registryFile "/path/to/SampleRegFile.reg" -registryOverwrite

  7. Validate that the "Test - Registry File Upload" Policy now has the 5 values from the file

Get-JCResults Work

  1. Use a VM that has PowerShell version 5, specifically 5.1.19041.2673
  2. Attempt to add a user to a user group - Add-JCUserGroupMember -GroupName 'GroupName' -username 'user.name'

}
}
}
}
}
end {
if ($totalCountHeader) {
if ($parallel -and $totalCountHeader) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Screen Shot 2023-08-01 at 10 44 01 AM
I can confirm this resolves the issue for my older version of PWSH

Copy link
Contributor

@jworkmanjc jworkmanjc left a comment

Choose a reason for hiding this comment

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

Import REG Tests:

Import Test With Just One registry .reg Item ✅
Import Test with Multiple registry .reg items ✅

Set Test without -RegistryOverwrite param ✅ policy is appended
Set Test with -RegistryOverwrite param ✅ policy is overwritten

Setting a policy where a policy has the same name as another policy does throw an error as expected.

Finally I can confirm that these changes do address the bug in the older version of PWSH:
Screen Shot 2023-08-01 at 10 44 01 AM

@gweinjc gweinjc changed the title Jump cloud module 2.7.0 JumpCloud PowerShell Module v2.7.0 Aug 1, 2023
@gweinjc gweinjc merged commit 5b115d8 into master Aug 1, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants