From 2ead99f1b37d4439122ab8dc8ee3c7b62e5072a3 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Wed, 25 Sep 2024 13:52:14 -0600 Subject: [PATCH 1/4] Remove param type for manager field/allow null value for managervalue --- .../Public/Users/Set-JCUser.ps1 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 index 800547552..89ed2d22a 100644 --- a/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 +++ b/PowerShell/JumpCloud Module/Public/Users/Set-JCUser.ps1 @@ -239,7 +239,6 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline $suspended, [Parameter(ValueFromPipelineByPropertyName = $true, HelpMessage = 'The manager username, ID or primary email of the JumpCloud manager user; must be a valid user')] - [string] $manager, [Parameter(ValueFromPipelineByPropertyName = $true, HelpMessage = 'The managedAppleId for the user')] @@ -322,7 +321,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline Write-Debug 'Verifying JCAPI Key' if ($JCAPIKEY.length -ne 40) { - Connect-JConline + Connect-JCOnline } $hdrs = @{ @@ -563,7 +562,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline # Get the manager using manager username instead of userId if ("manager" -eq $param.Key) { if ([System.String]::isNullOrEmpty($param.value)) { - continue + $managerValue = $null } else { # First check if manager returns valid user with id # Regex match a userid @@ -701,7 +700,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline $URL = "$JCUrlBasePath/api/Systemusers/$URL_ID" Write-Debug $URL - $CurrentAttributes = Get-JCUser -UserID $URL_ID | Select-Object -ExpandProperty attributes | Select-Object value, name + $CurrentAttributes = Get-JCUser -userid $URL_ID | Select-Object -ExpandProperty attributes | Select-Object value, name Write-Debug "There are $($CurrentAttributes.count) existing attributes" $CustomAttributeArrayList = New-Object System.Collections.ArrayList @@ -734,7 +733,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline # Get the manager using manager username instead of userId if ("manager" -eq $param.Key) { if ([System.String]::isNullOrEmpty($param.value)) { - continue + $managerValue = $null } else { # First check if manager returns valid user with id # Regex match a userid @@ -943,7 +942,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline $URL = "$JCUrlBasePath/api/Systemusers/$URL_ID" Write-Debug $URL - $CurrentAttributes = Get-JCUser -UserID $URL_ID | Select-Object -ExpandProperty attributes | Select-Object value, name + $CurrentAttributes = Get-JCUser -userid $URL_ID | Select-Object -ExpandProperty attributes | Select-Object value, name Write-Debug "There are $($CurrentAttributes.count) existing attributes" foreach ($param in $PSBoundParameters.GetEnumerator()) { @@ -974,7 +973,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline # Get the manager using manager username instead of userId if ("manager" -eq $param.Key) { if ([System.String]::isNullOrEmpty($param.value)) { - continue + $managerValue = $null } else { # First check if manager returns valid user with id # Regex match a userid @@ -1167,7 +1166,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline # Get the manager using manager username instead of userId if ("manager" -eq $param.Key) { if ([System.String]::isNullOrEmpty($param.value)) { - continue + $managerValue = $null } else { # First check if manager returns valid user with id # Regex match a userid @@ -1309,7 +1308,7 @@ UserID has an Alias of _id. This means you can leverage the PowerShell pipeline $URL = "$JCUrlBasePath/api/Systemusers/$UserID" - $CurrentAttributes = Get-JCUser -UserID $UserID | Select-Object -ExpandProperty attributes | Select-Object value, name + $CurrentAttributes = Get-JCUser -userid $UserID | Select-Object -ExpandProperty attributes | Select-Object value, name Write-Debug "There are $($CurrentAttributes.count) existing attributes" $CustomAttributeArrayList = New-Object System.Collections.ArrayList From 8c62cde16945bc7578276b1315c53355ce24ce14 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Wed, 25 Sep 2024 13:52:22 -0600 Subject: [PATCH 2/4] manager null tests --- .../Tests/Public/Users/Set-JCUser.Tests.ps1 | 88 ++++++++++++------- 1 file changed, 55 insertions(+), 33 deletions(-) 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 48486605a..295624ba6 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Users/Set-JCUser.Tests.ps1 @@ -120,6 +120,28 @@ Describe -Tag:('JCUser') 'Set-JCUser 1.0' { Remove-JCUser -UserID $NewUser._id -force Remove-JCUser -UserID $ManagerUser._id -force } + It "Updates the manager to Null using -Username" { + $ManagerUser = New-RandomUser "PesterTest$(Get-Date -Format MM-dd-yyyy)" | New-JCUser + $ManagerId = $ManagerUser.id + $NewUser = New-RandomUser "PesterTest$(Get-Date -Format MM-dd-yyyy)" | New-JCUser + $NewManager = Set-JCUser -Username $NewUser.Username -manager $ManagerId + $NewManager.manager | Should -Be $ManagerId + $RemoveManager = Set-JCUser -Username $NewUser.Username -manager $null + $RemoveManager.manager | Should -BeNullOrEmpty + Remove-JCUser -UserID $NewUser._id -force + Remove-JCUser -UserID $ManagerUser._id -force + } + It "Updates the manager to Null using -ByID and -UserID" { + $ManagerUser = New-RandomUser "PesterTest$(Get-Date -Format MM-dd-yyyy)" | New-JCUser + $ManagerId = $ManagerUser.id + $NewUser = New-RandomUser "PesterTest$(Get-Date -Format MM-dd-yyyy)" | New-JCUser + $NewManager = Set-JCUser -ByID -UserID $NewUser._id -manager $ManagerId + $NewManager.manager | Should -Be $ManagerId + $RemoveManager = Set-JCUser -ByID -UserID $NewUser._id -manager $null + $RemoveManager.manager | Should -BeNullOrEmpty + Remove-JCUser -UserID $NewUser._id -force + Remove-JCUser -UserID $ManagerUser._id -force + } It "Updates the password using -ByID and -UserID" { $NewUser = New-RandomUser "PesterTest$(Get-Date -Format MM-dd-yyyy)" | New-JCUser { Set-JCUser -ByID -UserID $NewUser._id -password 'Temp123!' } | Should -Not -Throw @@ -358,7 +380,7 @@ Describe -Tag:('JCUser') "Set-JCUser - CustomAttributes 1.0" { $false } $match | Should -Be $true - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It "Adds a custom attribute to a User" { $NewUser = New-RandomUserCustom -Attributes -Domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -NumberOfCustomAttributes 3 @@ -372,7 +394,7 @@ Describe -Tag:('JCUser') "Set-JCUser - CustomAttributes 1.0" { $false } $match | Should -Be $true - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It "Removes a custom attribute from a User" { $NewUser = New-RandomUserCustom -Attributes -Domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -NumberOfCustomAttributes 3 @@ -386,7 +408,7 @@ Describe -Tag:('JCUser') "Set-JCUser - CustomAttributes 1.0" { $false } $match | Should -Be $true - Remove-JCUser -UserID $NewUser._id -ByID -Force + 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 @@ -400,7 +422,7 @@ Describe -Tag:('JCUser') "Set-JCUser - CustomAttributes 1.0" { $false } $match | Should -Be $true - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } } Describe -Tag:('JCUser') 'Set-JCUser 1.3.0' { @@ -410,19 +432,19 @@ Describe -Tag:('JCUser') 'Set-JCUser 1.3.0' { $SetUser = Set-JCUser -Username $RandomUser.username -unix_uid 2000000 -unix_guid 2000000 $SetUser.unix_guid | Should -Be 2000000 $SetUser.unix_uid | Should -Be 2000000 - Remove-JCUser -UserID $RandomUser._id -ByID -Force + Remove-JCUser -UserID $RandomUser._id -ByID -force } It "Updates a JumpCloud user to password_never_expires false " { $ExpTrue = New-RandomUser "PesterTest$(Get-Date -Format MM-dd-yyyy)" | New-JCUser -password_never_expires $true $SetFalse = $ExpTrue | Set-JCUser -password_never_expires $false $SetFalse.password_never_expires | Should -Be $false - Remove-JCUser -UserID $ExpTrue._id -ByID -Force + Remove-JCUser -UserID $ExpTrue._id -ByID -force } It "Updates a JumpCloud user to password_never_expires true " { $ExpFalse = New-RandomUser "PesterTest$(Get-Date -Format MM-dd-yyyy)" | New-JCUser -password_never_expires $false $SetTrue = $ExpFalse | Set-JCUser -password_never_expires $True $SetTrue.password_never_expires | Should -Be $true - Remove-JCUser -UserID $SetTrue._id -ByID -Force + Remove-JCUser -UserID $SetTrue._id -ByID -force } } Describe -Tag:('JCUser') "Set-JCUser 1.8.0" { @@ -847,7 +869,7 @@ Describe -Tag:('JCUser') "Set-JCUser 1.8.0" { $SetUser.location | Should -Be "new_location" } It "Removes users Where-Object Email -like *pleasedelete* " { - Get-JCUser | Where-Object Email -like *pleasedelete* | Remove-JCUser -force + Get-JCUser | Where-Object Email -Like *pleasedelete* | Remove-JCUser -force } } Describe -Tag:('JCUser') "Set-JCUser addresses 1.8.0" { @@ -938,7 +960,7 @@ Describe -Tag:('JCUser') "Set-JCUser addresses 1.8.0" { $SetUser.addresses | Where-Object type -EQ home | Select-Object -ExpandProperty country | Should -Be "new_home_country" } It "Removes users Where-Object Email -like *pleasedelete* " { - Get-JCUser | Where-Object Email -like *pleasedelete* | Remove-JCUser -force + Get-JCUser | Where-Object Email -Like *pleasedelete* | Remove-JCUser -force } } Describe -Tag:('JCUser') "Set-JCUser phoneNumbers 1.8.0" { @@ -1118,7 +1140,7 @@ Describe -Tag:('JCUser') "Set-JCUser phoneNumbers 1.8.0" { $UpdatedUser.phoneNumbers | Where-Object type -EQ work_fax | Select-Object -ExpandProperty number | Should -Be "new_work_fax_number" } It "Removes users Where-Object Email -like *pleasedelete* " { - Get-JCUser | Where-Object Email -like *pleasedelete* | Remove-JCUser -force + Get-JCUser | Where-Object Email -Like *pleasedelete* | Remove-JCUser -force } } Describe -Tag:('JCUser') "Set-JCuser users phoneNumbers and attributes 1.8.0" { @@ -1258,7 +1280,7 @@ Describe -Tag:('JCUser') "Set-JCuser users phoneNumbers and attributes 1.8.0" { $UpdatedUser.attributes | Where-Object name -EQ "attr1" | Select-Object -ExpandProperty value | Should -Be $Null } It "Removes users Where-Object Email -like *pleasedelete* " { - Get-JCUser | Where-Object Email -like *pleasedelete* | Remove-JCUser -force + Get-JCUser | Where-Object Email -Like *pleasedelete* | Remove-JCUser -force } } Describe -Tag:('JCUser') "Set-JCUser MFA Enrollment periods 1.10" { @@ -1416,18 +1438,18 @@ Describe -Tag:('JCUser') "Set-JCUser with Suspend param 1.15 via pipeline" { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser # This is a conflicting and unsupport state/ suspended pairing { $NewUser | Set-JCUser -suspended $True } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It "Updates a user suspended -eq false " { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -suspended $true # This is a conflicting and unsupport state/ suspended pairing { $NewUser | Set-JCUser -suspended $false } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED with suspended true should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -suspended $true { $NewUser | Set-JCUser -state "ACTIVATED" -suspended $true } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } } @@ -1436,18 +1458,18 @@ Describe -Tag:('JCUser') "Set-JCUser with Suspend param via Username" { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser $UpdatedUser = Set-JCUser -Username $NewUser.username -suspended $True $UpdatedUser.suspended | Should -Be True - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It "Updates a user suspended -eq false " { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -suspended $true $UpdatedUser = Set-JCUser -Username $NewUser.username -suspended $false $UpdatedUser.suspended | Should -Be False - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED with suspended true should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -suspended $true { Set-JCUser -Username $NewUser.username -state "ACTIVATED" -suspended $true } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } } @@ -1456,18 +1478,18 @@ Describe -Tag:('JCUser') "Set-JCUser with Suspend param via UserID" { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser $UpdatedUser = Set-JCUser -UserID $NewUser.id -suspended $True $UpdatedUser.suspended | Should -Be True - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It "Updates a user suspended -eq false " { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -suspended $true $UpdatedUser = Set-JCUser -UserID $NewUser.id -suspended $false $UpdatedUser.suspended | Should -Be False - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED with suspended true should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -suspended $true { Set-JCUser -UserID $NewUser.id -state "ACTIVATED" -suspended $true } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } } @@ -1477,24 +1499,24 @@ Describe -Tag:('JCUser') 'Set-JCUser with State param via pipeline' { $UpdatedUser = $NewUser | Set-JCUser -state "SUSPENDED" $UpdatedUser.suspended | Should -Be True $UpdatedUser.state | Should -Be "SUSPENDED" - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -state "SUSPENDED" $UpdatedUser = $NewUser | Set-JCUser -state "ACTIVATED" $UpdatedUser.suspended | Should -Be False $UpdatedUser.state | Should -Be "ACTIVATED" - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from ACTIVATED to SUSPENDED with suspended false should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser { $NewUser | Set-JCUser -state "SUSPENDED" -suspended $false } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED with suspended true should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -state "SUSPENDED" { $NewUser | Set-JCUser -state "ACTIVATED" -suspended $true } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } } @@ -1504,24 +1526,24 @@ Describe -Tag:('JCUser') 'Set-JCUser with State param via Username' { $UpdatedUser = Set-JCUser -Username $NewUser.username -state "SUSPENDED" $UpdatedUser.suspended | Should -Be True $UpdatedUser.state | Should -Be "SUSPENDED" - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -state "SUSPENDED" $UpdatedUser = Set-JCUser -Username $NewUser.username -state "ACTIVATED" $UpdatedUser.suspended | Should -Be False $UpdatedUser.state | Should -Be "ACTIVATED" - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from ACTIVATED to SUSPENDED with suspended false should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser { Set-JCUser -Username $NewUser.username -state "SUSPENDED" -suspended $false } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED with suspended true should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -state "SUSPENDED" { Set-JCUser -Username $NewUser.username -state "ACTIVATED" -suspended $true } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } } @@ -1531,26 +1553,26 @@ Describe -Tag:('JCUser') 'Set-JCUser with State param via UserID' { $UpdatedUser = Set-JCUser -UserID $NewUser.id -state "SUSPENDED" $UpdatedUser.suspended | Should -Be True $UpdatedUser.state | Should -Be "SUSPENDED" - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -state "SUSPENDED" $UpdatedUser = Set-JCUser -UserID $NewUser.id -state "ACTIVATED" $UpdatedUser.suspended | Should -Be False $UpdatedUser.state | Should -Be "ACTIVATED" - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from ACTIVATED to SUSPENDED with suspended false should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser { Set-JCUser -UserID $NewUser.id -state "SUSPENDED" -suspended $false } | Should -Throw - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } It 'Updates a user state from SUSPENDED to ACTIVATED with suspended true should error' { $NewUser = New-RandomUser -domain "delSetUser.$(New-RandomString -NumberOfChars 5)" | New-JCUser -state "SUSPENDED" { Set-JCUser -UserID $NewUser.id -state "ACTIVATED" -suspended $true | Should -Throw } - Remove-JCUser -UserID $NewUser._id -ByID -Force + Remove-JCUser -UserID $NewUser._id -ByID -force } } AfterAll { - Get-JCUser | Where-Object Email -like *delSetUser* | Remove-JCUser -force + Get-JCUser | Where-Object Email -Like *delSetUser* | Remove-JCUser -force } \ No newline at end of file From 95a3c690f4d5fb5a002ba5212fa50b5d72df061f Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 30 Sep 2024 17:11:29 -0600 Subject: [PATCH 3/4] Build-Module --- .../JumpCloud Module/Docs/Connect-JCOnline.md | 4 +- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- .../JumpCloud Module/Docs/Set-JCUser.md | 9 +-- PowerShell/JumpCloud Module/JumpCloud.psd1 | 4 +- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 64 +++++++++++++++---- PowerShell/ModuleChangelog.md | 15 ++++- 6 files changed, 74 insertions(+), 24 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/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 36ad47751..a6d59e6d5 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.14.0 +Help Version: 2.14.1 Locale: en-Us --- diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md index 447ab8c8c..734b6cb50 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCUser.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCUser.md @@ -26,7 +26,7 @@ Set-JCUser [-Username] [-email ] [-firstname ] [-lastna [-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 ] + [-external_source_type ] [-state ] [-manager ] [-managedAppleId ] [-alternateEmail ] [-recoveryEmail ] [-EnrollmentDays ] -Attribute1_name -Attribute1_value -Attribute2_name -Attribute2_value [] @@ -46,7 +46,7 @@ Set-JCUser [-Username] [-email ] [-firstname ] [-lastna [-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 ] + [-external_dn ] [-external_source_type ] [-state ] [-manager ] [-managedAppleId ] [-alternateEmail ] [-recoveryEmail ] [-EnrollmentDays ] -Attribute1_name -Attribute1_value -Attribute2_name -Attribute2_value [] @@ -66,7 +66,7 @@ Set-JCUser -UserID [-email ] [-firstname ] [-lastname < [-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 ] + [-external_source_type ] [-state ] [-manager ] [-managedAppleId ] [-alternateEmail ] [-recoveryEmail ] [-EnrollmentDays ] -Attribute1_name -Attribute1_value -Attribute2_name -Attribute2_value [] @@ -671,7 +671,7 @@ Accept wildcard characters: False The manager for the user ```yaml -Type: System.String +Type: System.Object Parameter Sets: (All) Aliases: @@ -1065,6 +1065,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Int32 ### System.String[] ### System.Management.Automation.SwitchParameter +### System.Object ## OUTPUTS ### System.Object diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index ad432ab03..b376828b9 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: 9/24/2024 +# Generated on: 9/30/2024 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '2.14.0' +ModuleVersion = '2.14.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 58f035cb1..34ac39e9f 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. @@ -8800,11 +8800,11 @@ PS C:\> $BackupJcOrganizationResults.User Get JCSystemKB - {{ Fill in the Synopsis }} + Returns applied hotfixes/KBs on Windows devices - {{ Fill in the Description }} + The Get-JCSystemKB function returns all applied hotfixes/KBs on Windows Devices. The function can be used to filter based on a specific hotfix/KB, a specific system, or both. An object is returned that contains information on the hotfix/KB including the description of the KB and when it was installed @@ -8891,9 +8891,37 @@ PS C:\> $BackupJcOrganizationResults.User -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + PS C:\> Get-JCSystemKB + + This example returns all installed hotfixes/KBs on all of the Windows devices in the organization + + + + -------------------------- Example 2 -------------------------- + PS C:\> Get-JCSystemKB -SystemID 59f2s305383coo7t369ef7r2 + + This example returns all installed hotfixes/KBs on one Windows device + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-JCSystemKB -KB KB5000736 + + This example returns all devices that have the hotfix/KB installed + + + + -------------------------- Example 4 -------------------------- + PS C:\> Get-JCSystemKB -KB KB5000736 -SystemID 59f2s305383coo7t369ef7r2 + + This example checks a specific system for a specific hotfix/KB + + + + -------------------------- Example 5 -------------------------- + PS C:\> Get-JCSystem -hostname JC-Windows-01 | Get-JCSystemKB - {{ Add example description here }} + This example uses pipeline input from Get-JCSystem to find all installed KBs for the system with the hostname JC-Windows-01 @@ -19426,9 +19454,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli The manager for the user - System.String + System.Object - System.String + System.Object None @@ -20122,9 +20150,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli The manager for the user - System.String + System.Object - System.String + System.Object None @@ -20814,9 +20842,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli The manager for the user - System.String + System.Object - System.String + System.Object None @@ -21494,9 +21522,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli The manager for the user - System.String + System.Object - System.String + System.Object None @@ -21824,6 +21852,14 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli + + + System.Object + + + + + diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 4806829c0..99042dce8 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,6 +1,19 @@ +## 2.14.1 + +Release Date: September 30, 2024 + +#### RELEASE NOTES + +``` +Fixed a bug with `Set-JCUser` not having the ability to remove a user's manager by setting it to `$null` +``` + +#### BUG FIXES: +- Set-JCUser now allows removing a user's manager by inputting a `$null` value as expected + ## 2.14.0 -Release Date: September 24, 2024 +Release Date: September 25, 2024 #### RELEASE NOTES From a1733ad760ddf2d239424209b2078ea0bb7a4137 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 1 Oct 2024 09:04:33 -0600 Subject: [PATCH 4/4] date --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- PowerShell/ModuleChangelog.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b376828b9..58029f21d 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: 9/30/2024 +# Generated on: 10/1/2024 # @{ diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 99042dce8..811d5491e 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,6 +1,6 @@ ## 2.14.1 -Release Date: September 30, 2024 +Release Date: October 1, 2024 #### RELEASE NOTES