From 8d50d9e2615723c0274dbd6e8f4fa48f71f58867 Mon Sep 17 00:00:00 2001 From: Ken Maranion Date: Fri, 16 Aug 2024 14:37:37 -0700 Subject: [PATCH 01/10] rename remove custom attribute --- .../Public/Users/Set-JCUser.ps1 | 26 +++++++++---------- .../Tests/Public/Users/Set-JCUser.Tests.ps1 | 10 +++---- PowerShell/ModuleChangelog.md | 9 +++++++ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 index 0f015aa0e..3b8e674cf 100644 --- a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 +++ b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 @@ -8,12 +8,10 @@ Function Set-JCUser () { ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Username', Position = 0, HelpMessage = 'The Username of the JumpCloud user you wish to modify')] - [Parameter(Mandatory, ValueFromPipelineByPropertyName = $true, - Position = 0, - ParameterSetName = 'RemoveAttribute', HelpMessage = 'The Username of the JumpCloud user you wish to modify')] - + ParameterSetName = 'RemoveCustomAttribute', + Position = 0, HelpMessage = 'The Username of the JumpCloud user you wish to modify')] [string]$Username, [Parameter(Mandatory, @@ -94,11 +92,11 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline [int] $NumberOfCustomAttributes, - [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'RemoveAttribute', HelpMessage = 'The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveAttribute Parameter in EXAMPLE 5')] + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'RemoveCustomAttribute', HelpMessage = 'The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE 5')] [string[]] - $RemoveAttribute, + $RemoveCustomAttribute, - [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ByID', HelpMessage = 'Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to ''ByID'' which will increase the function speed and performance. You cannot use this with the ''RemoveAttribute'' Parameter')] + [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ByID', HelpMessage = 'Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to ''ByID'' which will increase the function speed and performance. You cannot use this with the ''RemoveCustomAttribute'' Parameter')] [switch] $ByID, @@ -935,7 +933,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline } - elseif ($PSCmdlet.ParameterSetName -eq 'RemoveAttribute') { + elseif ($PSCmdlet.ParameterSetName -eq 'RemoveCustomAttribute') { if ($UserHash.Values.username -contains ($Username)) { $URL_ID = $UserHash.GetEnumerator().Where({ $_.Value.username -contains ($Username) }).Name Write-Debug $URL_ID @@ -955,7 +953,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline continue } - if ($param.key -eq 'RemoveAttribute') { + if ($param.key -eq 'RemoveCustomAttribute') { continue } @@ -1070,15 +1068,15 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline $CurrentAttributesHash.Add($CurrentA.name, $CurrentA.value) } - foreach ($Remove in $RemoveAttribute) { - if ($CurrentAttributesHash.ContainsKey($Remove)) { - Write-Debug "$Remove is here" + if ($RemoveCustomAttribute) { + Write-Debug "Removing $($RemoveCustomAttribute) attributes" + foreach ($Remove in $RemoveCustomAttribute) { + #Remove each attribute + Write-Debug "Removing $($Remove)" $CurrentAttributesHash.Remove($Remove) } } - - $UpdatedAttributeArrayList = New-Object System.Collections.ArrayList diff --git a/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 index 5ccdc9272..d83f1d80f 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 @@ -376,7 +376,7 @@ Describe -Tag:('JCUser') "Set-JCUser - CustomAttributes 1.0" { } It "Removes a custom attribute from a User" { $NewUser = New-RandomUserCustom -Attributes -Domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -NumberOfCustomAttributes 3 - $UpdatedUser = Set-JCUser $NewUser.username -RemoveAttribute 'Department' + $UpdatedUser = Set-JCUser $NewUser.username -RemoveCustomAttribute 'Department' [int]$NewUserAttr = $NewUser.attributes.name.count [int]$UpdatedUserAttr = $UpdatedUser.attributes.name.count $UpdatedUserAttr++ @@ -1235,7 +1235,7 @@ Describe -Tag:('JCUser') "Set-JCuser users phoneNumbers and attributes 1.8.0" { $NewUser.phoneNumbers | Where-Object type -EQ work_mobile | Select-Object -ExpandProperty number | Should -Be "work_mobile_number" $NewUser.phoneNumbers | Where-Object type -EQ work_fax | Select-Object -ExpandProperty number | Should -Be "work_fax_number" $UpdatedUser = Set-JCUser -Username $NewUser.username -NumberOfCustomAttributes 1 -Attribute1_name 'attr1' -Attribute1_value 'one' - $UpdatedUser = Set-JCUser -Username $NewUser.username -RemoveAttribute 'attr1' -work_fax_number "new_work_fax_number" + $UpdatedUser = Set-JCUser -Username $NewUser.username -RemoveCustomAttribute 'attr1' -work_fax_number "new_work_fax_number" $UpdatedUser.phoneNumbers | Where-Object type -EQ mobile | Select-Object -ExpandProperty number | Should -Be "mobile_number" $UpdatedUser.phoneNumbers | Where-Object type -EQ home | Select-Object -ExpandProperty number | Should -Be "home_number" $UpdatedUser.phoneNumbers | Where-Object type -EQ work | Select-Object -ExpandProperty number | Should -Be "work_number" @@ -1301,13 +1301,13 @@ Describe -Tag:('JCUser') "Set-JCUser MFA Enrollment periods 1.10" { $Newuser.mfa.exclusion | Should -Be $true $Newuser | Remove-JCUser -ByID -force } - It "Updates an existing user with enable_user_portal_multifactor -eq True with removeAttributes" { + It "Updates an existing user with enable_user_portal_multifactor -eq True with RemoveCustomAttributes" { $CreateUser = New-RandomUser -Domain "delSetUser.$(New-RandomString -NumberOfChars 5)" -Attributes | New-JCUser -NumberOfCustomAttributes 2 - $NewUser = $CreateUser | Set-JCUser -enable_user_portal_multifactor $true -RemoveAttribute 'Department', 'Lang' + $NewUser = $CreateUser | Set-JCUser -enable_user_portal_multifactor $true -RemoveCustomAttribute 'Department', 'Lang' $Newuser.mfa.exclusion | Should -Be $true $Newuser | Remove-JCUser -ByID -force } - It "Updates an existing user with enable_user_portal_multifactor -eq True and a 7 days specified for EnrollmentDays with removeAttributes" { + It "Updates an existing user with enable_user_portal_multifactor -eq True and a 7 days specified for EnrollmentDays with RemoveCustomAttributes" { $CreateUser = New-RandomUser -Domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -enable_user_portal_multifactor $true $EnrollmentDays = 7 $NewUser = $CreateUser | Set-JCUser -enable_user_portal_multifactor $true -EnrollmentDays $EnrollmentDays diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 58aa786a9..22431808d 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,12 @@ +## 2.13.1 + +Release Date: August 16, 2024 + +#### RELEASE NOTES + +``` +Renamed -RemoveAtrribute to -RemoveCustomAttribute +``` ## 2.13.0 Release Date: August 8, 2024 From 622afd967917f6daa3121626902b4737a002a04c Mon Sep 17 00:00:00 2001 From: Ken Maranion Date: Fri, 16 Aug 2024 15:01:52 -0700 Subject: [PATCH 02/10] custom attribute --- .../JumpCloud Module/Public/Users/Set-JCUser.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 index 3b8e674cf..2b692143a 100644 --- a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 +++ b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 @@ -8,10 +8,12 @@ Function Set-JCUser () { ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Username', Position = 0, HelpMessage = 'The Username of the JumpCloud user you wish to modify')] + [Parameter(Mandatory, ValueFromPipelineByPropertyName = $true, - ParameterSetName = 'RemoveCustomAttribute', - Position = 0, HelpMessage = 'The Username of the JumpCloud user you wish to modify')] + Position = 0, + ParameterSetName = 'RemoveCustomAttribute', HelpMessage = 'The Custom Attribute of the JumpCloud user you wish to modify')] + [string]$Username, [Parameter(Mandatory, @@ -1068,11 +1070,9 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline $CurrentAttributesHash.Add($CurrentA.name, $CurrentA.value) } - if ($RemoveCustomAttribute) { - Write-Debug "Removing $($RemoveCustomAttribute) attributes" - foreach ($Remove in $RemoveCustomAttribute) { - #Remove each attribute - Write-Debug "Removing $($Remove)" + foreach ($Remove in $RemoveCustomAttribute) { + if ($CurrentAttributesHash.ContainsKey($Remove)) { + Write-Debug "$Remove is getting removed from custom attributes" $CurrentAttributesHash.Remove($Remove) } } From 5734bf2ebd70fa4a8092804cfc6442aa3827ef26 Mon Sep 17 00:00:00 2001 From: Ken Maranion Date: Fri, 16 Aug 2024 15:20:25 -0700 Subject: [PATCH 03/10] edit doc --- PowerShell/JumpCloud Module/Docs/Set-JCUser.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md index 625064836..6396cef1e 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md @@ -32,13 +32,13 @@ Set-JCUser [-Username] [-email ] [-firstname ] [-lastna -Attribute2_value [] ``` -### RemoveAttribute +### RemoveCustomAttribute ``` Set-JCUser [-Username] [-email ] [-firstname ] [-lastname ] [-password ] [-password_never_expires ] [-allow_public_key ] [-sudo ] [-enable_managed_uid ] [-unix_uid ] [-unix_guid ] [-account_locked ] [-passwordless_sudo ] [-externally_managed ] [-ldap_binding_user ] - [-enable_user_portal_multifactor ] [-NumberOfCustomAttributes ] [-RemoveAttribute ] + [-enable_user_portal_multifactor ] [-NumberOfCustomAttributes ] [-RemoveCustomAttribute ] [-middlename ] [-displayname ] [-jobTitle ] [-employeeIdentifier ] [-department ] [-costCenter ] [-company ] [-employeeType ] [-description ] [-location ] [-work_streetAddress ] [-work_poBox ] @@ -107,7 +107,7 @@ This example either updates or adds the Custom Attribute 'name = Department, val ### Example 5 ```powershell -PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveAttribute Department +PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveCustomAttribute ATTRIBUTENAME ``` This example removes the Custom Attribute with the name 'Department' from all JumpCloud Users in the JumpCloud User Group 'Sales' @@ -229,7 +229,7 @@ Accept wildcard characters: False ### -ByID Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to 'ByID' which will increase the function speed and performance. -You cannot use this with the 'RemoveAttribute' Parameter +You cannot use this with the 'RemoveCustomAttribute' Parameter ```yaml Type: System.Management.Automation.SwitchParameter @@ -792,13 +792,13 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -RemoveAttribute +### -RemoveCustomAttribute The name of the existing Custom Attributes you wish to remove. -See an EXAMPLE for working with the -RemoveAttribute Parameter in EXAMPLE 5 +See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE 5 ```yaml Type: System.String[] -Parameter Sets: RemoveAttribute +Parameter Sets: RemoveCustomAttribute Aliases: Required: False @@ -901,7 +901,7 @@ The Username of the JumpCloud user you wish to modify ```yaml Type: System.String -Parameter Sets: Username, RemoveAttribute +Parameter Sets: Username, RemoveCustomAttribute Aliases: Required: True @@ -1070,4 +1070,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Object ## NOTES -## RELATED LINKS +## RELATED LINKS From 35dda0733680abf2b284dfaae35523839130a28b Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Mon, 19 Aug 2024 10:59:20 -0600 Subject: [PATCH 04/10] 2.13.1 version + docs --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- .../Docs/Set-JCSettingsFile.md | 4 +-- .../JumpCloud Module/Docs/Set-JCUser.md | 26 +++++++++---------- PowerShell/JumpCloud Module/JumpCloud.psd1 | 4 +-- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 14 +++++----- PowerShell/ModuleChangelog.md | 19 ++++++-------- 6 files changed, 33 insertions(+), 36 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 30e23380b..2cdb89d4b 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.13.0 +Help Version: 2.13.1 Locale: en-Us --- diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md b/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md index 7f6b8fb85..1bb2c174f 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md @@ -14,8 +14,8 @@ Updates the JumpCloud Module Settings File ## SYNTAX ``` -Set-JCSettingsFile [-moduleBannerMessageCount ] - [-parallelOverride ] [] +Set-JCSettingsFile [-parallelOverride ] + [-moduleBannerMessageCount ] [] ``` ## DESCRIPTION diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md index 6396cef1e..54fa65cc7 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md @@ -38,18 +38,18 @@ Set-JCUser [-Username] [-email ] [-firstname ] [-lastna [-password ] [-password_never_expires ] [-allow_public_key ] [-sudo ] [-enable_managed_uid ] [-unix_uid ] [-unix_guid ] [-account_locked ] [-passwordless_sudo ] [-externally_managed ] [-ldap_binding_user ] - [-enable_user_portal_multifactor ] [-NumberOfCustomAttributes ] [-RemoveCustomAttribute ] - [-middlename ] [-displayname ] [-jobTitle ] [-employeeIdentifier ] - [-department ] [-costCenter ] [-company ] [-employeeType ] - [-description ] [-location ] [-work_streetAddress ] [-work_poBox ] - [-work_locality ] [-work_region ] [-work_postalCode ] [-work_country ] - [-home_streetAddress ] [-home_poBox ] [-home_locality ] [-home_region ] - [-home_postalCode ] [-home_country ] [-mobile_number ] [-home_number ] - [-work_number ] [-work_mobile_number ] [-work_fax_number ] [-external_dn ] - [-external_source_type ] [-state ] [-manager ] [-managedAppleId ] - [-alternateEmail ] [-recoveryEmail ] - [-EnrollmentDays ] -Attribute1_name -Attribute1_value -Attribute2_name - -Attribute2_value [] + [-enable_user_portal_multifactor ] [-NumberOfCustomAttributes ] + [-RemoveCustomAttribute ] [-middlename ] [-displayname ] [-jobTitle ] + [-employeeIdentifier ] [-department ] [-costCenter ] [-company ] + [-employeeType ] [-description ] [-location ] [-work_streetAddress ] + [-work_poBox ] [-work_locality ] [-work_region ] [-work_postalCode ] + [-work_country ] [-home_streetAddress ] [-home_poBox ] [-home_locality ] + [-home_region ] [-home_postalCode ] [-home_country ] [-mobile_number ] + [-home_number ] [-work_number ] [-work_mobile_number ] [-work_fax_number ] + [-external_dn ] [-external_source_type ] [-state ] [-manager ] + [-managedAppleId ] [-alternateEmail ] [-recoveryEmail ] + [-EnrollmentDays ] -Attribute1_name + -Attribute1_value -Attribute2_name -Attribute2_value [] ``` ### ByID @@ -1070,4 +1070,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Object ## NOTES -## RELATED LINKS +## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 2ebf1b9ad..65fa34b59 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 8/8/2024 +# Generated on: 8/19/2024 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '2.13.0' +ModuleVersion = '2.13.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 473791dda..560d7c2cc 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -18979,7 +18979,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli ByID - Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to 'ByID' which will increase the function speed and performance. You cannot use this with the 'RemoveAttribute' Parameter + Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to 'ByID' which will increase the function speed and performance. You cannot use this with the 'RemoveCustomAttribute' Parameter System.Management.Automation.SwitchParameter @@ -20105,9 +20105,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - RemoveAttribute + RemoveCustomAttribute - The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveAttribute Parameter in EXAMPLE 5 + The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE 5 System.String[] @@ -21046,7 +21046,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli ByID - Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to 'ByID' which will increase the function speed and performance. You cannot use this with the 'RemoveAttribute' Parameter + Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to 'ByID' which will increase the function speed and performance. You cannot use this with the 'RemoveCustomAttribute' Parameter System.Management.Automation.SwitchParameter @@ -21477,9 +21477,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - RemoveAttribute + RemoveCustomAttribute - The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveAttribute Parameter in EXAMPLE 5 + The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE 5 System.String[] @@ -21761,7 +21761,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli -------------------------- Example 5 -------------------------- - PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveAttribute Department + PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveCustomAttribute ATTRIBUTENAME This example removes the Custom Attribute with the name 'Department' from all JumpCloud Users in the JumpCloud User Group 'Sales' diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 22431808d..21af0aad3 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,12 +1,13 @@ ## 2.13.1 -Release Date: August 16, 2024 +Release Date: August 19, 2024 #### RELEASE NOTES ``` Renamed -RemoveAtrribute to -RemoveCustomAttribute ``` + ## 2.13.0 Release Date: August 8, 2024 @@ -19,9 +20,8 @@ New admin function, Get-JCAdmin - returns admins in your organization(s) #### FEATURES: -* Get-JCAdmin - Returns administrators in your organization - * MSP/MTP tenants can query multiple organizations or individual organizations - +- Get-JCAdmin - Returns administrators in your organization + - MSP/MTP tenants can query multiple organizations or individual organizations ## 2.12.1 @@ -49,10 +49,10 @@ Added new calculated fields for Get-JCSystemInsights Tables LogicalDrives, Mount #### IMPROVEMENTS: -* Added calculated fields for the `Get-JCSystemInsights` following tables: - * LogicalDrives - freeSpaceGB, sizeGB - * Mounts - blocksGB, blocksAvailableGB - * systemInfo - physicalMemoryGB +- Added calculated fields for the `Get-JCSystemInsights` following tables: + - LogicalDrives - freeSpaceGB, sizeGB + - Mounts - blocksGB, blocksAvailableGB + - systemInfo - physicalMemoryGB ## 2.11.0 @@ -68,7 +68,6 @@ Introducing a new function Get-JcScheduledUserstate - This will allow for the lo New Function: `Get-JcScheduledUserState` - Allows for the lookup of scheduled userstate changes. This will list upcoming suspensions or activations as well as being able to search for a particular user's upcoming state changes by their UserID - ## 2.10.2 Release Date: May 30, 2024 @@ -84,12 +83,10 @@ Removed the unused `systemToken` property from the Get-JCSystem function Fixed a bug when creating a staged user and attempting to enable MFA - #### FEATURES: Removed the `systemToken` property from the Get-JCSystem function - ## 2.10.1 Release Date: April 2, 2024 From 4c0075ce68a518790f367fc714089eb525c71ab3 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Mon, 19 Aug 2024 11:05:06 -0600 Subject: [PATCH 05/10] Add required alias for backwards compatibility, missing in previous commits --- PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 index 2b692143a..800547552 100644 --- a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 +++ b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 @@ -13,7 +13,6 @@ Function Set-JCUser () { ValueFromPipelineByPropertyName = $true, Position = 0, ParameterSetName = 'RemoveCustomAttribute', HelpMessage = 'The Custom Attribute of the JumpCloud user you wish to modify')] - [string]$Username, [Parameter(Mandatory, @@ -96,6 +95,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'RemoveCustomAttribute', HelpMessage = 'The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE 5')] [string[]] + [Alias('RemoveAttribute')] $RemoveCustomAttribute, [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ByID', HelpMessage = 'Use the -ByID parameter when the UserID is being passed over the pipeline to the Set-JCUser function. The -ByID SwitchParameter will set the ParameterSet to ''ByID'' which will increase the function speed and performance. You cannot use this with the ''RemoveCustomAttribute'' Parameter')] From a598582fcff777503f71213038e85fb66ae02363 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Mon, 19 Aug 2024 11:08:56 -0600 Subject: [PATCH 06/10] add test for validating backwards compatibility, missing from previous commits --- .../Tests/Public/Users/Set-JCUser.Tests.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 index d83f1d80f..48486605a 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 @@ -388,6 +388,20 @@ Describe -Tag:('JCUser') "Set-JCUser - CustomAttributes 1.0" { $match | Should -Be $true Remove-JCUser -UserID $NewUser._id -ByID -Force } + It "Removes a custom attribute from a User using the Alias 'RemoveAttribute'" { + $NewUser = New-RandomUserCustom -Attributes -Domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -NumberOfCustomAttributes 3 + $UpdatedUser = Set-JCUser $NewUser.username -RemoveAttribute 'Department' + [int]$NewUserAttr = $NewUser.attributes.name.count + [int]$UpdatedUserAttr = $UpdatedUser.attributes.name.count + $UpdatedUserAttr++ + $match = if ($NewUserAttr -eq $UpdatedUserAttr) { + $true + } else { + $false + } + $match | Should -Be $true + Remove-JCUser -UserID $NewUser._id -ByID -Force + } } Describe -Tag:('JCUser') 'Set-JCUser 1.3.0' { # Linux UID, GUID From fceb9d3006761f3b79cb6c4e03935b7f34d98e50 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Mon, 19 Aug 2024 11:13:44 -0600 Subject: [PATCH 07/10] docs regenerate --- PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md | 4 ++-- PowerShell/JumpCloud Module/Docs/Set-JCUser.md | 2 +- PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md b/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md index 939c52a85..162c96bac 100644 --- a/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md +++ b/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md @@ -13,7 +13,7 @@ The Connect-JCOnline function sets the global variable $JCAPIKEY ## SYNTAX ``` -Connect-JCOnline [-force] [-JumpCloudApiKey] +Connect-JCOnline [-force] [[-JumpCloudApiKey] ] [[-JumpCloudOrgId] ] [[-JCEnvironment] ] [] ``` @@ -88,7 +88,7 @@ Type: System.String Parameter Sets: (All) Aliases: -Required: True +Required: False Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md index 54fa65cc7..62762839a 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md @@ -799,7 +799,7 @@ See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE ```yaml Type: System.String[] Parameter Sets: RemoveCustomAttribute -Aliases: +Aliases: RemoveAttribute Required: False Position: Named diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 560d7c2cc..7cfcdbcca 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -2441,7 +2441,7 @@ PS C:\> $BackupJcOrganizationResults.User Connect-JCOnline - + JumpCloudApiKey Please enter your JumpCloud API key. This can be found in the JumpCloud admin console within "API Settings" accessible from the drop down icon next to the admin email address in the top right corner of the JumpCloud admin console. @@ -2520,7 +2520,7 @@ PS C:\> $BackupJcOrganizationResults.User None - + JumpCloudApiKey Please enter your JumpCloud API key. This can be found in the JumpCloud admin console within "API Settings" accessible from the drop down icon next to the admin email address in the top right corner of the JumpCloud admin console. @@ -20104,7 +20104,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - + RemoveCustomAttribute The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE 5 @@ -21476,7 +21476,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - + RemoveCustomAttribute The name of the existing Custom Attributes you wish to remove. See an EXAMPLE for working with the -RemoveCustomAttribute Parameter in EXAMPLE 5 From 9827c55472f6da7e37221c9611f2d98f450c8bf3 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Mon, 19 Aug 2024 11:42:16 -0600 Subject: [PATCH 08/10] exclude dynamic param functions from test diffs --- .../Tests/ModuleValidation/HelpFiles.Tests.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 index be7e5bc6e..b06effc73 100755 --- a/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 @@ -35,7 +35,11 @@ Describe -Tag:('ModuleValidation') 'Help File Tests' { $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent $ModuleRootFullName = $ModuleRoot.FullName - $HelpFilePopulation = Get-ChildItem -Path:($ModuleRootFullName + '/Docs/*.md') -Recurse + $excludeFunctions = @( + 'Set-JCSettingsFile.md' + 'Connect-JCOnline.md' + ) + $HelpFilePopulation = Get-ChildItem -Path:($ModuleRootFullName + '/Docs/*.md') -Recurse -Exclude $excludeFunctions $HelpFilePopulation | ForEach-Object { # File should exist From 73c7f2a4101cb4e3de588f74c43e1ec4ede264a1 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 20 Aug 2024 09:57:30 -0600 Subject: [PATCH 09/10] Date + docs update --- PowerShell/JumpCloud Module/Docs/Set-JCUser.md | 4 ++-- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- PowerShell/ModuleChangelog.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md index 62762839a..6eab1791a 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md @@ -110,7 +110,7 @@ This example either updates or adds the Custom Attribute 'name = Department, val PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveCustomAttribute ATTRIBUTENAME ``` -This example removes the Custom Attribute with the name 'Department' from all JumpCloud Users in the JumpCloud User Group 'Sales' +This example removes the Custom Attribute with the name 'ATTRIBUTENAME' from all JumpCloud Users in the JumpCloud User Group 'Sales' ### Example 6 ```powershell @@ -1070,4 +1070,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Object ## NOTES -## RELATED LINKS +## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 65fa34b59..e96f04f57 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 8/19/2024 +# Generated on: 8/20/2024 # @{ diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 21af0aad3..a19c0f544 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,6 +1,6 @@ ## 2.13.1 -Release Date: August 19, 2024 +Release Date: August 20, 2024 #### RELEASE NOTES From fd58310cce9434aa16ed43b35c0a4d083268ee0e Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 20 Aug 2024 13:24:50 -0600 Subject: [PATCH 10/10] docs --- PowerShell/JumpCloud Module/Docs/Set-JCUser.md | 2 +- PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md index 6eab1791a..447ab8c8c 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md @@ -1070,4 +1070,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Object ## NOTES -## RELATED LINKS +## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 7cfcdbcca..2d4ef6574 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -21763,7 +21763,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli -------------------------- Example 5 -------------------------- PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveCustomAttribute ATTRIBUTENAME - This example removes the Custom Attribute with the name 'Department' from all JumpCloud Users in the JumpCloud User Group 'Sales' + This example removes the Custom Attribute with the name 'ATTRIBUTENAME' from all JumpCloud Users in the JumpCloud User Group 'Sales'