diff --git a/.github/workflows/powershell-module-ci.yml b/.github/workflows/powershell-module-ci.yml index 81fe8989c..eb30015dc 100644 --- a/.github/workflows/powershell-module-ci.yml +++ b/.github/workflows/powershell-module-ci.yml @@ -7,6 +7,7 @@ on: # Sequence of patterns matched against refs/heads branches: - "master" + - "v*.*.*_pwshModule" paths: - "PowerShell/Deploy/**" - "PowerShell/JumpCloud Module/**" @@ -98,20 +99,24 @@ jobs: 'PlatyPS' = @{Repository = 'PSGallery'; RequiredVersion = '0.14.2' } 'AWS.Tools.Common' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' } 'AWS.Tools.CodeArtifact' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' } - 'JumpCloud.SDK.V1' = @{Repository = 'PSGallery'; RequiredVersion = '0.1.1'} - 'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = '0.1.1'} - 'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = '0.1.1'} + 'JumpCloud.SDK.V1' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'} + 'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'} + 'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'} 'powershell-yaml' = @{Repository = 'PSGallery'; RequiredVersion = '0.4.7'} } 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)") - 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 - } + $spec = $PSDependencies[$RequiredModule] + $requiredVersion = $spec.RequiredVersion + $repository = $spec.Repository + if ($requiredVersion -eq 'latest') { + Write-Host "[status]Installing latest '$RequiredModule' from $repository" + Install-Module -Name $RequiredModule -Repository $repository -AllowPrerelease -Force + continue + } + if ([System.String]::IsNullOrEmpty((Get-InstalledModule | Where-Object { $_.Name -eq $RequiredModule }))) { + Write-Host "[status]Installing module: '$RequiredModule'; version: $requiredVersion from $repository" + Install-Module -Name $RequiredModule -Repository $repository -RequiredVersion $requiredVersion -AllowPrerelease -Force } } @@ -207,6 +212,7 @@ jobs: Set-Variable -Name $_.Name -Value $_.Value -Scope Global } } + Set-Variable -Name PesterParams_Org -Value "$env:PESTER_ORGID" -Scope Global Set-Variable -Name PesterParams_ApiKey -Value "$env:PESTER_APIKEY" -Scope Global Set-Variable -Name PesterParams_EU_ApiKey -Value "$env:PESTER_EU_APIKEY" -Scope Global Set-Variable -Name PesterParams_EU_OrgID -Value "$env:PESTER_EU_ORGID" -Scope Global @@ -235,10 +241,11 @@ jobs: - shell: pwsh env: PESTER_APIKEY: ${{ secrets.PESTER_APIKEY }} - PESTER_ORGID: ${{ secrets.PESTER_ORGID }} + PESTER_ORGID: ${{ secrets.PESTER_MSP_ORGID }} PESTER_MSP_APIKEY: ${{ secrets.PESTER_MSP_APIKEY }} PESTER_PROVIDER_ID: ${{ secrets.PESTER_PROVIDER_ID }} run: | Set-Variable -Name PesterParams_ApiKeyMsp -Value "$env:PESTER_MSP_APIKEY" -Scope Global + Set-Variable -Name PESTER_ORGID -Value "$env:PESTER_MSP_ORGID" -Scope Global . "./PowerShell/JumpCloud Module/Tests/InvokePester.ps1" -JumpCloudApiKeyMsp "$env:PESTER_MSP_APIKEY" -JumpCloudMspOrg "$env:PESTER_ORGID" -ProviderID "$env:PESTER_PROVIDER_ID" -RequiredModulesRepo "PSGallery" -MSP diff --git a/PowerShell/Deploy/Build-Module.ps1 b/PowerShell/Deploy/Build-Module.ps1 index 3227986f5..186c286ad 100755 --- a/PowerShell/Deploy/Build-Module.ps1 +++ b/PowerShell/Deploy/Build-Module.ps1 @@ -1,11 +1,5 @@ [CmdletBinding()] param ( - [Parameter()] - [String] - $GitSourceBranch, - [Parameter()] - [String] - $GitSourceRepo, [Parameter()] [String] $ReleaseType, @@ -19,7 +13,7 @@ param ( [Boolean] $ManualModuleVersion ) -. "$PSScriptRoot/Get-Config.ps1" -GitSourceBranch:($GitSourceBranch) -GitSourceRepo:($GitSourceRepo) -ReleaseType:($ReleaseType) -RequiredModulesRepo:($RequiredModulesRepo) +. "$PSScriptRoot/Get-Config.ps1" -ModuleName:($ModuleName) -ModuleFolderName:("JumpCloud Module") -DeployFolder:("/PowerShell/Deploy") # Region Checking PowerShell Gallery module version Write-Host ('[status]Check PowerShell Gallery for module version info') $PSGalleryInfo = Get-PSGalleryModuleVersion -Name:($ModuleName) -ReleaseType:($RELEASETYPE) #('Major', 'Minor', 'Patch') @@ -27,7 +21,7 @@ $PSGalleryInfo = Get-PSGalleryModuleVersion -Name:($ModuleName) -ReleaseType:($R if ($ManualModuleVersion) { $ManualModuleVersionRetrieval = Get-Content -Path:($FilePath_psd1) | Where-Object { $_ -like '*ModuleVersion*' } $SemanticRegex = [Regex]"[0-9]+.[0-9]+.[0-9]+" - $SemeanticVersion = Select-String -InputObject $ManualModuleVersionRetrieval -pattern ($SemanticRegex) + $SemeanticVersion = Select-String -InputObject $ManualModuleVersionRetrieval -Pattern ($SemanticRegex) $ModuleVersion = $SemeanticVersion[0].Matches.Value } else { $ModuleVersion = $PSGalleryInfo.NextVersion @@ -45,7 +39,7 @@ New-JCModuleManifest -Path:($FilePath_psd1) ` Write-Host ('[status]Updating module change log: "' + $FilePath_ModuleChangelog + '"') $ModuleChangelog = Get-Content -Path:($FilePath_ModuleChangelog) $NewModuleChangelogRecord = New-ModuleChangelog -LatestVersion:($ModuleVersion) -ReleaseNotes:('{{Fill in the Release Notes}}') -Features:('{{Fill in the Features}}') -Improvements:('{{Fill in the Improvements}}') -BugFixes('{{Fill in the Bug Fixes}}') -If (!(($ModuleChangelog | Select-Object -First 1) -match $ModuleVersion)) { +if (!(($ModuleChangelog | Select-Object -First 1) -match $ModuleVersion)) { ($NewModuleChangelogRecord + ($ModuleChangelog | Out-String)).Trim() | Set-Content -Path:($FilePath_ModuleChangelog) -Force } # EndRegion Updating module change log \ No newline at end of file diff --git a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 index 7c77bb49b..53a9711c5 100644 --- a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 +++ b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 @@ -25,56 +25,72 @@ $ApprovedFunctions = [Ordered]@{ # Destination = '/Public/Reports'; # } ); - #'JumpCloud.SDK.V2' = @( - # [PSCustomObject]@{ - # Name = 'Get-JcSdkAppleMdm'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Remove-JcSdkAppleMdm'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Set-JcSdkAppleMdm'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Get-JcSdkAppleMdmCsr'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Get-JcSdkAppleMdmDepKey'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Clear-JcSdkAppleMdmDevice'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Get-JcSdkAppleMdmDevice'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Lock-JcSdkAppleMdmDevice'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Restart-JcSdkAppleMdmDevice'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Stop-JcSdkAppleMdmDevice'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Sync-JcSdkAppleMdmDevice'; - # Destination = '/Public/AppleMdm'; - # }, - # [PSCustomObject]@{ - # Name = 'Get-JcSdkAppleMdmEnrollmentProfile'; - # Destination = '/Public/AppleMdm'; - # } - #) + 'JumpCloud.SDK.V2' = @( + [PSCustomObject]@{ + Name = 'Get-JcSdkUserGroup'; + Destination = '/Public/Groups/UserGroups'; + }, + [PSCustomObject]@{ + Name = 'Get-JcSdkSystemGroup'; + Destination = '/Public/Groups/SystemGroups'; + }, + [PSCustomObject]@{ + Name = 'Get-JcSdkPolicyGroup'; + Destination = '/Public/Groups/PolicyGroups'; + IdentityParameter = @{ + SdkName = 'Id' + Aliases = @('_id', 'PolicyGroupID') + } + }, + [PSCustomObject]@{ + Name = 'Get-JcSdkPolicyGroupMember'; + Destination = '/Public/Groups/PolicyGroups'; + IdentityParameter = @{ + SdkName = 'GroupId' + Aliases = @('PolicyGroupID') + } + }, + [PSCustomObject]@{ + Name = 'Set-JcSdkUserGroup'; + Destination = '/Public/Groups/UserGroups'; + }, + [PSCustomObject]@{ + Name = 'Set-JcSdkSystemGroup'; + Destination = '/Public/Groups/SystemGroups'; + }, + [PSCustomObject]@{ + Name = 'Set-JcSdkPolicyGroup'; + Destination = '/Public/Groups/PolicyGroups'; + IdentityParameter = @{ + SdkName = 'Id' + Aliases = @('_id', 'PolicyGroupID') + } + }, + [PSCustomObject]@{ + Name = 'Set-JcSdkPolicyGroupMember'; + Destination = '/Public/Groups/PolicyGroups'; + IdentityParameter = @{ + SdkName = 'GroupId' + Aliases = @('PolicyGroupID') + } + }, + [PSCustomObject]@{ + Name = 'New-JcSdkPolicyGroup'; + Destination = '/Public/Groups/PolicyGroups'; + IdentityParameter = @{ + SdkName = 'Id' + Aliases = @('_id', 'PolicyGroupID') + } + }, + [PSCustomObject]@{ + Name = 'Remove-JcSdkPolicyGroup'; + Destination = '/Public/Groups/PolicyGroups'; + IdentityParameter = @{ + SdkName = 'Id' + Aliases = @('_id', 'PolicyGroupID') + } + } + ) } $SdkPrefix = 'JcSdk' $JumpCloudModulePrefix = 'JC' @@ -147,6 +163,18 @@ if (-not [System.String]::IsNullOrEmpty($Modules)) { } # Extract the sections we want to copy over to our new function. $PSScriptInfo = ($FunctionContent | Select-String -Pattern:([regex]'(?s)(<#)(.*?)(#>)')).Matches.Value + # Remove autorest/OpenAPI curl blocks (repeated under .Synopsis / .Description, etc.) + if (-not [System.String]::IsNullOrEmpty($PSScriptInfo)) { + $PSScriptInfo = [regex]::Replace( + $PSScriptInfo, + '(?ms)^\s*#### Sample Request\s*\r?\n```[\s\S]*?```\s*', + '') + # .Link docs URL must track master, not whatever branch the SDK was built from. + $PSScriptInfo = [regex]::Replace( + $PSScriptInfo, + '(https://github\.com/TheJumpCloud/jcapi-powershell/tree/)[^/\s\r\n]+(/)', + '${1}master$2') + } $Params = $FunctionContent | Select-String -Pattern:([regex]'(?s)( \[Parameter)(.*?)(\})') -AllMatches $ParameterContent = ($Params.Matches.Value | Where-Object { $_ -notlike '*DontShow*' -and $_ -notlike '${Limit}' -and $_ -notlike '*${Skip}*' -and $_ -notlike '*${apiHost}*' -and $_ -notlike '*${consoleHost}*' }) @@ -181,11 +209,61 @@ if (-not [System.String]::IsNullOrEmpty($Modules)) { "@ } } + # Proxy/cmdlet sources sometimes emit the Param body as one long line; split attributes before Alias insert. + $paramString = [regex]::Replace($paramString, '(?<=\])\s{2,}(?=\[)', "`n ") + $paramString = [regex]::Replace($paramString, '(?<=,)\s{2,}(?=\[Parameter)', "`n `n ") + # Optional: add [Alias(...)] on SDK identity param; if Name is set and differs from SdkName, rename ${SdkName} and splat to SDK cmdlet. + if ($Function.IdentityParameter -and $Function.IdentityParameter.SdkName) { + $ip = $Function.IdentityParameter + $sdkToken = '$' + '{' + $ip.SdkName + '}' + $shouldRename = $ip.Name -and ($ip.Name -cne $ip.SdkName) + if ($shouldRename) { + $wrapToken = '$' + '{' + $ip.Name + '}' + $paramString = $paramString.Replace($sdkToken, $wrapToken) + } + if ($ip.Aliases -and $ip.Aliases.Count -gt 0) { + $aliasList = (($ip.Aliases | ForEach-Object { "'$_'" }) -join ', ') + $aliasLine = " [Alias($aliasList)]" + $targetToken = if ($shouldRename) { '$' + '{' + $ip.Name + '}' } else { $sdkToken } + $targetEscaped = [regex]::Escape($targetToken) + # First Path + [System.String] + ${SdkName} only (excludes InputObject's IJumpCloudApiIdentity). + $aliasBeforePathStringId = '(?s)((?:\s*\[Parameter[^\]]+\]\s*)+)(\[JumpCloud\.SDK\.V2\.Category\(''Path''\)\]\s*\[System\.String\]\s*(?:#[^\r\n]*)?\s*' + $targetEscaped + ')' + $alreadyAliased = [regex]::Match($paramString, '(?s)\[Parameter[^\]]+\]\s*\[Alias\([^\]]+\)\]\s*\[JumpCloud\.SDK\.V2\.Category\(''Path''\)\]\s*\[System\.String\][\s\S]*?' + $targetEscaped).Success + if (-not $alreadyAliased -and $paramString -match $aliasBeforePathStringId) { + $paramString = [regex]::Replace($paramString, $aliasBeforePathStringId, "`$1`n$aliasLine`n `$2", 1) + } + } + } + $identityParamRenamed = $false + if ($Function.IdentityParameter -and $Function.IdentityParameter.SdkName -and $Function.IdentityParameter.Name -and ($Function.IdentityParameter.Name -cne $Function.IdentityParameter.SdkName)) { + $identityParamRenamed = $paramString -match ('\$\{' + [regex]::Escape($Function.IdentityParameter.Name) + '\}') + } $OutputType = (($FunctionContent | Select-String -Pattern:([regex]'(\[OutputType)(.*?)(\]\s+)')).Matches.Value).TrimEnd() $CmdletBinding = (($FunctionContent | Select-String -Pattern:([regex]'(\[CmdletBinding)(.*?)(\]\s+)')).Matches.Value).TrimEnd() if (-not [System.String]::IsNullOrEmpty($PSScriptInfo)) { $PSScriptInfo = $PSScriptInfo.Replace($SdkPrefix, $JumpCloudModulePrefix) $PSScriptInfo = $PSScriptInfo.Replace("$NewCommandName.md", "$FunctionName.md") + if ($identityParamRenamed -and $Function.IdentityParameter.SdkName) { + $ip = $Function.IdentityParameter + $PSScriptInfo = $PSScriptInfo.Replace("-$($ip.SdkName):(", "-$($ip.Name):(") + } + } + + $processInvocation = if ($identityParamRenamed -and $Function.IdentityParameter.SdkName -and $Function.IdentityParameter.Name) { + $ip = $Function.IdentityParameter + @" + `$SdkParams = @{} + foreach (`$key in `$PSBoundParameters.Keys) { + if (`$key -eq '$($ip.Name)') { + `$SdkParams['$($ip.SdkName)'] = `$PSBoundParameters[`$key] + } else { + `$SdkParams[`$key] = `$PSBoundParameters[`$key] + } + } + `$Results = $($ModuleName)\$($CommandName) @SdkParams +"@ + } else { + " `$Results = $($ModuleName)\$($CommandName) @PSBoundParameters" } # Build $BeginContent, $ProcessContent, and $EndContent @@ -209,7 +287,7 @@ $paramString `$Results = @() } Process { - `$Results = $($ModuleName)\$($CommandName) @PSBoundParameters +$processInvocation } End { Return `$Results diff --git a/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md b/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md index fba54adc5..f3811eb3d 100644 --- a/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md +++ b/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md @@ -87,7 +87,7 @@ Specific to JumpCloud development team to connect to staging dev environment. [M Type: System.String Parameter Sets: (All) Aliases: -Accepted values: STANDARD, staging, EU +Accepted values: STANDARD, STAGING, EU Required: False Position: 3 @@ -131,17 +131,14 @@ Accept wildcard characters: False ``` ### CommonParameters - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.String - ## OUTPUTS ### System.Object - ## NOTES -## RELATED LINKS +## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCGroup.md b/PowerShell/JumpCloud Module/Docs/Get-JCGroup.md index 6cbbf3811..1ab910c2c 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCGroup.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCGroup.md @@ -80,7 +80,7 @@ Note there are only two options - User and System. Type: System.String Parameter Sets: Type Aliases: -Accepted values: User, System +Accepted values: User, System, Policy Required: False Position: 0 diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroup.md b/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroup.md index 3a6ea601b..69c1aa761 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroup.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroup.md @@ -13,19 +13,23 @@ Returns all policy groups, policy groups by name or id. ## SYNTAX -### ReturnAll (Default) +### List (Default) ``` -Get-JCPolicyGroup [] +Get-JCPolicyGroup [-Fields ] + [-Filter ] + [-Sort ] + [] ``` -### ByName +### Get ``` -Get-JCPolicyGroup -Name [] +Get-JCPolicyGroup -Id [] ``` -### ById +### GetViaIdentity ``` -Get-JCPolicyGroup -PolicyGroupID [] +Get-JCPolicyGroup -InputObject + [] ``` ## DESCRIPTION @@ -60,30 +64,57 @@ Returns the policy group with id '66c3a774294f1e9071f080c9' ## PARAMETERS -### -Name - -The Name of the JumpCloud policy group you wish to query. +### -Fields +The comma separated fields included in the returned records. +If omitted, the default list of fields will be returned. ```yaml -Type: System.String -Parameter Sets: ByName +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -PolicyGroupID +### -Filter +A filter to apply to the query. + +**Filter structure**: `::`. + +**field** = Populate with a valid field from an endpoint response. -The ID of the JumpCloud policy group you wish to query +**operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. +_Note: v1 operators differ from v2 operators._ + +**value** = Populate with the value you want to search for. +Is case sensitive. +Supports wild cards. + +**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +ObjectID of the Policy Group. ```yaml Type: System.String -Parameter Sets: ById -Aliases: _id, id +Parameter Sets: Get +Aliases: _id, PolicyGroupID Required: True Position: Named @@ -92,15 +123,46 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Sort +The comma separated fields used to sort the collection. +Default sort is ascending, prefix with `-` to sort descending. + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### None +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity ## OUTPUTS -### System.Object +### JumpCloud.SDK.V2.Models.IPolicyGroup ## NOTES ## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroupMember.md b/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroupMember.md index 3d3a99d03..4e6886b2f 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroupMember.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCPolicyGroupMember.md @@ -13,14 +13,24 @@ This function will return the policies that are members of the specified policy ## SYNTAX -### ById +### Get (Default) ``` -Get-JCPolicyGroupMember -PolicyGroupID [] +Get-JCPolicyGroupMember -PolicyId [-Filter ] + [-Sort ] [-Authorization ] [-Date ] + [] ``` -### ByName +### GetViaIdentity ``` -Get-JCPolicyGroupMember -Name [] +Get-JCPolicyGroupMember -InputObject + [-Filter ] + [-Sort ] [-Authorization ] [-Date ] + [] +``` + +### List +``` +Get-JCPolicyGroupMember -GroupId [] ``` ## DESCRIPTION @@ -47,15 +57,72 @@ This will return all policies that are members of the policy group with name: 'P ## PARAMETERS -### -Name +### -Authorization +Authorization header for the System Context API -The Name of the JumpCloud policy group to query and return members of +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Date +Current date header for the System Context API ```yaml Type: System.String -Parameter Sets: ByName +Parameter Sets: Get, GetViaIdentity Aliases: +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +A filter to apply to the query. + +**Filter structure**: `::`. + +**field** = Populate with a valid field from an endpoint response. + +**operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. +_Note: v1 operators differ from v2 operators._ + +**value** = Populate with the value you want to search for. +Is case sensitive. +Supports wild cards. + +**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupId +ObjectID of the Policy Group. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: PolicyGroupID + Required: True Position: Named Default value: None @@ -63,14 +130,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -PolicyGroupID +### -InputObject +Identity Parameter -The ID of the JumpCloud policy group to query and return members of +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PolicyId +ObjectID of the Policy. ```yaml Type: System.String -Parameter Sets: ById -Aliases: _id, id +Parameter Sets: Get +Aliases: Required: True Position: Named @@ -79,15 +160,32 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Sort +The comma separated fields used to sort the collection. +Default sort is ascending, prefix with `-` to sort descending. + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS -### None +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity ## OUTPUTS -### System.Object +### JumpCloud.SDK.V2.Models.IGraphConnection +### JumpCloud.SDK.V2.Models.IGraphObjectWithPaths ## NOTES ## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemGroup.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemGroup.md new file mode 100644 index 000000000..3b8ac0895 --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemGroup.md @@ -0,0 +1,222 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/ +schema: 2.0.0 +--- + +# Get-JCSystemGroup + +## SYNOPSIS + +This endpoint returns the details of a System Group. + +## SYNTAX + +### List (Default) +``` +Get-JCSystemGroup [-Fields ] + [-Filter ] + [-Sort ] + [] +``` + +### Get +``` +Get-JCSystemGroup -Id [] +``` + +### GetViaIdentity +``` +Get-JCSystemGroup -InputObject + [] +``` + +## DESCRIPTION + +This endpoint returns the details of a System Group. + +## EXAMPLES + +### EXAMPLE 1 + +``` +Get-JCSystemGroup -Fields:() -Filter:() -Sort:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + +### EXAMPLE 2 + +``` +Get-JCSystemGroup -Id:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + +## PARAMETERS + +### -Fields + +The comma separated fields included in the returned records. +If omitted, the default list of fields will be returned. + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter + +A filter to apply to the query. + +**Filter structure**: \`\:\:\\`. + +**field** = Populate with a valid field from an endpoint response. + +**operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. +_Note: v1 operators differ from v2 operators._ + +**value** = Populate with the value you want to search for. +Is case sensitive. +Supports wild cards. + +**EX:** \`GET /api/v2/groups?filter=name:eq:Test+Group\` + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id + +ObjectID of the System Group. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject + +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Sort + +The comma separated fields used to sort the collection. +Default sort is ascending, prefix with \`-\` to sort descending. + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +## OUTPUTS + +### JumpCloud.SDK.V2.Models.ISystemGroup +## NOTES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT \: Identity Parameter +\[AccountId \\]: +\[ActivedirectoryId \\]: +\[AdministratorId \\]: +\[AgentId \\]: +\[AppleMdmId \\]: +\[ApplicationId \\]: ObjectID of the Application. +\[ApprovalFlowId \\]: +\[CommandId \\]: ObjectID of the Command. +\[CustomEmailType \\]: +\[DeviceId \\]: +\[GroupId \\]: ObjectID of the Policy Group. +\[GsuiteId \\]: ObjectID of the G Suite instance. +\[Id \\]: ObjectID of this Active Directory instance. +\[JobId \\]: +\[LdapserverId \\]: ObjectID of the LDAP Server. +\[Office365Id \\]: ObjectID of the Office 365 instance. +\[PolicyId \\]: ObjectID of the Policy. +\[ProviderId \\]: +\[PushEndpointId \\]: +\[RadiusserverId \\]: ObjectID of the Radius Server. +\[SoftwareAppId \\]: ObjectID of the Software App. +\[SystemId \\]: ObjectID of the System. +\[UserId \\]: ObjectID of the User. +\[WorkdayId \\]: + +## RELATED LINKS + +[https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkSystemGroup.md](https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkSystemGroup.md) diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCUserGroup.md b/PowerShell/JumpCloud Module/Docs/Get-JCUserGroup.md new file mode 100644 index 000000000..ee365c653 --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Get-JCUserGroup.md @@ -0,0 +1,227 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/ +schema: 2.0.0 +--- + +# Get-JCUserGroup + +## SYNOPSIS + +This endpoint returns the details of a User Group. + +## SYNTAX + +### List (Default) +``` +Get-JCUserGroup [-Fields ] + [-Filter ] + [-Sort ] + [] +``` + +### Get +``` +Get-JCUserGroup -Id [] +``` + +### GetViaIdentity +``` +Get-JCUserGroup -InputObject [] +``` + +## DESCRIPTION + +This endpoint returns the details of a User Group. + +## EXAMPLES + +### EXAMPLE 1 + +``` +Get-JCUserGroup -Fields:() -Filter:() -Sort:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + +### EXAMPLE 2 + +``` +Get-JCUserGroup -Id:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + +## PARAMETERS + +### -Fields + +The comma separated fields included in the returned records. +If omitted, the default list of fields will be returned. + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter + +A filter to apply to the query. + +**Filter structure**: \`\:\:\\`. + +**field** = Populate with a valid field from an endpoint response. + +**operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. +_Note: v1 operators differ from v2 operators._ + +**value** = Populate with the value you want to search for. +Is case sensitive. +Supports wild cards. + +**EX:** \`GET /api/v2/groups?filter=name:eq:Test+Group\` + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id + +ObjectID of the User Group. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject + +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Sort + +The comma separated fields used to sort the collection. +Default sort is ascending, prefix with \`-\` to sort descending. + +```yaml +Type: System.Collections.Generic.List`1[System.String] +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +## OUTPUTS + +### JumpCloud.SDK.V2.Models.IUserGroup +## NOTES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT \: Identity Parameter +\[AccountId \\]: +\[ActivedirectoryId \\]: +\[AdministratorId \\]: +\[AgentId \\]: +\[AppleMdmId \\]: +\[ApplicationId \\]: ObjectID of the Application. +\[ApprovalFlowId \\]: +\[CommandId \\]: ObjectID of the Command. +\[CustomEmailType \\]: +\[DeviceId \\]: +\[GroupId \\]: ObjectID of the Policy Group. +\[GsuiteId \\]: ObjectID of the G Suite instance. +\[Id \\]: ObjectID of this Active Directory instance. +\[JobId \\]: +\[LdapserverId \\]: ObjectID of the LDAP Server. +\[Office365Id \\]: ObjectID of the Office 365 instance. +\[PolicyId \\]: ObjectID of the Policy. +\[ProviderId \\]: +\[PushEndpointId \\]: +\[RadiusserverId \\]: ObjectID of the Radius Server. +\[SoftwareAppId \\]: ObjectID of the Software App. +\[SystemId \\]: ObjectID of the System. +\[UserId \\]: ObjectID of the User. +\[WorkdayId \\]: + +## RELATED LINKS + +[https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkUserGroup.md](https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkUserGroup.md) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 6e387380a..05ac448d8 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: 3.0.2 +Help Version: 3.1.0 Locale: en-Us --- @@ -122,6 +122,9 @@ Returns all JumpCloud Systems within a JumpCloud tenant or a single JumpCloud Sy ### [Get-JCSystemApp](Get-JCSystemApp.md) Returns the applications/programs/linux packages installed on JumpCloud managed system(s). This function queries separate system insights tables to get data for macOS/windows/linux devices. +### [Get-JCSystemGroup](Get-JCSystemGroup.md) +This endpoint returns the details of a System Group. + ### [Get-JCSystemGroupMember](Get-JCSystemGroupMember.md) Returns the System Group members of a JumpCloud System Group. @@ -138,6 +141,9 @@ Returns all JumpCloud Users associated with a JumpCloud System. ### [Get-JCUser](Get-JCUser.md) Returns all JumpCloud Users within a JumpCloud tenant or searches for a JumpCloud User by 'username', 'firstname', 'lastname', or 'email'. +### [Get-JCUserGroup](Get-JCUserGroup.md) +This endpoint returns the details of a User Group. + ### [Get-JCUserGroupMember](Get-JCUserGroupMember.md) Returns the User Group members of a JumpCloud User Group. @@ -272,6 +278,9 @@ Set-JCPolicy can display the available parameters per policy if a `PolicyName` o ### [Set-JCPolicyGroup](Set-JCPolicyGroup.md) This endpoint allows you to do a full update of the Policy Group. +### [Set-JCPolicyGroupMember](Set-JCPolicyGroupMember.md) +This endpoint allows you to manage the Policy members of a Policy Group. + ### [Set-JCRadiusReplyAttribute](Set-JCRadiusReplyAttribute.md) Updates or adds Radius reply attributes to a JumpCloud user group. @@ -284,12 +293,22 @@ Updates the JumpCloud Module Settings File ### [Set-JCSystem](Set-JCSystem.md) Updates an existing JumpCloud System +### [Set-JCSystemGroup](Set-JCSystemGroup.md) +This endpoint allows you to do a full set of the System Group. + +See the \[Dynamic Group Configuration KB article\](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. + ### [Set-JCSystemUser](Set-JCSystemUser.md) Updates the permissions of a JumpCloud user on a JumpCloud system ### [Set-JCUser](Set-JCUser.md) Updates an existing JumpCloud User +### [Set-JCUserGroup](Set-JCUserGroup.md) +This endpoint allows you to do a full set of the User Group. + +See the \[Dynamic Group Configuration KB article\](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. + ### [Set-JCUserGroupLDAP](Set-JCUserGroupLDAP.md) The Set-JCUserGroupLDAP command adds or removes a JumpCloud user group and the members to/from the JumpCloud LDAP directory. diff --git a/PowerShell/JumpCloud Module/Docs/New-JCPolicyGroup.md b/PowerShell/JumpCloud Module/Docs/New-JCPolicyGroup.md index cdd0633de..cf2907b80 100644 --- a/PowerShell/JumpCloud Module/Docs/New-JCPolicyGroup.md +++ b/PowerShell/JumpCloud Module/Docs/New-JCPolicyGroup.md @@ -13,14 +13,15 @@ This endpoint allows you to create a new Policy Group. ## SYNTAX -### FromTemplateID +### CreateExpanded (Default) ``` -New-JCPolicyGroup -TemplateID [] +New-JCPolicyGroup [-Name ] [-WhatIf] [-Confirm] + [] ``` -### Name +### Create ``` -New-JCPolicyGroup -Name [-Description ] +New-JCPolicyGroup -Body [-WhatIf] [-Confirm] [] ``` @@ -48,19 +49,18 @@ Creates a policy group with name: "Windows Policy Group" and description: "Windo ## PARAMETERS -### -Description - -The description of the policy group to create +### -Body +PolicyGroupData ```yaml -Type: System.String -Parameter Sets: Name +Type: JumpCloud.SDK.V2.Models.IPolicyGroupData +Parameter Sets: Create Aliases: -Required: False +Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -70,27 +70,40 @@ The name of the policy group to create ```yaml Type: System.String -Parameter Sets: Name +Parameter Sets: CreateExpanded Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -TemplateID +### -Confirm +Prompts you for confirmation before running the cmdlet. -The Policy Template ID to apply to this MTP org. -This parameter will only work in MTP organizations +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml -Type: System.String -Parameter Sets: FromTemplateID -Aliases: +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -102,10 +115,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None +### JumpCloud.SDK.V2.Models.IPolicyGroupData ## OUTPUTS -### System.Object +### JumpCloud.SDK.V2.Models.IPolicyGroup ## NOTES ## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Remove-JCPolicyGroup.md b/PowerShell/JumpCloud Module/Docs/Remove-JCPolicyGroup.md index 01ad7c5a1..6123b4880 100644 --- a/PowerShell/JumpCloud Module/Docs/Remove-JCPolicyGroup.md +++ b/PowerShell/JumpCloud Module/Docs/Remove-JCPolicyGroup.md @@ -13,14 +13,16 @@ This endpoint allows you to delete a Policy Group. ## SYNTAX -### ByName +### Delete (Default) ``` -Remove-JCPolicyGroup -Name [-Force] [] +Remove-JCPolicyGroup -Id [-PassThru] [-WhatIf] [-Confirm] + [] ``` -### ByID +### DeleteViaIdentity ``` -Remove-JCPolicyGroup -PolicyGroupID [-Force] [] +Remove-JCPolicyGroup -InputObject [-PassThru] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -55,9 +57,38 @@ Removes a policy group with id: "66ace9082dfb9356f460bee4", the cmdlet will not ## PARAMETERS -### -Force +### -Id +ObjectID of the Policy Group. -A SwitchParameter which suppresses the warning message when removing a JumpCloud Policy. +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: _id, PolicyGroupID + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds ```yaml Type: System.Management.Automation.SwitchParameter @@ -66,40 +97,38 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -Name - -The Name of the JumpCloud policy group you wish to remove. +### -Confirm +Prompts you for confirmation before running the cmdlet. ```yaml -Type: System.String -Parameter Sets: ByName -Aliases: +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -PolicyGroupID - -The ID of the JumpCloud policy group you wish to remove. +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml -Type: System.String -Parameter Sets: ByID -Aliases: _id, id +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -108,10 +137,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity ## OUTPUTS -### System.Object +### JumpCloud.SDK.V2.Models.IPolicyGroup ## NOTES ## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCPolicyGroup.md b/PowerShell/JumpCloud Module/Docs/Set-JCPolicyGroup.md index cdbb097d7..7fa20d9af 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCPolicyGroup.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCPolicyGroup.md @@ -13,16 +13,28 @@ This endpoint allows you to do a full update of the Policy Group. ## SYNTAX -### ByName +### SetExpanded (Default) ``` -Set-JCPolicyGroup -Name [-NewName ] [-Description ] +Set-JCPolicyGroup -Id [-Name ] [-WhatIf] [-Confirm] [] ``` -### ByID +### Set ``` -Set-JCPolicyGroup -PolicyGroupID [-NewName ] [-Description ] - [] +Set-JCPolicyGroup -Id -Body [-WhatIf] + [-Confirm] [] +``` + +### SetViaIdentity +``` +Set-JCPolicyGroup -InputObject -Body + [-WhatIf] [-Confirm] [] +``` + +### SetViaIdentityExpanded +``` +Set-JCPolicyGroup -InputObject [-Name ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -57,19 +69,48 @@ Sets the policy group with id: "671aa7190133c4000119e158" and it's description t ## PARAMETERS -### -Description +### -Body +PolicyGroupData -The Description of the JumpCloud policy group you wish to set. +```yaml +Type: JumpCloud.SDK.V2.Models.IPolicyGroupData +Parameter Sets: Set, SetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Id +ObjectID of the Policy Group. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: SetExpanded, Set +Aliases: _id, PolicyGroupID + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: SetViaIdentity, SetViaIdentityExpanded Aliases: -Required: False +Required: True Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -79,24 +120,23 @@ The Name of the JumpCloud policy group you wish to set. ```yaml Type: System.String -Parameter Sets: ByName +Parameter Sets: SetExpanded, SetViaIdentityExpanded Aliases: -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` -### -NewName - -The new name to set on the existing JumpCloud policy group. If left unspecified, the cmdlet will not rename the existing policy group. +### -Confirm +Prompts you for confirmation before running the cmdlet. ```yaml -Type: System.String +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: cf Required: False Position: Named @@ -105,19 +145,18 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -PolicyGroupID - -The Id of the JumpCloud policy group you wish to set. +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml -Type: System.String -Parameter Sets: ByID -Aliases: _id, id +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -126,10 +165,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +### JumpCloud.SDK.V2.Models.IPolicyGroupData ## OUTPUTS -### System.Object +### JumpCloud.SDK.V2.Models.IPolicyGroup ## NOTES ## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCPolicyGroupMember.md b/PowerShell/JumpCloud Module/Docs/Set-JCPolicyGroupMember.md new file mode 100644 index 000000000..5e29bf76d --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Set-JCPolicyGroupMember.md @@ -0,0 +1,256 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/ +schema: 2.0.0 +--- + +# Set-JCPolicyGroupMember + +## SYNOPSIS + +This endpoint allows you to manage the Policy members of a Policy Group. + +## SYNTAX + +### SetExpanded (Default) +``` +Set-JCPolicyGroupMember -GroupId [-Attributes ] [-Id ] [-Op ] [-PassThru] + [-WhatIf] [-Confirm] [] +``` + +### Set +``` +Set-JCPolicyGroupMember -GroupId -Body [-PassThru] + [-WhatIf] [-Confirm] [] +``` + +### SetViaIdentity +``` +Set-JCPolicyGroupMember -InputObject -Body + [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### SetViaIdentityExpanded +``` +Set-JCPolicyGroupMember -InputObject [-Attributes ] [-Id ] + [-Op ] [-PassThru] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION + +This endpoint allows you to manage the Policy members of a Policy Group. + +## EXAMPLES + +### EXAMPLE 1 + +``` +Set-JCPolicyGroupMember -GroupId:() -Body:() +``` + +### EXAMPLE 2 + +``` +Set-JCPolicyGroupMember -GroupId:() -Id:() -Op:() -Attributes:() +``` + +## PARAMETERS + +### -Attributes + +The graph attributes. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body + +GraphOperation (PolicyGroup-Member) + +```yaml +Type: JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember +Parameter Sets: Set, SetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -GroupId + +ObjectID of the Policy Group. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, Set +Aliases: PolicyGroupID + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id + +The ObjectID of graph object being added or removed as an association. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject + +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: SetViaIdentity, SetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Op + +How to modify the graph connection. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru + +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +## OUTPUTS + +### System.Boolean +## NOTES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +BODY \: GraphOperation (PolicyGroup-Member) +Id \: The ObjectID of graph object being added or removed as an association. +Op \: How to modify the graph connection. +\[Attributes \\]: The graph attributes. +\[(Any) \\]: This indicates any property can be added to this object. + +INPUTOBJECT \: Identity Parameter +\[AccountId \\]: +\[ActivedirectoryId \\]: +\[AdministratorId \\]: +\[AgentId \\]: +\[AppleMdmId \\]: +\[ApplicationId \\]: ObjectID of the Application. +\[ApprovalFlowId \\]: +\[CommandId \\]: ObjectID of the Command. +\[CustomEmailType \\]: +\[DeviceId \\]: +\[GroupId \\]: ObjectID of the Policy Group. +\[GsuiteId \\]: ObjectID of the G Suite instance. +\[Id \\]: ObjectID of this Active Directory instance. +\[JobId \\]: +\[LdapserverId \\]: ObjectID of the LDAP Server. +\[Office365Id \\]: ObjectID of the Office 365 instance. +\[PolicyId \\]: ObjectID of the Policy. +\[ProviderId \\]: +\[PushEndpointId \\]: +\[RadiusserverId \\]: ObjectID of the Radius Server. +\[SoftwareAppId \\]: ObjectID of the Software App. +\[SystemId \\]: ObjectID of the System. +\[UserId \\]: ObjectID of the User. +\[WorkdayId \\]: + +## RELATED LINKS + +[https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkPolicyGroupMember.md](https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkPolicyGroupMember.md) diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md b/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md index fb89d23e8..10b2e54cc 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 ] [-JCEnvironmentLocation ] [] +Set-JCSettingsFile [-JCEnvironmentLocation ] + [-parallelOverride ] [-moduleBannerMessageCount ] [] ``` ## DESCRIPTION @@ -91,17 +91,14 @@ Accept wildcard characters: False ``` ### CommonParameters - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### None - ## OUTPUTS ### System.Object - ## NOTES -## RELATED LINKS +## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCSystemGroup.md b/PowerShell/JumpCloud Module/Docs/Set-JCSystemGroup.md new file mode 100644 index 000000000..75cfc3b8d --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Set-JCSystemGroup.md @@ -0,0 +1,410 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/ +schema: 2.0.0 +--- + +# Set-JCSystemGroup + +## SYNOPSIS + +This endpoint allows you to do a full set of the System Group. + +See the \[Dynamic Group Configuration KB article\](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. + +## SYNTAX + +### SetExpanded (Default) +``` +Set-JCSystemGroup -Id [-Attributes ] [-Description ] [-Email ] + [-MemberQueryExemptions ] [-MemberQueryFilters ] + [-MemberQuerySearchFilters ] [-MemberQueryType ] [-MemberSuggestionsNotify] + [-MembershipMethod ] [-Name ] [-WhatIf] [-Confirm] + [] +``` + +### Set +``` +Set-JCSystemGroup -Id -Body [-WhatIf] + [-Confirm] [] +``` + +### SetViaIdentity +``` +Set-JCSystemGroup -InputObject -Body + [-WhatIf] [-Confirm] [] +``` + +### SetViaIdentityExpanded +``` +Set-JCSystemGroup -InputObject [-Attributes ] [-Description ] + [-Email ] [-MemberQueryExemptions ] [-MemberQueryFilters ] + [-MemberQuerySearchFilters ] [-MemberQueryType ] [-MemberSuggestionsNotify] + [-MembershipMethod ] [-Name ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION + +This endpoint allows you to do a full set of the System Group. + +See the \[Dynamic Group Configuration KB article\](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. + +## EXAMPLES + +### EXAMPLE 1 + +``` +Set-JCSystemGroup -Id:() -Body:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + +### EXAMPLE 2 + +``` +Set-JCSystemGroup -Id:() -Name:() -Attributes:() -Description:() -Email:() -MemberQueryExemptions:() -MemberQueryFilters:() -MemberQueryType:() -MemberSuggestionsNotify:() -MembershipMethod:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + +## PARAMETERS + +### -Attributes + +The graph attributes. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body + +SystemGroupPut + +```yaml +Type: JumpCloud.SDK.V2.Models.ISystemGroupPut +Parameter Sets: Set, SetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Description + +Description of a System Group + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Email + +Email address of a System Group + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id + +ObjectID of the System Group. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, Set +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject + +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: SetViaIdentity, SetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MemberQueryExemptions + +Array of GraphObjects exempted from the query + +```yaml +Type: JumpCloud.SDK.V2.Models.IGraphObject[] +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberQueryFilters + +For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + +```yaml +Type: System.String[] +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberQuerySearchFilters + +For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberQueryType + +. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MembershipMethod + +The type of membership method for this group. +Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \[group-associated MDM-enrolled devices\](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberSuggestionsNotify + +True if notification emails are to be sent for membership suggestions. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name + +Display name of a System Group. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +### JumpCloud.SDK.V2.Models.ISystemGroupPut +## OUTPUTS + +### JumpCloud.SDK.V2.Models.ISystemGroup +## NOTES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +BODY \: SystemGroupPut +Name \: Display name of a System Group. +\[Attributes \\]: The graph attributes. +\[(Any) \\]: This indicates any property can be added to this object. +\[Description \\]: Description of a System Group +\[Email \\]: Email address of a System Group +\[MemberQueryExemptions \\>\]: Array of GraphObjects exempted from the query +Id \: The ObjectID of the graph object. +Type \: The type of graph object. +\[Attributes \\]: The graph attributes. +\[MemberQueryFilters \\>\]: For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. +\[MemberQuerySearchFilters \\]: For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. +\[MemberQueryType \\]: +\[MemberSuggestionsNotify \\]: True if notification emails are to be sent for membership suggestions. +\[MembershipMethod \\]: The type of membership method for this group. +Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED. +Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \[group-associated MDM-enrolled devices\](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices). +Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + +INPUTOBJECT \: Identity Parameter +\[AccountId \\]: +\[ActivedirectoryId \\]: +\[AdministratorId \\]: +\[AgentId \\]: +\[AppleMdmId \\]: +\[ApplicationId \\]: ObjectID of the Application. +\[ApprovalFlowId \\]: +\[CommandId \\]: ObjectID of the Command. +\[CustomEmailType \\]: +\[DeviceId \\]: +\[GroupId \\]: ObjectID of the Policy Group. +\[GsuiteId \\]: ObjectID of the G Suite instance. +\[Id \\]: ObjectID of this Active Directory instance. +\[JobId \\]: +\[LdapserverId \\]: ObjectID of the LDAP Server. +\[Office365Id \\]: ObjectID of the Office 365 instance. +\[PolicyId \\]: ObjectID of the Policy. +\[ProviderId \\]: +\[PushEndpointId \\]: +\[RadiusserverId \\]: ObjectID of the Radius Server. +\[SoftwareAppId \\]: ObjectID of the Software App. +\[SystemId \\]: ObjectID of the System. +\[UserId \\]: ObjectID of the User. +\[WorkdayId \\]: + +MEMBERQUERYEXEMPTIONS \: Array of GraphObjects exempted from the query +Id \: The ObjectID of the graph object. +Type \: The type of graph object. +\[Attributes \\]: The graph attributes. +\[(Any) \\]: This indicates any property can be added to this object. + +## RELATED LINKS + +[https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkSystemGroup.md](https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkSystemGroup.md) diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCUserGroup.md b/PowerShell/JumpCloud Module/Docs/Set-JCUserGroup.md new file mode 100644 index 000000000..87535b0d1 --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Set-JCUserGroup.md @@ -0,0 +1,428 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/ +schema: 2.0.0 +--- + +# Set-JCUserGroup + +## SYNOPSIS + +This endpoint allows you to do a full set of the User Group. + +See the \[Dynamic Group Configuration KB article\](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. + +## SYNTAX + +### SetExpanded (Default) +``` +Set-JCUserGroup -Id [-Attributes ] [-Description ] [-Email ] + [-MemberQueryExemptions ] [-MemberQueryFilters ] + [-MemberQuerySearchFilters ] [-MemberQueryType ] [-MemberSuggestionsNotify] + [-MembershipMethod ] [-Name ] [-WhatIf] [-Confirm] + [] +``` + +### Set +``` +Set-JCUserGroup -Id -Body [-WhatIf] [-Confirm] + [] +``` + +### SetViaIdentity +``` +Set-JCUserGroup -InputObject -Body + [-WhatIf] [-Confirm] [] +``` + +### SetViaIdentityExpanded +``` +Set-JCUserGroup -InputObject [-Attributes ] [-Description ] + [-Email ] [-MemberQueryExemptions ] [-MemberQueryFilters ] + [-MemberQuerySearchFilters ] [-MemberQueryType ] [-MemberSuggestionsNotify] + [-MembershipMethod ] [-Name ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION + +This endpoint allows you to do a full set of the User Group. + +See the \[Dynamic Group Configuration KB article\](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. + +## EXAMPLES + +### EXAMPLE 1 + +``` +Set-JCUserGroup -Id:() -Body:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + +### EXAMPLE 2 + +``` +Set-JCUserGroup -Id:() -Name:() -Attributes:() -Description:() -Email:() -MemberQueryExemptions:() -MemberQueryFilters:() -MemberQueryType:() -MemberSuggestionsNotify:() -MembershipMethod:() +``` + +--- + +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject\[\] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any\[\] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + +## PARAMETERS + +### -Attributes + +The graph attributes for a UserGroup. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Body + +UserGroupPut + +```yaml +Type: JumpCloud.SDK.V2.Models.IUserGroupPut +Parameter Sets: Set, SetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Description + +Description of a User Group + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Email + +Email address of a User Group + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id + +ObjectID of the User Group. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, Set +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject + +Identity Parameter + +```yaml +Type: JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +Parameter Sets: SetViaIdentity, SetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MemberQueryExemptions + +Array of GraphObjects exempted from the query + +```yaml +Type: JumpCloud.SDK.V2.Models.IGraphObject[] +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberQueryFilters + +For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + +```yaml +Type: System.String[] +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberQuerySearchFilters + +For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberQueryType + +. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MembershipMethod + +The type of membership method for this group. +Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \[group-associated MDM-enrolled devices\](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MemberSuggestionsNotify + +True if notification emails are to be sent for membership suggestions. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name + +Display name of a User Group. + +```yaml +Type: System.String +Parameter Sets: SetExpanded, SetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +### JumpCloud.SDK.V2.Models.IUserGroupPut +## OUTPUTS + +### JumpCloud.SDK.V2.Models.IUserGroup +## NOTES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +BODY \: UserGroupPut +Name \: Display name of a User Group. +\[Attributes \\]: The graph attributes for a UserGroup. +\[(Any) \\]: This indicates any property can be added to this object. +\[SudoEnabled \\]: Enables sudo +\[SudoWithoutPassword \\]: Enable sudo without password (requires 'enabled' to be true) +\[LdapGroups \\>\]: +\[Name \\]: +\[PosixGroups \\>\]: +Id \: +Name \: +\[RadiusReply \\>\]: +Name \: +Value \: +\[SambaEnabled \\]: +\[Description \\]: Description of a User Group +\[Email \\]: Email address of a User Group +\[MemberQueryExemptions \\>\]: Array of GraphObjects exempted from the query +Id \: The ObjectID of the graph object. +Type \: The type of graph object. +\[Attributes \\]: The graph attributes. +\[(Any) \\]: This indicates any property can be added to this object. +\[MemberQueryFilters \\>\]: For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. +\[MemberQuerySearchFilters \\]: For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. +\[MemberQueryType \\]: +\[MemberSuggestionsNotify \\]: True if notification emails are to be sent for membership suggestions. +\[MembershipMethod \\]: The type of membership method for this group. +Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED. +Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \[group-associated MDM-enrolled devices\](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices). +Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + +INPUTOBJECT \: Identity Parameter +\[AccountId \\]: +\[ActivedirectoryId \\]: +\[AdministratorId \\]: +\[AgentId \\]: +\[AppleMdmId \\]: +\[ApplicationId \\]: ObjectID of the Application. +\[ApprovalFlowId \\]: +\[CommandId \\]: ObjectID of the Command. +\[CustomEmailType \\]: +\[DeviceId \\]: +\[GroupId \\]: ObjectID of the Policy Group. +\[GsuiteId \\]: ObjectID of the G Suite instance. +\[Id \\]: ObjectID of this Active Directory instance. +\[JobId \\]: +\[LdapserverId \\]: ObjectID of the LDAP Server. +\[Office365Id \\]: ObjectID of the Office 365 instance. +\[PolicyId \\]: ObjectID of the Policy. +\[ProviderId \\]: +\[PushEndpointId \\]: +\[RadiusserverId \\]: ObjectID of the Radius Server. +\[SoftwareAppId \\]: ObjectID of the Software App. +\[SystemId \\]: ObjectID of the System. +\[UserId \\]: ObjectID of the User. +\[WorkdayId \\]: + +MEMBERQUERYEXEMPTIONS \: Array of GraphObjects exempted from the query +Id \: The ObjectID of the graph object. +Type \: The type of graph object. +\[Attributes \\]: The graph attributes. +\[(Any) \\]: This indicates any property can be added to this object. + +## RELATED LINKS + +[https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkUserGroup.md](https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkUserGroup.md) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 1e867beab..136e62d60 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: 1/22/2026 +# Generated on: 5/12/2026 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '3.0.2' +ModuleVersion = '3.1.0' # Supported PSEditions # CompatiblePSEditions = @() @@ -51,8 +51,8 @@ PowerShellVersion = '4.0' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @('JumpCloud.SDK.DirectoryInsights', - 'JumpCloud.SDK.V1', +RequiredModules = @('JumpCloud.SDK.DirectoryInsights', + 'JumpCloud.SDK.V1', 'JumpCloud.SDK.V2') # Assemblies that must be loaded prior to importing this module @@ -71,42 +71,44 @@ RequiredModules = @('JumpCloud.SDK.DirectoryInsights', # 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' +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-JCSystemGroup', + 'Get-JCSystemGroupMember', 'Get-JCSystemInsights', 'Get-JCSystemKB', + 'Get-JCSystemUser', 'Get-JCUser', 'Get-JCUserGroup', + '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-JCPolicyGroupMember', + 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', + 'Set-JCSettingsFile', 'Set-JCSystem', 'Set-JCSystemUser', 'Set-JCUser', + 'Set-JCUserGroupLDAP', 'Update-JCDeviceFromCSV', 'Update-JCModule', + 'Update-JCMSPFromCSV', 'Update-JCUsersFromCSV', 'Set-JCUserGroup', + 'Set-JCSystemGroup', 'Set-JCPolicyGroup' # 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 = @() @@ -132,7 +134,7 @@ PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'JumpCloud', 'DaaS', 'Jump', 'Cloud', 'Directory' + Tags = 'JumpCloud','DaaS','Jump','Cloud','Directory' # A URL to the license for this module. LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE' @@ -157,7 +159,7 @@ PrivateData = @{ } # End of PSData hashtable -} # End of PrivateData hashtable + } # End of PrivateData hashtable # HelpInfo URI of this module HelpInfoURI = 'https://github.com/TheJumpCloud/support/wiki' diff --git a/PowerShell/JumpCloud Module/JumpCloud.psm1 b/PowerShell/JumpCloud Module/JumpCloud.psm1 index a70fc896c..52624b503 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psm1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psm1 @@ -19,11 +19,21 @@ if ($global:JCConfig['JCEnvironment'].Location) { switch ($env:JCEnvironment) { 'STANDARD' { $Global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = 'api' + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = 'api' $Global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = 'console' + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = 'console' } 'EU' { $Global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = 'api.eu' + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = 'api.eu' $Global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = 'console.eu' + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = 'console.eu' + } + 'STAGING' { + $Global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = 'api.stg01' + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = 'api.stg01' + $Global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = 'console.stg01' + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = 'console.stg01' } default {} } diff --git a/PowerShell/JumpCloud Module/Private/HashFunctions/Get-DynamicHash.ps1 b/PowerShell/JumpCloud Module/Private/HashFunctions/Get-DynamicHash.ps1 index 65cbdbf26..3b7f53e24 100644 --- a/PowerShell/JumpCloud Module/Private/HashFunctions/Get-DynamicHash.ps1 +++ b/PowerShell/JumpCloud Module/Private/HashFunctions/Get-DynamicHash.ps1 @@ -1,10 +1,10 @@ -Function Get-DynamicHash () { +function Get-DynamicHash () { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)][ValidateSet('System', 'User', 'Command', 'Group')][string]$Object, [Parameter(Position = 1, Mandatory = $true)][ValidateNotNullOrEmpty()][string[]]$returnProperties ) - DynamicParam { + dynamicparam { if ($Object -eq 'Group') { $paramDictionary = New-Object -Type System.Management.Automation.RuntimeDefinedParameterDictionary $paramAttributesCollect = New-Object -Type System.Collections.ObjectModel.Collection[System.Attribute] @@ -12,7 +12,7 @@ Function Get-DynamicHash () { $paramAttributes = New-Object -Type System.Management.Automation.ParameterAttribute $paramAttributes.Mandatory = $true $paramAttributesCollect.Add($paramAttributes) - $paramAttributesCollect.Add((New-Object -Type System.Management.Automation.ValidateSetAttribute('System', 'User'))) + $paramAttributesCollect.Add((New-Object -Type System.Management.Automation.ValidateSetAttribute('System', 'User', 'Policy'))) $dynParam1 = New-Object -Type System.Management.Automation.RuntimeDefinedParameter("GroupType", [string], $paramAttributesCollect) @@ -48,6 +48,9 @@ Function Get-DynamicHash () { User { $ResultsHash = Get-JCGroup -Type User | Select-Object -Property $returnProperties } + Policy { + $ResultsHash = Get-JCGroup -Type Policy | Select-Object -Property $returnProperties + } } } } diff --git a/PowerShell/JumpCloud Module/Private/Policies/Convert-RegToPSObject.ps1 b/PowerShell/JumpCloud Module/Private/Policies/Convert-RegToPSObject.ps1 index 88ccf81cc..20c983cb2 100644 --- a/PowerShell/JumpCloud Module/Private/Policies/Convert-RegToPSObject.ps1 +++ b/PowerShell/JumpCloud Module/Private/Policies/Convert-RegToPSObject.ps1 @@ -45,19 +45,24 @@ function Convert-RegToPSObject { $valueObject = $($line.Split("=")).Trim("`"") $valueName = $($valueObject[0]).Trim() if ($valueObject[1].StartsWith("dword:")) { - #DWORD + # DWORD: decimal string (matches JumpCloud console / avoids JSON number -> int64 on API) $customRegType = "DWORD" - $customData = [int]"0x$(($valueObject[1]).Substring(6))" + $dwordHex = ($valueObject[1]).Substring(6) + $customData = [string]([uint32]('0x' + $dwordHex)) } elseif ($valueObject[1].StartsWith("hex(b):")) { - #QWORD + # QWORD: decimal string; full 64-bit range via uint64 $customRegType = "QWORD" $value = ($valueObject[1]).Substring(7).split(",") # Convert to value $value = for ($i = $value.count - 1; $i -ge 0; $i--) { $value[$i] } - $hexValue = '0x' + ($value -join "").trimstart('0') - $customData = [int]$hexValue + $hexDigits = ($value -join "").TrimStart('0') + if ([string]::IsNullOrEmpty($hexDigits)) { + $hexDigits = '0' + } + $hexValue = '0x' + $hexDigits + $customData = [string]([uint64]$hexValue) } elseif ($valueObject[1].StartsWith("hex(7):")) { #MULTI_SZ $customRegType = "multiString" diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 9550f1d2b..620610443 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -32,7 +32,7 @@ function Connect-JCOnline () { 'ValueFromPipelineByPropertyName' = $true; 'ValidateNotNullOrEmpty' = $true; 'HelpMessage' = 'Enter the region for your JumpCloud organization; "EU" or "STANDARD".'; - 'ValidateSet' = ('STANDARD', 'staging', 'EU'); + 'ValidateSet' = ('STANDARD', 'STAGING', 'EU'); } # If the $env:JCApiKey is not set then make the JumpCloudApiKey mandatory else set the default value to be the env variable if ([System.String]::IsNullOrEmpty($env:JCApiKey)) { @@ -97,22 +97,34 @@ function Connect-JCOnline () { switch ($env:JCEnvironment) { 'STANDARD' { $global:JCUrlBasePath = "https://console.jumpcloud.com" + $Global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $Global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" $env:JCEnvironment = 'STANDARD' } - 'staging' { - $global:JCUrlBasePath = "https://console.awsstg.jumpcloud.com" + 'STAGING' { + $global:JCUrlBasePath = "https://console.stg01.jumpcloud.com" + $Global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.stg01" + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.stg01" + $Global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.stg01" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.stg01" + $env:JCEnvironment = 'STAGING' + } 'EU' { $global:JCUrlBasePath = "https://console.eu.jumpcloud.com" + $Global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" + $Global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" $env:JCEnvironment = 'EU' } default { $global:JCUrlBasePath = "https://console.jumpcloud.com" + $Global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $Global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" $env:JCEnvironment = 'STANDARD' } @@ -243,4 +255,4 @@ function Connect-JCOnline () { } end { } -} \ No newline at end of file +} diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index 8b9dde776..8065af37e 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -1,48 +1,12 @@ <# .Synopsis Query the API for Directory Insights events -#### Sample Request -``` -curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' -``` .Description Query the API for Directory Insights events -#### Sample Request -``` -curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' -``` -.Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:((Get-date).AddDays(-30)) - -Pull all event records from the last thirty days -.Example -PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddHours(-1)) -Limit:('10') - -Get directory results from the last hour limit to the last 10 results in the time range -.Example -PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Sort:("DESC") -EndTime:((Get-date).AddDays(-5)) - -Get directory results between 30 and 5 days ago, sort timestamp by descending value -.Example -PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Limit:('10') -searchTermAnd:@{"event_type" = "group_create"} - -Get only group_create from the last thirty days -.Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermOr @{"initiated_by.username" = @("user.1", "user.2")} - -Get login events initiated by either "user.1" or "user.2" between a universal time zone range -.Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"} - -Get all events between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com -.Example -PS C:\> Get-JCEvent -Service:('sso') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"initiated_by.username" = "user.1"} - -Get sso events with the search term initiated_by: username with value "user.1" -.Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "organization_update"} - -Get all events filtered by organization_update term between a date range +.Example +Get-JCEvent -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Limit:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Skip:() -Sort:() +.Example +Get-JCEvent -Body:() .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index 3a09c0a26..bc3563045 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -1,32 +1,12 @@ <# .Synopsis Query the API for a count of matching events -#### Sample Request -``` -curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events/count' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' -``` .Description Query the API for a count of matching events -#### Sample Request -``` -curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events/count' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' -``` -.Example -PS C:\> Get-JCEventCount -Service:('all') -StartTime:((Get-date).AddDays(-30)) - -Pull all event records from a specified time and count the results -.Example -PS C:\> Get-JCEventCount -Service:('sso') -StartTime:('2020-04-14T00:00:00Z') - -Pull all SSO event records from a specified time and count the results -.Example -PS C:\> Get-JCEventCount -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"} - -Get all events counts between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com -.Example -PS C:\> Get-JCEventCount -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -searchTermAnd:@{"event_type" = "group_create"} - -Get only group_create event counts the last thirty days +.Example +Get-JCEventCount -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Sort:() +.Example +Get-JCEventCount -Body:() .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery diff --git a/PowerShell/JumpCloud Module/Public/Groups/Get-JCGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/Get-JCGroup.ps1 index e9c98454c..0f502b860 100644 --- a/PowerShell/JumpCloud Module/Public/Groups/Get-JCGroup.ps1 +++ b/PowerShell/JumpCloud Module/Public/Groups/Get-JCGroup.ps1 @@ -1,16 +1,16 @@ -Function Get-JCGroup () { +function Get-JCGroup () { [CmdletBinding(DefaultParameterSetName = 'ReturnAll')] param ( - [Parameter(ParameterSetName = 'Type', Position = 0, HelpMessage = 'The type of JumpCloud group you want to return. Note there are only two options - User and System.')] - [ValidateSet('User', 'System')] + [Parameter(ParameterSetName = 'Type', Position = 0, HelpMessage = 'The type of JumpCloud group you want to return. Valid options are User, System, and Policy.')] + [ValidateSet('User', 'System', 'Policy')] [string]$Type ) - DynamicParam { - If ((Get-PSCallStack).Command -like '*MarkdownHelp') { + dynamicparam { + if ((Get-PSCallStack).Command -like '*MarkdownHelp') { $Type = 'User' } - If ($Type) { + if ($Type) { $attr = New-Object System.Management.Automation.ParameterAttribute $attr.HelpMessage = "Enter the group name" $attr.Mandatory = $false @@ -26,7 +26,7 @@ Function Get-JCGroup () { begin { Write-Debug 'Verifying JCAPI Key' if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JConline + Connect-JCOnline } [int]$limit = '100' @@ -38,12 +38,19 @@ Function Get-JCGroup () { $resultsArray = @() if ($param.IsSet) { - if ($Type -eq 'System') { - Write-Verbose 'Populating SystemGroupHash' - $SystemGroupHash = Get-DynamicHash -Object Group -GroupType System -returnProperties name - } elseif ($Type -eq 'User') { - Write-Verbose 'Populating UserGroupHash' - $UserGroupHash = Get-DynamicHash -Object Group -GroupType User -returnProperties name + switch ($Type) { + 'System' { + Write-Verbose 'Populating SystemGroupHash' + $SystemGroupHash = Get-DynamicHash -Object Group -GroupType System -returnProperties name + } + 'User' { + Write-Verbose 'Populating UserGroupHash' + $UserGroupHash = Get-DynamicHash -Object Group -GroupType User -returnProperties name + } + 'Policy' { + Write-Verbose 'Populating PolicyGroupHash' + $PolicyGroupHash = Get-DynamicHash -Object Group -GroupType Policy -returnProperties name + } } } } @@ -63,26 +70,22 @@ Function Get-JCGroup () { $count = ($resultsArray.results).Count Write-Debug "Results count equals $count" } elseif (($PSCmdlet.ParameterSetName -eq 'Type') -and !($param.IsSet)) { - if ($type -eq 'User') { - $limitURL = "$JCUrlBasePath/api/v2/groups?filter=type:eq:user_group" - if ($Parallel) { - $resultsArray = Get-JCResults -URL $limitURL -Method "GET" -limit $limit -parallel $true - } else { - $resultsArray = Get-JCResults -URL $limitURL -Method "GET" -limit $limit - } - $resultsArray = $resultsArray | Sort-Object name - } elseif ($type -eq 'System') { - $limitURL = "$JCUrlBasePath/api/v2/groups?filter=type:eq:system_group" - if ($Parallel) { - $resultsArray = Get-JCResults -URL $limitURL -Method "GET" -limit $limit -parallel $true - } else { - $resultsArray = Get-JCResults -URL $limitURL -Method "GET" -limit $limit - } - $resultsArray = $resultsArray | Sort-Object name + switch ($Type) { + 'User' { $limitURL = "$JCUrlBasePath/api/v2/usergroups" } + 'System' { $limitURL = "$JCUrlBasePath/api/v2/systemgroups" } + 'Policy' { $limitURL = "$JCUrlBasePath/api/v2/policygroups" } + default { $limitURL = "$JCUrlBasePath/api/v2/groups" } + } + + if ($Parallel) { + $resultsArray = Get-JCResults -URL $limitURL -Method "GET" -limit $limit -parallel $true + } else { + $resultsArray = Get-JCResults -URL $limitURL -Method "GET" -limit $limit } + $resultsArray = $resultsArray | Sort-Object name } elseif (($PSCmdlet.ParameterSetName -eq 'Type') -and ($param.IsSet)) { if ($Type -eq 'System') { - $GID = $SystemGroupHash.GetEnumerator().Where({ $_.Value.name -contains ($param.Value) }).Name + $GID = $SystemGroupHash.GetEnumerator().Where({ $_.Value.name -ceq ($param.Value) }).Name if ($GID) { $GURL = "$JCUrlBasePath/api/v2/systemgroups/$GID" $resultsArray = Get-JCResults -URL $GURL -Method "GET" -limit $limit @@ -90,13 +93,21 @@ Function Get-JCGroup () { Write-Error "There is no $Type group named $($param.Value). NOTE: Group names are case sensitive." } } elseif ($Type -eq 'User') { - $GID = $UserGroupHash.GetEnumerator().Where({ $_.Value.name -contains ($param.Value) }).Name + $GID = $UserGroupHash.GetEnumerator().Where({ $_.Value.name -ceq ($param.Value) }).Name if ($GID) { $GURL = "$JCUrlBasePath/api/v2/usergroups/$GID" $resultsArray = Get-JCResults -URL $GURL -Method "GET" -limit $limit } else { Write-Error "There is no $Type group named $($param.Value). NOTE: Group names are case sensitive." } + } elseif ($Type -eq 'Policy') { + $GID = $PolicyGroupHash.GetEnumerator().Where({ $_.Value.name -ceq ($param.Value) }).Name + if ($GID) { + $GURL = "$JCUrlBasePath/api/v2/policygroups/$GID" + $resultsArray = Get-JCResults -URL $GURL -Method "GET" -limit $limit + } else { + Write-Error "There is no $Type group named $($param.Value). NOTE: Group names are case sensitive." + } } } } diff --git a/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Get-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Get-JCPolicyGroup.ps1 new file mode 100644 index 000000000..3108e81a9 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Get-JCPolicyGroup.ps1 @@ -0,0 +1,139 @@ +<# +.Synopsis +This endpoint returns the details of a Policy Group. +.Description +This endpoint returns the details of a Policy Group. +.Example +PS C:\> Get-JCPolicyGroup -Fields:() -Filter:() -Sort:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +Name String +Type String + + +.Example +PS C:\> Get-JCPolicyGroup -Id:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +Name String +Type String + + + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Outputs +JumpCloud.SDK.V2.Models.IPolicyGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkPolicyGroup.md +#> +Function Get-JCPolicyGroup { + [OutputType([JumpCloud.SDK.V2.Models.IPolicyGroup])] + [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] + Param( + [Parameter(ParameterSetName='Get', Mandatory)] + + [Alias('_id', 'PolicyGroupID')] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the Policy Group. + ${Id}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # The comma separated fields included in the returned records. + # If omitted, the default list of fields will be returned. + ${Fields}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # A filter to apply to the query. + # + # **Filter structure**: `::`. + # + # **field** = Populate with a valid field from an endpoint response. + # + # **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. + # _Note: v1 operators differ from v2 operators._ + # + # **value** = Populate with the value you want to search for. + # Is case sensitive. + # Supports wild cards. + # + # **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + ${Filter}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # The comma separated fields used to sort the collection. + # Default sort is ascending, prefix with `-` to sort descending. + ${Sort} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Get-JcSdkPolicyGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Get-JCPolicyGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Get-JCPolicyGroupMember.ps1 new file mode 100644 index 000000000..de4a746a8 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Get-JCPolicyGroupMember.ps1 @@ -0,0 +1,156 @@ +<# +.Synopsis +This endpoint returns all the Policy Groups a Policy is a member of. +.Description +This endpoint returns all the Policy Groups a Policy is a member of. +.Example +PS C:\> Get-JCPolicyGroupMember -PolicyId:() -Filter:() -Sort:() -Authorization:() -Date:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +FromAttributes JumpCloud.SDK.V2.Models.GraphAttributes +FromId String +FromType String +ToAttributes JumpCloud.SDK.V2.Models.GraphAttributes +ToId String +ToType String + + +.Example +PS C:\> Get-JCPolicyGroupMember -GroupId:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +FromAttributes JumpCloud.SDK.V2.Models.GraphAttributes +FromId String +FromType String +ToAttributes JumpCloud.SDK.V2.Models.GraphAttributes +ToId String +ToType String + + + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Outputs +JumpCloud.SDK.V2.Models.IGraphConnection +.Outputs +JumpCloud.SDK.V2.Models.IGraphObjectWithPaths +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkPolicyGroupMember.md +#> +Function Get-JCPolicyGroupMember { + [OutputType([JumpCloud.SDK.V2.Models.IGraphObjectWithPaths], [JumpCloud.SDK.V2.Models.IGraphConnection])] + [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] + Param( + [Parameter(ParameterSetName='Get', Mandatory)] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the Policy. + ${PolicyId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='List', Mandatory)] + + [Alias('PolicyGroupID')] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the Policy Group. + ${GroupId}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # A filter to apply to the query. + # + # **Filter structure**: `::`. + # + # **field** = Populate with a valid field from an endpoint response. + # + # **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. + # _Note: v1 operators differ from v2 operators._ + # + # **value** = Populate with the value you want to search for. + # Is case sensitive. + # Supports wild cards. + # + # **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + ${Filter}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # The comma separated fields used to sort the collection. + # Default sort is ascending, prefix with `-` to sort descending. + ${Sort}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [JumpCloud.SDK.V2.Category('Header')] + [System.String] + # Authorization header for the System Context API + ${Authorization}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [JumpCloud.SDK.V2.Category('Header')] + [System.String] + # Current date header for the System Context API + ${Date} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Get-JcSdkPolicyGroupMember @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/New-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/New-JCPolicyGroup.ps1 new file mode 100644 index 000000000..ec27aa6e9 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/New-JCPolicyGroup.ps1 @@ -0,0 +1,75 @@ +<# +.Synopsis +This endpoint allows you to create a new Policy Group. +.Description +This endpoint allows you to create a new Policy Group. +.Example +PS C:\> New-JCPolicyGroup -Name:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +Name String +Type String + + +.Example +PS C:\> New-JCPolicyGroup -Body:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +Name String +Type String + + + +.Inputs +JumpCloud.SDK.V2.Models.IPolicyGroupData +.Outputs +JumpCloud.SDK.V2.Models.IPolicyGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : PolicyGroupData + Name : Display name of a Policy Group. +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/New-JcSdkPolicyGroup.md +#> +Function New-JCPolicyGroup { + [OutputType([JumpCloud.SDK.V2.Models.IPolicyGroup])] + [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='CreateExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Display name of a Policy Group. + ${Name}, + + [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Models.IPolicyGroupData] + # PolicyGroupData + ${Body} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\New-JcSdkPolicyGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Remove-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Remove-JCPolicyGroup.ps1 new file mode 100644 index 000000000..ef49058b9 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Remove-JCPolicyGroup.ps1 @@ -0,0 +1,96 @@ +<# +.Synopsis +This endpoint allows you to delete a Policy Group. +.Description +This endpoint allows you to delete a Policy Group. +.Example +PS C:\> Remove-JCPolicyGroup -Id:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +Name String +Type String + + +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Outputs +JumpCloud.SDK.V2.Models.IPolicyGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Remove-JcSdkPolicyGroup.md +#> +Function Remove-JCPolicyGroup { + [OutputType([JumpCloud.SDK.V2.Models.IPolicyGroup])] + [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='Delete', Mandatory)] + + [Alias('_id', 'PolicyGroupID')] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the Policy Group. + ${Id}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [JumpCloud.SDK.V2.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Remove-JcSdkPolicyGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Set-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Set-JCPolicyGroup.ps1 new file mode 100644 index 000000000..264358f83 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Set-JCPolicyGroup.ps1 @@ -0,0 +1,121 @@ +<# +.Synopsis +This endpoint allows you to do a full set of the Policy Group. +.Description +This endpoint allows you to do a full set of the Policy Group. +.Example +PS C:\> Set-JCPolicyGroup -Id:() -Body:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +Name String +Type String + + +.Example +PS C:\> Set-JCPolicyGroup -Id:() -Name:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +Name String +Type String + + + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Inputs +JumpCloud.SDK.V2.Models.IPolicyGroupData +.Outputs +JumpCloud.SDK.V2.Models.IPolicyGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : PolicyGroupData + Name : Display name of a Policy Group. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkPolicyGroup.md +#> +Function Set-JCPolicyGroup { + [OutputType([JumpCloud.SDK.V2.Models.IPolicyGroup])] + [CmdletBinding(DefaultParameterSetName='SetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='SetExpanded', Mandatory)] + [Parameter(ParameterSetName='Set', Mandatory)] + + [Alias('_id', 'PolicyGroupID')] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the Policy Group. + ${Id}, + + [Parameter(ParameterSetName='SetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Display name of a Policy Group. + ${Name}, + + [Parameter(ParameterSetName='Set', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Models.IPolicyGroupData] + # PolicyGroupData + ${Body} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Set-JcSdkPolicyGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Set-JCPolicyGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Set-JCPolicyGroupMember.ps1 new file mode 100644 index 000000000..0a9253f8e --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/PolicyGroups/Set-JCPolicyGroupMember.ps1 @@ -0,0 +1,125 @@ +<# +.Synopsis +This endpoint allows you to manage the Policy members of a Policy Group. +.Description +This endpoint allows you to manage the Policy members of a Policy Group. +.Example +PS C:\> Set-JCPolicyGroupMember -GroupId:() -Body:() + + +.Example +PS C:\> Set-JCPolicyGroupMember -GroupId:() -Id:() -Op:() -Attributes:() + + + +.Inputs +JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : GraphOperation (PolicyGroup-Member) + Id : The ObjectID of graph object being added or removed as an association. + Op : How to modify the graph connection. + [Attributes ]: The graph attributes. + [(Any) ]: This indicates any property can be added to this object. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkPolicyGroupMember.md +#> +Function Set-JCPolicyGroupMember { + [OutputType([System.Boolean])] + [CmdletBinding(DefaultParameterSetName='SetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='SetExpanded', Mandatory)] + [Parameter(ParameterSetName='Set', Mandatory)] + + [Alias('PolicyGroupID')] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the Policy Group. + ${GroupId}, + + [Parameter(ParameterSetName='SetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([JumpCloud.SDK.V2.Models.IGraphAttributes]))] + [System.Collections.Hashtable] + # The graph attributes. + ${Attributes}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # The ObjectID of graph object being added or removed as an association. + ${Id}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # How to modify the graph connection. + ${Op}, + + [Parameter(ParameterSetName='Set', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember] + # GraphOperation (PolicyGroup-Member) + ${Body}, + + [Parameter()] + [JumpCloud.SDK.V2.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Set-JcSdkPolicyGroupMember @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroup.ps1 new file mode 100644 index 000000000..9bcf4602f --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroup.ps1 @@ -0,0 +1,147 @@ +<# +.Synopsis +This endpoint returns the details of a System Group. +.Description +This endpoint returns the details of a System Group. +.Example +PS C:\> Get-JCSystemGroup -Fields:() -Filter:() -Sort:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + + +.Example +PS C:\> Get-JCSystemGroup -Id:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + + + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Outputs +JumpCloud.SDK.V2.Models.ISystemGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkSystemGroup.md +#> +Function Get-JCSystemGroup { + [OutputType([JumpCloud.SDK.V2.Models.ISystemGroup])] + [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] + Param( + [Parameter(ParameterSetName='Get', Mandatory)] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the System Group. + ${Id}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # The comma separated fields included in the returned records. + # If omitted, the default list of fields will be returned. + ${Fields}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # A filter to apply to the query. + # + # **Filter structure**: `::`. + # + # **field** = Populate with a valid field from an endpoint response. + # + # **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. + # _Note: v1 operators differ from v2 operators._ + # + # **value** = Populate with the value you want to search for. + # Is case sensitive. + # Supports wild cards. + # + # **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + ${Filter}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # The comma separated fields used to sort the collection. + # Default sort is ascending, prefix with `-` to sort descending. + ${Sort} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Get-JcSdkSystemGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Set-JCSystemGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Set-JCSystemGroup.ps1 new file mode 100644 index 000000000..16af5e093 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Set-JCSystemGroup.ps1 @@ -0,0 +1,219 @@ +<# +.Synopsis +This endpoint allows you to do a full set of the System Group. + +See the [Dynamic Group Configuration KB article](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. +.Description +This endpoint allows you to do a full set of the System Group. + +See the [Dynamic Group Configuration KB article](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. +.Example +PS C:\> Set-JCSystemGroup -Id:() -Body:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + + +.Example +PS C:\> Set-JCSystemGroup -Id:() -Name:() -Attributes:() -Description:() -Email:() -MemberQueryExemptions:() -MemberQueryFilters:() -MemberQueryType:() -MemberSuggestionsNotify:() -MembershipMethod:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GraphAttributes +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +Type String + + + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Inputs +JumpCloud.SDK.V2.Models.ISystemGroupPut +.Outputs +JumpCloud.SDK.V2.Models.ISystemGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : SystemGroupPut + Name : Display name of a System Group. + [Attributes ]: The graph attributes. + [(Any) ]: This indicates any property can be added to this object. + [Description ]: Description of a System Group + [Email ]: Email address of a System Group + [MemberQueryExemptions >]: Array of GraphObjects exempted from the query + Id : The ObjectID of the graph object. + Type : The type of graph object. + [Attributes ]: The graph attributes. + [MemberQueryFilters >]: For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + [MemberQuerySearchFilters ]: For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + [MemberQueryType ]: + [MemberSuggestionsNotify ]: True if notification emails are to be sent for membership suggestions. + [MembershipMethod ]: The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED. Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for [group-associated MDM-enrolled devices](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices). Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: + +MEMBERQUERYEXEMPTIONS : Array of GraphObjects exempted from the query + Id : The ObjectID of the graph object. + Type : The type of graph object. + [Attributes ]: The graph attributes. + [(Any) ]: This indicates any property can be added to this object. +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkSystemGroup.md +#> +Function Set-JCSystemGroup { + [OutputType([JumpCloud.SDK.V2.Models.ISystemGroup])] + [CmdletBinding(DefaultParameterSetName='SetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='SetExpanded', Mandatory)] + [Parameter(ParameterSetName='Set', Mandatory)] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the System Group. + ${Id}, + + [Parameter(ParameterSetName='SetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([JumpCloud.SDK.V2.Models.IGraphAttributes]))] + [System.Collections.Hashtable] + # The graph attributes. + ${Attributes}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Description of a System Group + ${Description}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Email address of a System Group + ${Email}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Models.IGraphObject[]] + # Array of GraphObjects exempted from the query + ${MemberQueryExemptions}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Body')] + [System.String[]] + # For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + ${MemberQueryFilters}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + ${MemberQuerySearchFilters}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # . + ${MemberQueryType}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.Management.Automation.SwitchParameter] + # True if notification emails are to be sent for membership suggestions. + ${MemberSuggestionsNotify}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # The type of membership method for this group. + # Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for [group-associated MDM-enrolled devices](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + ${MembershipMethod}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Display name of a System Group. + ${Name}, + + [Parameter(ParameterSetName='Set', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Models.ISystemGroupPut] + # SystemGroupPut + ${Body} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Set-JcSdkSystemGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroup.ps1 new file mode 100644 index 000000000..a3734a466 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroup.ps1 @@ -0,0 +1,153 @@ +<# +.Synopsis +This endpoint returns the details of a User Group. +.Description +This endpoint returns the details of a User Group. +.Example +PS C:\> Get-JCUserGroup -Fields:() -Filter:() -Sort:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + + +.Example +PS C:\> Get-JCUserGroup -Id:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + + + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Outputs +JumpCloud.SDK.V2.Models.IUserGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkUserGroup.md +#> +Function Get-JCUserGroup { + [OutputType([JumpCloud.SDK.V2.Models.IUserGroup])] + [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] + Param( + [Parameter(ParameterSetName='Get', Mandatory)] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the User Group. + ${Id}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # The comma separated fields included in the returned records. + # If omitted, the default list of fields will be returned. + ${Fields}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # A filter to apply to the query. + # + # **Filter structure**: `::`. + # + # **field** = Populate with a valid field from an endpoint response. + # + # **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. + # _Note: v1 operators differ from v2 operators._ + # + # **value** = Populate with the value you want to search for. + # Is case sensitive. + # Supports wild cards. + # + # **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + ${Filter}, + + [Parameter(ParameterSetName='List')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Query')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] + # The comma separated fields used to sort the collection. + # Default sort is ascending, prefix with `-` to sort descending. + ${Sort} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Get-JcSdkUserGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Set-JCUserGroup.ps1 b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Set-JCUserGroup.ps1 new file mode 100644 index 000000000..9fb27acff --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Set-JCUserGroup.ps1 @@ -0,0 +1,237 @@ +<# +.Synopsis +This endpoint allows you to do a full set of the User Group. + +See the [Dynamic Group Configuration KB article](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. +.Description +This endpoint allows you to do a full set of the User Group. + +See the [Dynamic Group Configuration KB article](https://jumpcloud.com/support/configure-dynamic-device-groups) for more details on maintaining a Dynamic Group. +.Example +PS C:\> Set-JCUserGroup -Id:() -Body:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + + +.Example +PS C:\> Set-JCUserGroup -Id:() -Name:() -Attributes:() -Description:() -Email:() -MemberQueryExemptions:() -MemberQueryFilters:() -MemberQueryType:() -MemberSuggestionsNotify:() -MembershipMethod:() + + + +---- ---------- +Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup +Description String +Email String +Id String +MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] +MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] +MemberQueryType String +MembershipMethod String +MemberSuggestionsNotify Boolean +Name String +SuggestionCountAdd Int +SuggestionCountRemove Int +SuggestionCountTotal Int +Type String + + + +.Inputs +JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity +.Inputs +JumpCloud.SDK.V2.Models.IUserGroupPut +.Outputs +JumpCloud.SDK.V2.Models.IUserGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BODY : UserGroupPut + Name : Display name of a User Group. + [Attributes ]: The graph attributes for a UserGroup. + [(Any) ]: This indicates any property can be added to this object. + [SudoEnabled ]: Enables sudo + [SudoWithoutPassword ]: Enable sudo without password (requires 'enabled' to be true) + [LdapGroups >]: + [Name ]: + [PosixGroups >]: + Id : + Name : + [RadiusReply >]: + Name : + Value : + [SambaEnabled ]: + [Description ]: Description of a User Group + [Email ]: Email address of a User Group + [MemberQueryExemptions >]: Array of GraphObjects exempted from the query + Id : The ObjectID of the graph object. + Type : The type of graph object. + [Attributes ]: The graph attributes. + [(Any) ]: This indicates any property can be added to this object. + [MemberQueryFilters >]: For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + [MemberQuerySearchFilters ]: For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + [MemberQueryType ]: + [MemberSuggestionsNotify ]: True if notification emails are to be sent for membership suggestions. + [MembershipMethod ]: The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED. Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for [group-associated MDM-enrolled devices](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices). Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + +INPUTOBJECT : Identity Parameter + [AccountId ]: + [ActivedirectoryId ]: + [AdministratorId ]: + [AgentId ]: + [AppleMdmId ]: + [ApplicationId ]: ObjectID of the Application. + [ApprovalFlowId ]: + [CommandId ]: ObjectID of the Command. + [CustomEmailType ]: + [DeviceId ]: + [GroupId ]: ObjectID of the Policy Group. + [GsuiteId ]: ObjectID of the G Suite instance. + [Id ]: ObjectID of this Active Directory instance. + [JobId ]: + [LdapserverId ]: ObjectID of the LDAP Server. + [Office365Id ]: ObjectID of the Office 365 instance. + [PolicyId ]: ObjectID of the Policy. + [ProviderId ]: + [PushEndpointId ]: + [RadiusserverId ]: ObjectID of the Radius Server. + [SoftwareAppId ]: ObjectID of the Software App. + [SystemId ]: ObjectID of the System. + [UserId ]: ObjectID of the User. + [WorkdayId ]: + +MEMBERQUERYEXEMPTIONS : Array of GraphObjects exempted from the query + Id : The ObjectID of the graph object. + Type : The type of graph object. + [Attributes ]: The graph attributes. + [(Any) ]: This indicates any property can be added to this object. +.Link +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkUserGroup.md +#> +Function Set-JCUserGroup { + [OutputType([JumpCloud.SDK.V2.Models.IUserGroup])] + [CmdletBinding(DefaultParameterSetName='SetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='SetExpanded', Mandatory)] + [Parameter(ParameterSetName='Set', Mandatory)] + [JumpCloud.SDK.V2.Category('Path')] + [System.String] + # ObjectID of the User Group. + ${Id}, + + [Parameter(ParameterSetName='SetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Path')] + [JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Runtime.Info(PossibleTypes=([JumpCloud.SDK.V2.Models.IGroupAttributesUserGroup]))] + [System.Collections.Hashtable] + # The graph attributes for a UserGroup. + ${Attributes}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Description of a User Group + ${Description}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Email address of a User Group + ${Email}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Models.IGraphObject[]] + # Array of GraphObjects exempted from the query + ${MemberQueryExemptions}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [AllowEmptyCollection()] + [JumpCloud.SDK.V2.Category('Body')] + [System.String[]] + # For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + ${MemberQueryFilters}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + ${MemberQuerySearchFilters}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # . + ${MemberQueryType}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.Management.Automation.SwitchParameter] + # True if notification emails are to be sent for membership suggestions. + ${MemberSuggestionsNotify}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # The type of membership method for this group. + # Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for [group-associated MDM-enrolled devices](https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + ${MembershipMethod}, + + [Parameter(ParameterSetName='SetExpanded')] + [Parameter(ParameterSetName='SetViaIdentityExpanded')] + [JumpCloud.SDK.V2.Category('Body')] + [System.String] + # Display name of a User Group. + ${Name}, + + [Parameter(ParameterSetName='Set', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SetViaIdentity', Mandatory, ValueFromPipeline)] + [JumpCloud.SDK.V2.Category('Body')] + [JumpCloud.SDK.V2.Models.IUserGroupPut] + # UserGroupPut + ${Body} + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.V2\Set-JcSdkUserGroup @PSBoundParameters + } + End { + Return $Results + } +} diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Get-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Get-JCPolicyGroup.ps1 deleted file mode 100644 index a481b6e71..000000000 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Get-JCPolicyGroup.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -Function Get-JCPolicyGroup { - [CmdletBinding(DefaultParameterSetName = 'ReturnAll')] - param ( - [Parameter( - ParameterSetName = 'ByName', - Mandatory = $true, - HelpMessage = 'The Name of the JumpCloud policy group you wish to query. This value is case sensitive')] - [System.String] - $Name, - [Parameter( - ParameterSetName = 'ById', - Mandatory = $true, - HelpMessage = 'The ID of the JumpCloud policy group you wish to query')] - [Alias('_id', 'id')] - [System.String] - $PolicyGroupID - ) - begin { - if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JCOnline - } - $URL = switch ($PSCmdlet.ParameterSetName) { - "ReturnAll" { - "$JCUrlBasePath/api/v2/policygroups" - $paginateRequired = $true - } - "ByName" { - # TODO: decide on search vs exact match - "$JCUrlBasePath/api/v2/policygroups?sort=name&filter=name%3Aeq%3A$Name" - $paginateRequired = $true - # "$JCUrlBasePath/api/v2/policygroups?sort=name&filter=type%3Aeq%3Apolicy_group%2Cname%3Asearch%3A$Name" - } - "ById" { - "$JCUrlBasePath/api/v2/policygroups/$PolicyGroupID" - $paginateRequired = $false - } - } - } - process { - $Result = Invoke-JCApi -Method:('GET') -Paginate:($paginateRequired) -Url:($URL) - } - end { - return $Result - } -} - diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Get-JCPolicyGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Get-JCPolicyGroupMember.ps1 deleted file mode 100644 index 3b20cd277..000000000 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Get-JCPolicyGroupMember.ps1 +++ /dev/null @@ -1,62 +0,0 @@ -Function Get-JCPolicyGroupMember { - [CmdletBinding()] - param ( - [Parameter( - ParameterSetName = 'ById', - Mandatory = $true, - HelpMessage = "The ID of the JumpCloud policy group to query and return members of" - )] - [Alias('_id', 'id')] - [System.String] - $PolicyGroupID, - [Parameter( - ParameterSetName = 'ByName', - Mandatory = $true, - HelpMessage = "The name of the JumpCloud policy group to query and return members of" - )] - [System.String] - $Name - ) - begin { - if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JCOnline - } - - $URL = switch ($PSCmdlet.ParameterSetName) { - "ByName" { - try { - $policyGroup = Get-JCPolicyGroup -Name $Name - if ($policyGroup) { - $PolicyGroupID = $policyGroup.Id - } else { - throw - } - } catch { - throw "Could not find policy group with name: $name" - } - "$JCUrlBasePath/api/v2/policygroups/$PolicyGroupID/membership" - } - "ById" { - "$JCUrlBasePath/api/v2/policygroups/$PolicyGroupID/membership" - } - } - } - process { - $response = Invoke-JCApi -Method:('GET') -Paginate:($true) -Url:($URL) - - If ('NoContent' -in $response.PSObject.Properties.Name) { - $policyMemberList = $null - } else { - $policyMemberList = New-Object System.Collections.ArrayList - foreach ($policy in $response) { - # return the values by getting the policy individually - $policyResult = Get-JCPolicy -PolicyID $policy.id - $policyMemberList.Add($policyResult) | Out-Null - } - } - - } - end { - return $policyMemberList - } -} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/New-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/New-JCPolicyGroup.ps1 deleted file mode 100644 index c33400038..000000000 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/New-JCPolicyGroup.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -Function New-JCPolicyGroup { - [CmdletBinding()] - param ( - [Parameter( - ParameterSetName = 'FromTemplateID', - Mandatory = $true, - HelpMessage = 'The Policy Template ID to apply to this MTP org. This parameter will only work in MTP organizations' - )] - [system.string] - $TemplateID, - [Parameter( - ParameterSetName = 'Name', - Mandatory = $true, - HelpMessage = 'The name of the policy group to create' - )] - [system.string] - $Name, - [Parameter( - ParameterSetName = 'Name', - Mandatory = $false, - HelpMessage = 'The description of the policy group to create' - )] - [system.string] - $Description - ) - begin { - if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JCOnline - } - - switch ($PSCmdlet.ParameterSetName) { - "FromTemplateID" { - $URL = "$JCUrlBasePath/api/v2/organizations/$env:JCOrgId/policygroups/fromtemplate" - $BODY = @{ - templateId = $TemplateID - } | ConvertTo-Json - } - "Name" { - $URL = "$JCUrlBasePath/api/v2/policygroups" - $BODY = @{ - name = "$Name" - description = "$Description" - } | ConvertTo-Json - } - - } - } - process { - # TODO: CUT-4439 eventually Invoke-JCAPI should have a dynamic list of policy endpoints that do not accept ORGIDs in the headers. - $response = Invoke-JCApi -URL:("$URL") -Method:("POST") -Body:($BODY) - } - end { - return $response - } -} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.ps1 deleted file mode 100644 index 04aeb3152..000000000 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.ps1 +++ /dev/null @@ -1,79 +0,0 @@ -function Remove-JCPolicyGroup { - [CmdletBinding()] - param ( - [Parameter( - ParameterSetName = 'ByName', - Mandatory = $true, - HelpMessage = 'The Name of the JumpCloud policy group you wish to remove.')] - [System.String] - $Name, - [Parameter( - ParameterSetName = 'ByID', - ValueFromPipelineByPropertyName, - Mandatory = $true, - HelpMessage = 'The ID of the JumpCloud policy group you wish to remove.')] - [Alias('_id', 'id')] - [System.String] - $PolicyGroupID, - [Parameter(HelpMessage = 'A SwitchParameter which suppresses the warning message when removing a JumpCloud policy group.')] - [Switch] - $Force - ) - begin { - Write-Debug 'Verifying JCAPI Key' - if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JCOnline - } - - switch ($PSCmdlet.ParameterSetName) { - 'ByName' { - try { - $foundPolicy = Get-JCPolicyGroup -Name $Name - $PolicyGroupID = $foundPolicy.ID - - } catch { - $PolicyGroupID = $null - } - if ($foundPolicy) { - } - } - 'ByID' { - try { - $foundPolicy = Get-JCPolicyGroup -PolicyGroupID $PolicyGroupID - $PolicyGroupID = $foundPolicy.ID - - } catch { - $PolicyGroupID = $null - } - } - } - } - process { - if (-not [System.String]::IsNullOrEmpty($PolicyGroupID)) { - $URL = "$global:JCUrlBasePath/api/v2/policygroups/$PolicyGroupID" - if (-not $Force) { - Write-Warning "Are you sure you wish to delete policy group: `'$($foundPolicy.Name)`'?" -WarningAction Inquire - } - try { - $Result = Invoke-JCApi -Method:('DELETE') -Url:($URL) - $Status = "Deleted" - } catch { - $Status = $_.ErrorDetails - } - # set the return response: - $FormattedResults = [PSCustomObject]@{ - 'Name' = $foundPolicy.name - 'Result' = $Status - } - } else { - $FormattedResults = [PSCustomObject]@{ - 'Name' = "Not Found" - 'Result' = $null - } - } - } - end { - return $FormattedResults - } -} - diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1 deleted file mode 100644 index 1ad199ab7..000000000 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -function Set-JCPolicyGroup { - [CmdletBinding()] - param ( - [Parameter( - ParameterSetName = 'ByName', - ValueFromPipelineByPropertyName, - Mandatory = $true, - HelpMessage = 'The Name of the JumpCloud policy group you wish to set.')] - [System.String]$Name, - [Parameter( - ParameterSetName = 'ByID', - ValueFromPipelineByPropertyName, - Mandatory = $true, - HelpMessage = 'The Id of the JumpCloud policy group you wish to set.')] - [Alias('_id', 'id')] - [System.String]$PolicyGroupID, - [Parameter(Mandatory = $false, - HelpMessage = 'The new name to set on the existing JumpCloud policy group. If left unspecified, the cmdlet will not rename the existing policy group.')] - [System.String] - $NewName, - [Parameter( - ValueFromPipelineByPropertyName, - Mandatory = $false, - HelpMessage = 'The Description of the JumpCloud policy group you wish to set.')] - [System.String]$Description - ) - begin { - if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JCOnline - } - if ($PSBoundParameters["PolicyGroupID"]) { - # Get the policy by ID - $foundPolicyGroup = Get-JCPolicyGroup -PolicyGroupID $PolicyGroupID - if ([string]::IsNullOrEmpty($foundPolicyGroup.ID)) { - throw "Could not find policy group by ID" - } - - } elseif ($PSBoundParameters["Name"]) { - # Get the policy by Name - $foundPolicyGroup = Get-JCPolicyGroup -Name $Name - if ([string]::IsNullOrEmpty($foundPolicyGroup.ID)) { - throw "Could not find policy group by specified Name" - } - } - } - process { - # First set the name from PSParamSet if set; else set from policy - $NameFromProcess = if ($PSBoundParameters["NewName"]) { - $NewName - } else { - $foundPolicyGroup.name - } - $DescriptionFromProcess = if ($PSBoundParameters["Description"]) { - $Description - } else { - $foundPolicyGroup.Description - } - - $URL = "$global:JCUrlBasePath/api/v2/policygroups/$($foundPolicyGroup.id)" - $BODY = @{ - name = "$NameFromProcess" - description = "$DescriptionFromProcess" - } | ConvertTo-Json - $Result = Invoke-JCApi -Method:('PUT') -Url:($URL) -Body:($BODY) - } - end { - return $Result - } -} - diff --git a/PowerShell/JumpCloud Module/Tests/Private/Policies/Convert-RegToPSObject.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Private/Policies/Convert-RegToPSObject.Tests.ps1 index e9441b8bd..2fdfeb749 100644 --- a/PowerShell/JumpCloud Module/Tests/Private/Policies/Convert-RegToPSObject.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Private/Policies/Convert-RegToPSObject.Tests.ps1 @@ -17,11 +17,13 @@ Describe -Tag:('JCPolicy') 'Registry File Tests' { switch ($regKey.customRegType) { DWORD { $regKey.customValueName | Should -Be "DWORDValue" - $regKey.customData | Should -Be 0 + $regKey.customData | Should -BeOfType [string] + $regKey.customData | Should -Be '0' } QWORD { $regKey.customValueName | Should -Be "QWORDValue" - $regKey.customData | Should -Be 16 + $regKey.customData | Should -BeOfType [string] + $regKey.customData | Should -Be '16' } multiString { $regKey.customValueName | Should -Be "MULTISZValue" diff --git a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 index 0c5801bba..64bd8054d 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 @@ -15,42 +15,43 @@ Describe -Tag:('JCOnline') 'Connect-JCOnline Tests' { $env:JCEnvironment | Should -Be 'EU' - $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org.OrgID) -JCEnvironment 'STANDARD' -force + $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org) -JCEnvironment 'STANDARD' -force $PesterParams_ApiKey | Should -Be $env:JCApiKey - $PesterParams_Org.OrgID | Should -Be $env:JCOrgId + $PesterParams_Org | Should -Be $env:JCOrgId } } Context 'Single Org Tests' { It ('Should connect using the JumpCloudApiKey and JumpCloudOrgId parameters.') { - $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org.OrgID) -force + $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org) -force $PesterParams_ApiKey | Should -Be $env:JCApiKey - $PesterParams_Org.OrgID | Should -Be $env:JCOrgId + $PesterParams_Org | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID } It ('Should connect using the JumpCloudApiKey parameter.') { $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -force $PesterParams_ApiKey | Should -Be $env:JCApiKey - $PesterParams_Org.OrgID | Should -Be $env:JCOrgId + $PesterParams_Org | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID } It ('Should connect using the JumpCloudOrgId parameter.') { $Connect = Connect-JCOnline -JumpCloudOrgId:($PesterParams_ApiKey) -force $PesterParams_ApiKey | Should -Be $env:JCApiKey - $PesterParams_Org.OrgID | Should -Be $env:JCOrgId + $PesterParams_Org | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID } It('Should connect without parameters using the previously set env:jc* parameters.') { $Connect = Connect-JCOnline -force $PesterParams_ApiKey | Should -Be $env:JCApiKey - $PesterParams_Org.OrgID | Should -Be $env:JCOrgId + $PesterParams_Org | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $env:JCOrgId # $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID } } - Context 'ProviderID Tests for non-MTP Orgs' { + Context 'ProviderID Tests for non-MTP Orgs' -Skip { + # Connect-JCOnline doesn't nullify the ProviderID when connecting to a non-MTP org (#TODO: Fix this) It ('Should not have a ProviderID set') { $Connect = Connect-JCOnline -JumpCloudOrgId:($PesterParams_ApiKey) -force $env:JCProviderId | Should -BeNullOrEmpty diff --git a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Set-JCOrganization.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Set-JCOrganization.Tests.ps1 index 1639be61f..020cb9d40 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Set-JCOrganization.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Set-JCOrganization.Tests.ps1 @@ -2,37 +2,37 @@ Describe -Tag:('JCOrganization') 'Set-JCOrganization Tests' { BeforeAll { # Prevent the Update-JCModule from running $env:JcUpdateModule = $false - $StartingApiKey = If (-not [System.String]::IsNullOrEmpty($env:JCApiKey)) { + $StartingApiKey = if (-not [System.String]::IsNullOrEmpty($env:JCApiKey)) { $env:JCApiKey } - $StartingOrgId = If (-not [System.String]::IsNullOrEmpty($env:JCOrgId)) { + $StartingOrgId = if (-not [System.String]::IsNullOrEmpty($env:JCOrgId)) { $env:JCOrgId } } Context 'Single Org Tests' { It ('Should connect using the JumpCloudApiKey and JumpCloudOrgId parameters.') { - $Connect = Set-JCOrganization -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org.OrgID) + $Connect = Set-JCOrganization -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org) $PesterParams_ApiKey | Should -Be $env:JCApiKey $Connect.JCOrgId | Should -Be $env:JCOrgId - $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID + $Connect.JCOrgId | Should -Be $PesterParams_Org } It ('Should connect using the JumpCloudApiKey parameter.') { $Connect = Set-JCOrganization -JumpCloudApiKey:($PesterParams_ApiKey) $PesterParams_ApiKey | Should -Be $env:JCApiKey $Connect.JCOrgId | Should -Be $env:JCOrgId - $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID + $Connect.JCOrgId | Should -Be $PesterParams_Org } It ('Should connect using the JumpCloudOrgId parameter.') { $Connect = Set-JCOrganization -JumpCloudOrgId:($PesterParams_ApiKey) $PesterParams_ApiKey | Should -Be $env:JCApiKey $Connect.JCOrgId | Should -Be $env:JCOrgId - $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID + $Connect.JCOrgId | Should -Be $PesterParams_Org } It('Should connect without parameters using the previously set env:jc* parameters.') { $Connect = Set-JCOrganization $PesterParams_ApiKey | Should -Be $env:JCApiKey $Connect.JCOrgId | Should -Be $env:JCOrgId - $Connect.JCOrgId | Should -Be $PesterParams_Org.OrgID + $Connect.JCOrgId | Should -Be $PesterParams_Org } } } diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/Get-JCGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/Get-JCGroup.Tests.ps1 index c479e81e6..98d7f7f51 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Groups/Get-JCGroup.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/Get-JCGroup.Tests.ps1 @@ -22,6 +22,25 @@ Describe -Tag:('JCGroup') 'Get-JCGroup 1.0' { } + It 'Gets all JumpCloud Policy Groups' { + + $policyGroupName = "PesterPolicyGroup-$([guid]::NewGuid().ToString('N').Substring(0, 8))" + $newPolicyGroup = New-JCPolicyGroup -Name $policyGroupName + + try { + $PolicyGroups = Get-JCGroup -Type Policy + $PolicyGroups | Should -Not -BeNullOrEmpty + $PolicyGroups.name | Should -Contain $policyGroupName + $OneGroup = $PolicyGroups.type | Select-Object -Unique | Measure-Object + $OneGroup.Count | Should -Be 1 + } finally { + if ($newPolicyGroup) { + Remove-JCPolicyGroup -Id $newPolicyGroup.id | Out-Null + } + } + + } + } Describe -Tag:('JCGroup') 'Get-JCGroup 1.1.0' { diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Get-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Get-JCPolicyGroup.Tests.ps1 new file mode 100644 index 000000000..df0a25d79 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Get-JCPolicyGroup.Tests.ps1 @@ -0,0 +1,32 @@ +Describe -Tag:('JCPolicyGroup') 'Get-JCPolicyGroup' { + BeforeAll { + $TestGroupName = "SdkTestPolicyGroup-$(Get-Random)" + $TestGroup = New-JCPolicyGroup -Name $TestGroupName + } + AfterAll { + if ($TestGroup -and $TestGroup.id) { + Remove-JCPolicyGroup -Id $TestGroup.id + } + } + It 'Get returns all policy groups' { + $groups = Get-JCPolicyGroup + $groups | Should -Not -BeNullOrEmpty + $groups.name | Should -Contain $TestGroupName + } + It 'Get by ID returns single group' { + $group = Get-JCPolicyGroup -Id $TestGroup.id + $group | Should -Not -BeNullOrEmpty + $group.name | Should -Be $TestGroupName + } + It 'Get by name returns expected result' { + $filtered = Get-JCPolicyGroup -Filter "name:eq:$TestGroupName" + $filtered | Should -Not -BeNullOrEmpty + $filtered.name | Should -Be $TestGroupName + } + It 'Get by non-existent name returns nothing or error' { + $nonExistentName = "DefinitelyNotARealGroupName-$(Get-Random)" + $result = Get-JCPolicyGroup -Filter "name:eq:$nonExistentName" + $isEmpty = ($null -eq $result -or ($result.PSObject.Properties.Name -inotcontains 'name' -and $result.PSObject.Properties.Name -inotcontains 'id' -and $result.PSObject.Properties.Name -inotcontains 'Id')) + $isEmpty | Should -BeTrue + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Get-JCPolicyGroupMember.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Get-JCPolicyGroupMember.Tests.ps1 new file mode 100644 index 000000000..f792ef583 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Get-JCPolicyGroupMember.Tests.ps1 @@ -0,0 +1,37 @@ +Describe -Tag:('JcPolicyGroupMember') 'Get-JCPolicyGroupMember and Set-JCPolicyGroupMember' { + BeforeAll { + $TestGroupName = "SdkTestPolicyGroupMember-$(Get-Random)" + $TestGroup = New-JCPolicyGroup -Name $TestGroupName + $policyTemplates = Get-JcSdkPolicyTemplate + $usbTemplateLinux = $policyTemplates | Where-Object { $_.name -eq "disable_usb_storage_linux" } + $TestPolicy = New-JCPolicy -TemplateID $usbTemplateLinux.Id -Name "Pester-USB-Linux-$(Get-Random)" -disable_mtp $true -disable_afc $false -disable_mmc $false -Notes "usb" + } + AfterAll { + if ($TestPolicy) { Remove-JCPolicy -PolicyID $TestPolicy.Id -force | Out-Null } + if ($TestGroup) { Remove-JCPolicyGroup -id $TestGroup.id | Out-Null } + } + It 'Returns null when there are no members of the policy group' { + $members = Get-JCPolicyGroupMember -GroupId $TestGroup.id + $members | Should -BeNullOrEmpty + } + It 'Adds a policy to the group and Get-JCPolicyGroupMember returns it' { + Set-JCPolicyGroupMember -GroupId $TestGroup.id -Op "add" -Id $TestPolicy.id | Out-Null + $members = Get-JCPolicyGroupMember -GroupId $TestGroup.id + $members | Should -Not -BeNullOrEmpty + $TestPolicy.id | Should -BeIn $members.toId + } + It 'Removes a policy from the group and Get-JCPolicyGroupMember returns empty' { + Set-JCPolicyGroupMember -GroupId $TestGroup.id -Op "remove" -Id $TestPolicy.id | Out-Null + $members = Get-JCPolicyGroupMember -GroupId $TestGroup.id + $members | Should -BeNullOrEmpty + } + It 'Returns groups for a policy using -PolicyId' { + # Add policy to group + Set-JCPolicyGroupMember -GroupId $TestGroup.id -Op "add" -Id $TestPolicy.id | Out-Null + $groups = Get-JCPolicyGroupMember -PolicyId $TestPolicy.id + $groups | Should -Not -BeNullOrEmpty + $TestGroup.id | Should -BeIn $groups.id + # Remove policy from group for cleanup + Set-JCPolicyGroupMember -GroupId $TestGroup.id -Op "remove" -Id $TestPolicy.id | Out-Null + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/New-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/New-JCPolicyGroup.Tests.ps1 new file mode 100644 index 000000000..a11474409 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/New-JCPolicyGroup.Tests.ps1 @@ -0,0 +1,24 @@ +Describe -Tag:('JCPolicyGroup') 'New-JCPolicyGroup' { + BeforeAll { + $existing = Get-JCPolicyGroup -Filter "name:eq:SdkTestPolicyGroup-ForCreate" + if ($existing) { + $existing | ForEach-Object { Remove-JCPolicyGroup -Id $_.id } + } + } + AfterAll { + $created = Get-JCPolicyGroup -Filter "name:search:SdkTestPolicyGroup-ForCreate" + if ($created) { + $created | ForEach-Object { Remove-JCPolicyGroup -Id $_.id } + } + } + It 'Creating a new policy group does not throw' { + { $TestGroup = New-JCPolicyGroup -Name "SdkTestPolicyGroup-ForCreate" } | Should -Not -Throw + } + It 'Creating a new policy group returns the ID and name of the group' { + $uniqueName = "SdkTestPolicyGroup-ForCreate-$(Get-Random)" + $TestGroup = New-JCPolicyGroup -Name $uniqueName + $TestGroup | Should -Not -BeNullOrEmpty + $TestGroup.id | Should -Not -BeNullOrEmpty + Remove-JCPolicyGroup -id $TestGroup.id | Out-Null + } +} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Remove-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Remove-JCPolicyGroup.Tests.ps1 new file mode 100644 index 000000000..4ff973112 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Remove-JCPolicyGroup.Tests.ps1 @@ -0,0 +1,7 @@ +Describe -Tag:('JcPolicyGroup') 'Remove-JCPolicyGroup' { + It 'Removes a policy group by ID does not throw' { + $uniqueName = "SdkTestPolicyGroup-ForRemove-$(Get-Random)" + $TestGroup = New-JCPolicyGroup -Name $uniqueName + { Remove-JCPolicyGroup -ID $TestGroup.id } | Should -Not -Throw + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Set-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Set-JCPolicyGroup.Tests.ps1 new file mode 100644 index 000000000..abea18628 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Set-JCPolicyGroup.Tests.ps1 @@ -0,0 +1,22 @@ +Describe -Tag:('JcPolicyGroup') 'Set-JCPolicyGroup' { + It 'Creates a policy group, updates the display name with Set-JCPolicyGroup, verifies via Get-JCPolicyGroup, then removes the group' { + $suffix = [guid]::NewGuid().ToString('N').Substring(0, 12) + $initialName = "Pester-SetPolicyGroup-$suffix" + $renamed = "Pester-SetPolicyGroup-Renamed-$suffix" + + $created = New-JCPolicyGroup -Name $initialName + $created | Should -Not -BeNullOrEmpty + $created.id | Should -Not -BeNullOrEmpty + + try { + $updated = Set-JCPolicyGroup -Id $created.id -Name $renamed + $updated | Should -Not -BeNullOrEmpty + + $fetched = Get-JCPolicyGroup -Id $created.id + $fetched | Should -Not -BeNullOrEmpty + $fetched.Name | Should -Be $renamed + } finally { + Remove-JCPolicyGroup -Id $created.id + } + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Set-JCPolicyGroupMember.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Set-JCPolicyGroupMember.Tests.ps1 new file mode 100644 index 000000000..3e5c71d1d --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/PolicyGroups/Set-JCPolicyGroupMember.Tests.ps1 @@ -0,0 +1,37 @@ +Describe -Tag:('JcPolicyGroupMember') 'Set-JCPolicyGroupMember' { + BeforeAll { + $script:GroupName = "Pester-SetPolGrpMbr-$(Get-Random)" + $script:PolicyGroup = New-JCPolicyGroup -Name $script:GroupName + $policyTemplates = Get-JcSdkPolicyTemplate + $usbTemplateLinux = $policyTemplates | Where-Object { $_.name -eq 'disable_usb_storage_linux' } + $script:TestPolicy = New-JCPolicy -TemplateID $usbTemplateLinux.Id -Name "Pester-SetPolGrpMbr-USB-$(Get-Random)" -disable_mtp $true -disable_afc $false -disable_mmc $false -Notes 'Set-JCPolicyGroupMember test' + } + AfterAll { + if ($script:TestPolicy) { + Remove-JCPolicy -PolicyID $script:TestPolicy.Id -force | Out-Null + } + if ($script:PolicyGroup -and $script:PolicyGroup.id) { + Remove-JCPolicyGroup -Id $script:PolicyGroup.id | Out-Null + } + } + It 'Set-JCPolicyGroupMember add places the policy in the group (validated with Get-JCPolicyGroupMember)' { + Set-JCPolicyGroupMember -GroupId $script:PolicyGroup.id -Op 'add' -Id $script:TestPolicy.id | Out-Null + $members = Get-JCPolicyGroupMember -GroupId $script:PolicyGroup.id + $members | Should -Not -BeNullOrEmpty + $script:TestPolicy.id | Should -BeIn $members.toId + } + It 'Set-JCPolicyGroupMember remove clears the policy from the group' { + Set-JCPolicyGroupMember -GroupId $script:PolicyGroup.id -Op 'remove' -Id $script:TestPolicy.id | Out-Null + $members = Get-JCPolicyGroupMember -GroupId $script:PolicyGroup.id + $members | Should -BeNullOrEmpty + } + It 'Set-JCPolicyGroupMember add/remove round-trip keeps group membership consistent' { + Set-JCPolicyGroupMember -GroupId $script:PolicyGroup.id -Op 'add' -Id $script:TestPolicy.id | Out-Null + $afterAdd = Get-JCPolicyGroupMember -GroupId $script:PolicyGroup.id + $afterAdd | Should -Not -BeNullOrEmpty + + Set-JCPolicyGroupMember -GroupId $script:PolicyGroup.id -Op 'remove' -Id $script:TestPolicy.id | Out-Null + $afterRemove = Get-JCPolicyGroupMember -GroupId $script:PolicyGroup.id + $afterRemove | Should -BeNullOrEmpty + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Get-JCSystemGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Get-JCSystemGroup.Tests.ps1 new file mode 100644 index 000000000..24890b5d9 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Get-JCSystemGroup.Tests.ps1 @@ -0,0 +1,29 @@ +Describe -Tag:('JcSystemGroup') 'Get-JCSystemGroup' { + BeforeAll { + $TestGroupName = "SdkTestSystemGroup-$(Get-Random)" + $TestGroup = New-JCSystemGroup -GroupName $TestGroupName + } + AfterAll { + Remove-JCSystemGroup -GroupName $TestGroupName -Force + } + It 'Get returns all system groups' { + $groups = Get-JCSystemGroup + $groups | Should -Not -BeNullOrEmpty + $groups.Name | Should -Contain $TestGroupName + } + It 'Get by ID returns single group' { + $group = Get-JCSystemGroup -Id $TestGroup.id + $group | Should -Not -BeNullOrEmpty + $group.Name | Should -Be $TestGroupName + } + It 'Get by name returns expected result' { + $filtered = Get-JCSystemGroup -Filter "name:eq:$TestGroupName" + $filtered | Should -Not -BeNullOrEmpty + $filtered.Name | Should -Be $TestGroupName + } + It 'Get by non-existent name returns nothing or error' { + $nonExistentName = "DefinitelyNotARealGroupName-$(Get-Random)" + $result = Get-JCSystemGroup -Filter "name:eq:$nonExistentName" + $result | Should -BeNullOrEmpty + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Get-JcSystemGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Get-JcSystemGroup.Tests.ps1 new file mode 100644 index 000000000..24890b5d9 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Get-JcSystemGroup.Tests.ps1 @@ -0,0 +1,29 @@ +Describe -Tag:('JcSystemGroup') 'Get-JCSystemGroup' { + BeforeAll { + $TestGroupName = "SdkTestSystemGroup-$(Get-Random)" + $TestGroup = New-JCSystemGroup -GroupName $TestGroupName + } + AfterAll { + Remove-JCSystemGroup -GroupName $TestGroupName -Force + } + It 'Get returns all system groups' { + $groups = Get-JCSystemGroup + $groups | Should -Not -BeNullOrEmpty + $groups.Name | Should -Contain $TestGroupName + } + It 'Get by ID returns single group' { + $group = Get-JCSystemGroup -Id $TestGroup.id + $group | Should -Not -BeNullOrEmpty + $group.Name | Should -Be $TestGroupName + } + It 'Get by name returns expected result' { + $filtered = Get-JCSystemGroup -Filter "name:eq:$TestGroupName" + $filtered | Should -Not -BeNullOrEmpty + $filtered.Name | Should -Be $TestGroupName + } + It 'Get by non-existent name returns nothing or error' { + $nonExistentName = "DefinitelyNotARealGroupName-$(Get-Random)" + $result = Get-JCSystemGroup -Filter "name:eq:$nonExistentName" + $result | Should -BeNullOrEmpty + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Set-JCSystemGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Set-JCSystemGroup.Tests.ps1 new file mode 100644 index 000000000..6cb13775b --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/SystemGroups/Set-JCSystemGroup.Tests.ps1 @@ -0,0 +1,24 @@ +Describe -Tag:('JcSystemGroup') 'Set-JCSystemGroup' { + It 'Creates a system group, updates name and description with Set-JCSystemGroup, verifies via Get-JCSystemGroup, then removes the group' { + $suffix = [guid]::NewGuid().ToString('N').Substring(0, 8) + $initialName = "Pester-SetSysGrp-$suffix" + $newName = "Pester-SetSysGrp-Renamed-$suffix" + $newDescription = "Pester Set-JCSystemGroup $suffix" + + $created = New-JCSystemGroup -GroupName $initialName + $created.Result | Should -Be 'Created' + $groupId = $created.id + $groupId | Should -Not -BeNullOrEmpty + + try { + $null = Set-JCSystemGroup -Id $groupId -Name $newName -Description $newDescription + + $fetched = Get-JCSystemGroup -Id $groupId + $fetched | Should -Not -BeNullOrEmpty + $fetched.Name | Should -Be $newName + $fetched.Description | Should -Be $newDescription + } finally { + Remove-JCSystemGroup -GroupID $groupId -Force + } + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Get-JCUserGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Get-JCUserGroup.Tests.ps1 new file mode 100644 index 000000000..f8e26c777 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Get-JCUserGroup.Tests.ps1 @@ -0,0 +1,29 @@ +Describe -Tag:('JcUserGroup') 'Get-JCUserGroup' { + BeforeAll { + $TestGroupName = "SdkTestUserGroup-$(Get-Random)" + $TestGroup = New-JCUserGroup -GroupName $TestGroupName + } + AfterAll { + Remove-JCUserGroup -GroupName $TestGroupName -Force + } + It 'Get returns all user groups' { + $groups = Get-JCUserGroup + $groups | Should -Not -BeNullOrEmpty + $groups.Name | Should -Contain $TestGroupName + } + It 'Get by ID returns single group' { + $group = Get-JCUserGroup -Id $TestGroup.id + $group | Should -Not -BeNullOrEmpty + $group.Name | Should -Be $TestGroupName + } + It 'Get by name returns expected result' { + $filtered = Get-JCUserGroup -Filter "name:eq:$TestGroupName" + $filtered | Should -Not -BeNullOrEmpty + $filtered.Name | Should -Be $TestGroupName + } + It 'Get by non-existent name returns nothing or error' { + $nonExistentName = "DefinitelyNotARealGroupName-$(Get-Random)" + $result = Get-JCUserGroup -Filter "name:eq:$nonExistentName" + $result | Should -BeNullOrEmpty + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Get-JcUserGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Get-JcUserGroup.Tests.ps1 new file mode 100644 index 000000000..f8e26c777 --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Get-JcUserGroup.Tests.ps1 @@ -0,0 +1,29 @@ +Describe -Tag:('JcUserGroup') 'Get-JCUserGroup' { + BeforeAll { + $TestGroupName = "SdkTestUserGroup-$(Get-Random)" + $TestGroup = New-JCUserGroup -GroupName $TestGroupName + } + AfterAll { + Remove-JCUserGroup -GroupName $TestGroupName -Force + } + It 'Get returns all user groups' { + $groups = Get-JCUserGroup + $groups | Should -Not -BeNullOrEmpty + $groups.Name | Should -Contain $TestGroupName + } + It 'Get by ID returns single group' { + $group = Get-JCUserGroup -Id $TestGroup.id + $group | Should -Not -BeNullOrEmpty + $group.Name | Should -Be $TestGroupName + } + It 'Get by name returns expected result' { + $filtered = Get-JCUserGroup -Filter "name:eq:$TestGroupName" + $filtered | Should -Not -BeNullOrEmpty + $filtered.Name | Should -Be $TestGroupName + } + It 'Get by non-existent name returns nothing or error' { + $nonExistentName = "DefinitelyNotARealGroupName-$(Get-Random)" + $result = Get-JCUserGroup -Filter "name:eq:$nonExistentName" + $result | Should -BeNullOrEmpty + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/New-JCUserGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/New-JCUserGroup.Tests.ps1 index a5b999c3c..5fdf46484 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/New-JCUserGroup.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/New-JCUserGroup.Tests.ps1 @@ -1,9 +1,8 @@ Describe -Tag:('JCUserGroup') 'New-JCUserGroup 1.0' { BeforeAll { } It "Creates a new user group" { - $NewG = New-JCUserGroup -GroupName $(New-RandomString 8) + $NewG = New-JCUserGroup -GroupName ("Group-" + [guid]::NewGuid().ToString('N').Substring(0,8)) $NewG.Result | Should -Be 'Created' - $DeletedG = Remove-JCUserGroup -GroupName $NewG.name -force + $DeletedG = Remove-JCUserGroup -GroupName $NewG.name -Force } - } diff --git a/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Set-JCUserGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Set-JCUserGroup.Tests.ps1 new file mode 100644 index 000000000..507cdb60d --- /dev/null +++ b/PowerShell/JumpCloud Module/Tests/Public/Groups/UserGroups/Set-JCUserGroup.Tests.ps1 @@ -0,0 +1,24 @@ +Describe -Tag:('JcUserGroup') 'Set-JCUserGroup' { + It 'Creates a user group, updates name and description with Set-JCUserGroup, verifies via Get-JCUserGroup, then removes the group' { + $suffix = [guid]::NewGuid().ToString('N').Substring(0, 8) + $initialName = "Pester-SetUsrGrp-$suffix" + $newName = "Pester-SetUsrGrp-Renamed-$suffix" + $newDescription = "Pester Set-JCUserGroup $suffix" + + $created = New-JCUserGroup -GroupName $initialName + $created.Result | Should -Be 'Created' + $groupId = $created.id + $groupId | Should -Not -BeNullOrEmpty + + try { + $null = Set-JCUserGroup -Id $groupId -Name $newName -Description $newDescription + + $fetched = Get-JCUserGroup -Id $groupId + $fetched | Should -Not -BeNullOrEmpty + $fetched.Name | Should -Be $newName + $fetched.Description | Should -Be $newDescription + } finally { + Remove-JCUserGroup -GroupID $groupId -Force + } + } +} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Get-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Get-JCPolicyGroup.Tests.ps1 deleted file mode 100644 index 2ffb1a0c3..000000000 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Get-JCPolicyGroup.Tests.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -Describe -Tag:('JCPolicyGroup') 'Get-JCPolicyGroup' { - BeforeAll { - # get and remove "*pester* policy groups" - $policyGroups = Get-JCPolicyGroup - foreach ($policyGroup in $policyGroups) { - if ($policyGroup.name -match "Pester") { - Remove-JCPolicyGroup -PolicyGroupID $policyGroup.id -Force - } - } - # create a single policy group - $PesterGroupName = "Pester-$(Get-Random)" - $PesterGroupDesc = "$(Get-Random)" - $PesterGroup = New-JCPolicyGroup -Name $PesterGroupName -Description $PesterGroupDesc - } - It ('Returns the policy group without searching by name') { - $AllPolicyGroups = Get-JCPolicyGroup - $matchedPolicy = $AllPolicyGroups | Where-Object { $_.id -eq $PesterGroup.Id } - $matchedPolicy | Should -Not -BeNullOrEmpty - $matchedPolicy.name | Should -BeIn $AllPolicyGroups.name - $PesterGroup.id | Should -BeIn $AllPolicyGroups.id - } - It ('Returns the policy group by searching by name') { - $matchedPolicy = Get-JCPolicyGroup -Name $PesterGroupName - $matchedPolicy | Should -Not -BeNullOrEmpty - $matchedPolicy.name | Should -Be $PesterGroupName - $PesterGroup.description | Should -Be $PesterGroupDesc - $PesterGroup.id | Should -Be $PesterGroup.id - } - It ('Returns the policy group by searching by Id') { - $matchedPolicy = Get-JCPolicyGroup -PolicyGroupID $PesterGroup.id - $matchedPolicy | Should -Not -BeNullOrEmpty - $matchedPolicy.name | Should -Be $PesterGroupName - $PesterGroup.description | Should -Be $PesterGroupDesc - $PesterGroup.id | Should -Be $PesterGroup.id - } -} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Get-JCPolicyGroupMember.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Get-JCPolicyGroupMember.Tests.ps1 deleted file mode 100644 index f0f2d061e..000000000 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Get-JCPolicyGroupMember.Tests.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -Describe -Tag:('JCPolicyGroup') 'Get-JCPolicyGroupMember' { - BeforeAll { - # remove pester policy groups before starting these tests - $policyGroups = Get-JCPolicyGroup - foreach ($policyGroup in $policyGroups) { - if ($policyGroup.name -match "Pester") { - Remove-JCPolicyGroup -PolicyGroupID $policyGroup.id -Force - } - } - # create a single policy group - $PesterGroupName = "Pester-$(Get-Random)" - $PesterGroupDesc = "$(Get-Random)" - $PesterGroup = New-JCPolicyGroup -Name $PesterGroupName -Description $PesterGroupDesc - # create a policy for these tests: - $policyTemplates = Get-JcSdkPolicyTemplate - $usbTemplateLinux = $policyTemplates | Where-Object { $_.name -eq "disable_usb_storage_linux" } - $usbLinuxPolicy = New-JCPolicy -TemplateID $usbTemplateLinux.Id -Name "Pester - USB Linux $(new-randomString -NumberOfChars 8)" -disable_mtp $true -disable_afc $false -disable_mmc $false -Notes "usb" - } - It ('Returns null when there are no members of the policy group') { - $policyGroupMembers = Get-JCPolicyGroupMember -PolicyGroupID $PesterGroup.Id - # response should return nothing - $policyGroupMembers | Should -BeNullOrEmpty - } - It ('Returns a list of members when a policy has been added to the group') { - # add a policy to the group - Set-JcSdkPolicyGroupMember -GroupId $PesterGroup.Id -Op "add" -Id $usbLinuxPolicy.id - # get the group members - $policyGroupMembers = Get-JCPolicyGroupMember -PolicyGroupID $PesterGroup.Id - # The response should not be Null - $policyGroupMembers | Should -Not -BeNullOrEmpty - # there should be a count of 1 - $policyGroupMembers.Count | Should -BeExactly 1 - # the policyGroup should contain the new Policy - $usbLinuxPolicy.Name | Should -BeIn $policyGroupMembers.Name - } - It ('Returns members of a policy group specified by name') { - $policyGroupMembers = Get-JCPolicyGroupMember -Name $PesterGroup.name - # response should return nothing - $policyGroupMembers | Should -Not -BeNullOrEmpty - } -} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/New-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/New-JCPolicyGroup.Tests.ps1 deleted file mode 100644 index 2f22e5ffe..000000000 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/New-JCPolicyGroup.Tests.ps1 +++ /dev/null @@ -1,85 +0,0 @@ -Describe -Tag:('JCPolicyGroup') 'New-JCPolicyGroup' { - BeforeAll { - # remove pester policy groups before starting these tests - $policyGroups = Get-JCPolicyGroup - foreach ($policyGroup in $policyGroups) { - if ($policyGroup.name -match "Pester") { - Remove-JCPolicyGroup -PolicyGroupID $policyGroup.id -Force - } - } - } - It ("Creates a Policy Group with the name parameter") { - $randomName = "Pester-$(Get-Random)" - $newGroup = New-JCPolicyGroup -Name "$randomName" - $newGroup | Should -Not -BeNullOrEmpty - $newGroup.Name | Should -Be $randomName - $newGroup.Description | Should -BeNullOrEmpty - - } - It ("Creates a Policy Group with the 'name' and 'description' parameter") { - $randomName = "Pester-$(Get-Random)" - $description = "PesterTest" - $newGroup = New-JCPolicyGroup -Name "$randomName" -Description "$description" - $newGroup | Should -Not -BeNullOrEmpty - $newGroup.Name | Should -Be $randomName - $newGroup.Description | Should -Be $description - } - It ("Throws if the Policy Group already exists") { - $policyGroups = Get-JCPolicyGroup - $randomPolicyGroup = $policyGroups | Where-Object { $_.name -match "pester" } | Select-Object -First 1 - { New-JCPolicyGroup -Name "$($randomPolicyGroup.name)" } | Should -Throw - } -} - -Describe -Tag:('MSP') 'New-JCPolicyGroup Templates' { - Context ('From TemplateID') { - BeforeAll { - # create a policy for these tests: - $policyTemplates = Get-JcSdkPolicyTemplate - $usbTemplateLinux = $policyTemplates | Where-Object { $_.name -eq "disable_usb_storage_linux" } - $usbLinuxPolicy = New-JCPolicy -TemplateID $usbTemplateLinux.Id -Name "Pester - USB Linux $(new-randomString -NumberOfChars 8)" -disable_mtp $true -disable_afc $false -disable_mmc $false -Notes "usb" - - $PesterTemplateGroupName = "Pester-$(Get-Random)" - $PesterTemplateGroupDesc = "Pester-$(Get-Random)" - - $headers = @{ - "content-type" = "application/json" - "x-api-key" = "$env:JCApiKey" - } - $body = @{ - "description" = "$PesterTemplateGroupDesc" - "name" = "$PesterTemplateGroupName" - "policyIds" = @("$($usbLinuxPolicy.Id)") - } | ConvertTo-Json - - - $newPolicyGroupTemplate = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/providers/$env:JCProviderId/policygrouptemplates" -Method POST -Headers $headers -ContentType 'application/json' -Body $body - - } - - It ("Creates a policy group from template when the group exists") { - $existingPolicyGroup = Get-JCPolicyGroupTemplate -GroupTemplateID $newPolicyGroupTemplate.id - if (-Not $existingPolicyGroup) { - New-JCPolicyGroup -TemplateID $newPolicyGroupTemplate.id - } - # this behavior is actually expected - { $templateResult = New-JCPolicyGroup -TemplateID $newPolicyGroupTemplate.id } | Should -Not -Throw - # the second time we run this it should throw: - { $templateResult = New-JCPolicyGroup -TemplateID $newPolicyGroupTemplate.id } | Should -Throw - } - AfterAll { - $policyGroups = Get-JCPolicyGroup - foreach ($policyGroup in $policyGroups) { - if ($policyGroup.name -match "Pester") { - Remove-JCPolicyGroup -PolicyGroupID $policyGroup.id -Force - } - } - $policyGroupTemplates = Get-JCPolicyGroupTemplate - foreach ($policyGroupTemplate in $policyGroupTemplates) { - if ($policyGroupTemplate.name -match "Pester") { - Remove-JCPolicyGroupTemplate -id $policyGroupTemplate.id -Force - } - } - } - } -} diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.Tests.ps1 deleted file mode 100644 index cb7c54d71..000000000 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.Tests.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -Describe -Tag:('JCPolicyGroup') 'Remove-JCPolicyGroup' { - BeforeAll { - # remove pester policy groups before starting these tests - $policyGroups = Get-JCPolicyGroup - foreach ($policyGroup in $policyGroups) { - if ($policyGroup.name -match "Pester") { - Remove-JCPolicyGroup -PolicyGroupID $policyGroup.id -Force - } - } - } - It ("Removes a policy group using the 'Name' parameter") { - # create the new policy group - $randomName = "Pester-$(Get-Random)" - $newGroup = New-JCPolicyGroup -Name "$randomName" - # remove it - $removedGroup = Remove-JCPolicyGroup -Name $randomName -Force - # tests: - $removedGroup.name | Should -Be $newGroup.name - } - It ("Removes a policy group using the 'id' parameter") { - # create the new policy group - $randomName = "Pester-$(Get-Random)" - $newGroup = New-JCPolicyGroup -Name "$randomName" - # remove it - $removedGroup = Remove-JCPolicyGroup -PolicyGroupID $newGroup.id -Force - # tests: - $removedGroup.name | Should -Be $newGroup.name - } - It ("Removing a non-valid policy group by 'id' should throw") { - # create the new policy group - $randomName = $(Get-Random) - # remove it - $removedGroup = Remove-JCPolicyGroup -PolicyGroupID "$randomName" -Force - $removedGroup.Name | Should -Be "Not Found" - $removedGroup.Result | Should -BeNullOrEmpty - - } - It ("Removing a non-valid policy group by 'name' should throw") { - # create the new policy group - $randomName = $(Get-Random) - # remove it - $removedGroup = Remove-JCPolicyGroup -Name "$randomName" -Force - $removedGroup.Name | Should -Be "Not Found" - $removedGroup.Result | Should -BeNullOrEmpty - } -} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Set-JCPolicyGroup.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Set-JCPolicyGroup.Tests.ps1 deleted file mode 100644 index 3d90c5b57..000000000 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/PolicyGroups/Set-JCPolicyGroup.Tests.ps1 +++ /dev/null @@ -1,72 +0,0 @@ -Describe -Tag:('JCPolicyGroup') 'Set-JCPolicyGroup' { - BeforeAll { - # remove pester policy groups before starting these tests - $policyGroups = Get-JCPolicyGroup - foreach ($policyGroup in $policyGroups) { - if ($policyGroup.name -match "Pester") { - Remove-JCPolicyGroup -PolicyGroupID $policyGroup.id -Force - } - } - } - It ("Changes the name of the policy group by 'Name'") { - # create a new group - $randomName = "Pester-$(Get-Random)" - $newRandomName = "Pester-$(Get-Random)" - $newGroup = New-JCPolicyGroup -Name "$randomName" -Description "Description" - # set the group - $setGroup = Set-JCPolicyGroup -Name "$randomName" -NewName $newRandomName - # test: - $setGroup.Name | Should -Be $newRandomName - $setGroup.Description | Should -Be $newGroup.description - $setGroup.Id | Should -Be $newGroup.Id - } - It ("Changes the description of the policy group by 'Name'") { - # create a new group - $randomName = "Pester-$(Get-Random)" - $newGroup = New-JCPolicyGroup -Name "$randomName" -Description "Description" - # set the group - $setGroup = Set-JCPolicyGroup -Name "$randomName" -Description "NewDescription" - # test: - $setGroup.Name | Should -Be $randomName - $setGroup.Description | Should -Not -Be $newGroup.description - $setGroup.Description | Should -Be "NewDescription" - $setGroup.Id | Should -Be $newGroup.Id - } - It ("Changes the name of the policy group by 'Id'") { - # create a new group - $randomName = "Pester-$(Get-Random)" - $newRandomName = "Pester-$(Get-Random)" - $newGroup = New-JCPolicyGroup -Name "$randomName" -Description "Description" - # set the group - $setGroup = Set-JCPolicyGroup -PolicyGroupID "$($newGroup.id)" -NewName "$($newRandomName)" - # test: - $setGroup.Name | Should -Be $newRandomName - $setGroup.Description | Should -Be $newGroup.description - $setGroup.Id | Should -Be $newGroup.Id - } - It ("Changes the description of the policy group by 'Id'") { - # create a new group - $randomName = "Pester-$(Get-Random)" - $newGroup = New-JCPolicyGroup -Name "$randomName" -Description "Description" - # set the group - $setGroup = Set-JCPolicyGroup -PolicyGroupID "$($newGroup.id)" -Description "NewDescription" - # test: - $setGroup.Name | Should -Be $randomName - $setGroup.Description | Should -Not -Be $newGroup.description - $setGroup.Description | Should -Be "NewDescription" - $setGroup.Id | Should -Be $newGroup.Id - } - # It ("Throws when the policy group name does not exist") - Context ("Using the pipeline parameters") { - It ("Sets a newly created policy group") { - - } - It ("Sets an existing policy group") { - - } - It ("Throws if the policy group does not exist") { - - } - } - -} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemApp.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemApp.Tests.ps1 index 17cc736ce..db7c460ff 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemApp.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemApp.Tests.ps1 @@ -26,17 +26,18 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { It "Tests that given a systemID, SoftwareName, an app is returned" { # Chess is always installed on MacOS and it CAN NOT be removed no matter what - Get-JCSystemApp -SystemID $mac._id -name "Chess" | Should -Not -BeNullOrEmpty - Get-JCSystemApp -SystemID $linux._id -name "curl" | Should -Not -BeNullOrEmpty - Get-JCSystemApp -SystemID $windows._id -name "Microsoft Edge" | Should -Not -BeNullOrEmpty + Get-JCSystemApp -SystemID $linux._id -name "jcagent" | Should -Not -BeNullOrEmpty + # TODO: skipping since DI data is removed after 90 days + # Get-JCSystemApp -SystemID $mac._id -name "Chess" | Should -Not -BeNullOrEmpty + # Get-JCSystemApp -SystemID $windows._id -name "Microsoft Edge" | Should -Not -BeNullOrEmpty } It "Tests that given a name and version, app is returned" { # Chess is always installed on MacOS and it CAN NOT be removed no matter what $macApp = Get-JCSystemApp -SystemID $mac._id -name "Chess" - $linuxApp = Get-JCSystemApp -SystemID $linux._id -name "curl" + $linuxApp = Get-JCSystemApp -SystemID $linux._id -name "jcagent" $windowsApp = Get-JCSystemApp -SystemID $windows._id -name "Microsoft Edge" { Get-JCSystemApp -name "Chess" -version $macApp.bundleshortversion } | Should -Not -BeNullOrEmpty - { Get-JCSystemApp -name "curl" -version $linuxApp.version } | Should -Not -BeNullOrEmpty + { Get-JCSystemApp -name "jcagent" -version $linuxApp.version } | Should -Not -BeNullOrEmpty { Get-JCSystemApp -name "Microsoft Edge" -version $windowsApp.version } | Should -Not -BeNullOrEmpty } It "Tests that given a macOS systemID, SoftwareName, SoftwareVersion, an app is returned" { @@ -63,13 +64,13 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { It "Tests that given a linux systemID, SoftwareName, SoftwareVersion, an app is returned" { #Linux #Windows - $linuxApp = Get-JCSystemApp -SystemID $linux._id -name "curl" + $linuxApp = Get-JCSystemApp -SystemID $linux._id -name "jcagent" # A null value version shouldn't be accepted - { Get-JCSystemApp -SystemID $linux._id -name "curl" -version "" } | Should -Throw + { Get-JCSystemApp -SystemID $linux._id -name "jcagent" -version "" } | Should -Throw # A null value Name shouldn't be accepted { Get-JCSystemApp -SystemID $linux._id -name "" } | Should -Throw # Using a version that doesn't exist should return nothing - Get-JCSystemApp -SystemID $linux._id -name "curl" -version "48.49.50.51" | Should -Be $null + Get-JCSystemApp -SystemID $linux._id -name "jcagent" -version "48.49.50.51" | Should -Be $null } # Create tests for Search It "Tests for search given SystemOs and SoftwareName for MacOS Systems" { @@ -86,17 +87,17 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { { Get-JCSystemApp -Search -name "Chess" -SystemOs "MacOs" } | should -Not -Throw } It "Tests for search given SystemOs and SoftwareName for Linux Systems" { - # Curl is always installed on linux + # jcagent is always installed on linux { Get-JCSystemApp -Search | Should -Throw } - { Get-JCSystemApp -Search -name "Curl" -SystemID $linux._Id } | should -Not -Throw - { Get-JCSystemApp -Search -name "Curl" } | should -Not -Throw - { Get-JCSystemApp -Search -name "Curl" -SystemOs "linux" } | should -Not -Throw + { Get-JCSystemApp -Search -name "jcagent" -SystemID $linux._Id } | should -Not -Throw + { Get-JCSystemApp -Search -name "jcagent" } | should -Not -Throw + { Get-JCSystemApp -Search -name "jcagent" -SystemOs "linux" } | should -Not -Throw # A null value version shouldn't be accepted - { Get-JCSystemApp -Search -name "Curl" -SystemOs "" | Should -Throw } + { Get-JCSystemApp -Search -name "jcagent" -SystemOs "" | Should -Throw } # A null value version shouldn't be accepted { Get-JCSystemApp -Search -name "" -SystemOs "linux" | Should -Throw } - # Searching Curl on linux should return a result - { Get-JCSystemApp -Search -name "Curl" -SystemOs "linux" } | should -Not -Throw + # Searching jcagent on linux should return a result + { Get-JCSystemApp -Search -name "jcagent" -SystemOs "linux" } | should -Not -Throw } It "Tests for search given SystemOs and SoftwareName for Windows Systems" { # Microsoft Edge is always installed on windows @@ -112,15 +113,16 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { { Get-JCSystemApp -Search -name "Microsoft Edge" -SystemOs "windows" } | should -Not -Throw } - It "Tests the search functionatily of a software app" { + It "Tests the search functionality of a software app" { #Tests for each OS + # TODO: skipping since DI data is removed after 90 days # results with no data should be null or empty - Get-JCSystemApp -name "chess" | Should -BeNullOrEmpty - Get-JCSystemApp -name "microsoft edge" | Should -BeNullOrEmpty + # Get-JCSystemApp -name "chess" | Should -BeNullOrEmpty + # Get-JCSystemApp -name "microsoft edge" | Should -BeNullOrEmpty # when search is used to find an app the results should not be null or empty - Get-JCSystemApp -name "chess" -Search | Should -Not -BeNullOrEmpty - Get-JCSystemApp -name "microsoft edge" -Search | Should -Not -BeNullOrEmpty - Get-JCSystemApp -name "curl" -Search | Should -Not -BeNullOrEmpty + # Get-JCSystemApp -name "chess" -Search | Should -Not -BeNullOrEmpty + # Get-JCSystemApp -name "microsoft edge" -Search | Should -Not -BeNullOrEmpty + Get-JCSystemApp -name "jcagent" -Search | Should -Not -BeNullOrEmpty } It "Tests the search param with systemID" { @@ -132,8 +134,9 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { $foundWindowsSystems = $windowsApps.systemid | Select-Object -Unique $foundLinuxSystems = $linuxApps.systemid | Select-Object -Unique # if you specify a systemID and Search, results should not contain multiple systems - $foundMacSystems.count | should -Be 1 - $foundWindowsSystems.count | should -Be 1 + # TODO: skipping since DI data is removed after 90 days + # $foundMacSystems.count | should -Be 1 + # $foundWindowsSystems.count | should -Be 1 $foundLinuxSystems.count | should -Be 1 } It "Tests the search param with macos SystemOS" { @@ -167,7 +170,7 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { } } - It "Tests compatability macOS with the SDKs" { + It "Tests compatibility macOS with the SDKs" { #MacOS $sdkMac = Get-JcSdkSystemInsightApp -filter @("system_id:eq:$($mac._id)", "name:eq:Chess.app") $moduleMac = Get-JCSystemApp -SystemID $mac._id -name "Chess" @@ -179,7 +182,7 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { $sdkMac.id | Should -Be $moduleMacSearch.id $moduleMacSearch.name | Should -Contain $sdkMac.name } - It "Tests compatability windows with the SDKs" { + It "Tests compatibility windows with the SDKs" { #Windows $sdkWindows = Get-JcSdkSystemInsightProgram -filter @("system_id:eq:$($windows._id)", "name:eq:Microsoft Edge") $moduleWindows = Get-JCSystemApp -SystemID $windows._id -name "Microsoft Edge" @@ -191,11 +194,11 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { $sdkWindows.id | Should -Be $moduleWindowsSearch.id $moduleWindowsSearch.name | Should -Contain $sdkWindows.name } - It "Tests compatability linux with the SDKs" { + It "Tests compatibility linux with the SDKs" { #Linux - $sdkLinux = Get-JcSdkSystemInsightLinuxPackage -filter @("system_id:eq:$($linux._id)", "name:eq:curl") - $moduleLinux = Get-JCSystemApp -SystemID $linux._id -name "curl" - $moduleLinuxSearch = Get-JCSystemApp -SystemID $linux._id -name "curl" -Search + $sdkLinux = Get-JcSdkSystemInsightLinuxPackage -filter @("system_id:eq:$($linux._id)", "name:eq:jcagent") + $moduleLinux = Get-JCSystemApp -SystemID $linux._id -name "jcagent" + $moduleLinuxSearch = Get-JCSystemApp -SystemID $linux._id -name "jcagent" -Search # SDK Results should look exactly like module results when exact name is specified $sdkLinux.id | Should -Be $moduleLinux.id $sdkLinux.name | Should -Be $moduleLinux.name @@ -214,7 +217,7 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { { Get-JCsystemApp -SystemID $mac._id -SystemOS "windows" -name "Chess" -version "1.2.3" } | Should -Throw } - It "Tests the exporability of a list of software apps" { + It "Tests the exportability of a list of software apps" { { Get-JCSystemApp -SystemOS linux | ConvertTo-Csv } | Should -Not -Throw # Should return mac apps for all systems in the org { Get-JCSystemApp -SystemOS macOS | ConvertTo-Csv } | Should -Not -Throw @@ -224,7 +227,8 @@ Describe -Tag:('JCSystemApp') 'Get-JCSystemApp' { { Get-JCSystemApp -SystemID $windows._id | ConvertTo-Csv } | Should -Not -Throw { Get-JCSystemApp -SystemID $linux._id | ConvertTo-Csv } | Should -Not -Throw } - It "Tests macos functionatily to append .app to softwareName" { + It "Tests macOS functionality to append .app to softwareName" -Skip { + # TODO: skipping since DI data is removed after 90 days Get-JCSystemApp -SystemID $mac._id -name "Chess.app" | Should -Not -BeNullOrEmpty Get-JCSystemApp -SystemID $mac._id -name "Chess.App" | Should -Not -BeNullOrEmpty Get-JCSystemApp -SystemID $mac._id -name "Chess" | Should -Not -BeNullOrEmpty diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemKB.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemKB.Tests.ps1 index 5a7b14ab8..fa82cd866 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemKB.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemKB.Tests.ps1 @@ -6,19 +6,22 @@ Describe -Tag:('JCSystemKB') 'Get-JCSystemKB' { It "Gets all available KBs on all systems" { { Get-JCSystemKB } | Should -Not -Throw $KB = Get-JCSystemKB - $KB | Should -Not -BeNullOrEmpty + # TODO: skipping since DI data is removed after 90 days + # $KB | Should -Not -BeNullOrEmpty } It "Gets all KBs from one system" { $windowsMachine = $windows | Select-Object -First 1 { Get-JCSystemKB -SystemID $windowsMachine._id } | Should -Not -Throw - Get-JCSystemKB -SystemID $windowsMachine._id | Should -Not -BeNullOrEmpty + # TODO: skipping since DI data is removed after 90 days + # Get-JCSystemKB -SystemID $windowsMachine._id | Should -Not -BeNullOrEmpty } It "Gets one KB from all systems" { $SingleKB = Get-JCSystemKB | Select-Object hotfix_id -First 1 { Get-JCSystemKB -KB $SingleKB.hotfix_id } | Should -Not -Throw - Get-JCSystemKB -KB $SingleKB.hotfix_id | Should -Not -BeNullOrEmpty + # TODO: skipping since DI data is removed after 90 days + # Get-JCSystemKB -KB $SingleKB.hotfix_id | Should -Not -BeNullOrEmpty } - It "Gets one KB from one system" { + It "Gets one KB from one system" -skip { $SingleKB = Get-JCSystemKB | Select-Object -First 1 { Get-JCSystemKB -SystemID $SingleKB.system_id -KB $SingleKB.hotfix_id } | Should -Not -Throw Get-JCSystemKB -SystemID $SingleKB.system_id -KB $SingleKB.hotfix_id | Should -Not -BeNullOrEmpty diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 8af6d5c57..323470ac6 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -2436,7 +2436,7 @@ PS C:\> $BackupJcOrganizationResults.User - By calling the Connect-JCOnline function you are setting the variable $JCAPIKEY within the global scope. By setting this variable in the global scope the variable $JCAPIKEY can be reused by other functions in the JumpCloud module. If you wish to change the API key to connect to another JumpCloud org simply call the Connect-JCOnline function and enter the alternative API key. Introduced in JumpCloud module version 1.2 the Connect-JCOnline function will also check to ensure you are running the latest version of the JumpCloud PowerShell module and offer to update the module if there is an update available. To prevent the module update check the '-force' parameter can be used. + By calling the Connect-JCOnline function you are setting the variable $JCAPIKEY within the global scope. By setting this variable in the global scope the variable $JCAPIKEY can be reused by other functions in the JumpCloud module. If you wish to change the API key to connect to another JumpCloud org simply call the Connect-JCOnline function and enter the alternative API key. Introduced in JumpCloud module version 1.2 the Connect-JCOnline function will also check to ensure you are running the latest version of the JumpCloud PowerShell module and offer to update the module if there is an update available. To prevent the module update check the '-force' parameter can be used. Use the '-JCEnvironment' parameter to specify your environment location (STANDARD or EU), STANDARD is the current default. You can also change the location in your PowerShell Module settings by using the 'Set-JCSettingsFile' function @@ -2468,11 +2468,11 @@ PS C:\> $BackupJcOrganizationResults.User JCEnvironment - Specific to JumpCloud development team to connect to staging dev environment. + Specific to JumpCloud development team to connect to staging dev environment. More Information Here. (https://jumpcloud.com/support/jumpcloud-data-centers-login-urls-and-service-endpoints) STANDARD - staging + STAGING EU System.String @@ -2512,7 +2512,7 @@ PS C:\> $BackupJcOrganizationResults.User JCEnvironment - Specific to JumpCloud development team to connect to staging dev environment. + Specific to JumpCloud development team to connect to staging dev environment. More Information Here. (https://jumpcloud.com/support/jumpcloud-data-centers-login-urls-and-service-endpoints) System.String @@ -2595,6 +2595,13 @@ PS C:\> $BackupJcOrganizationResults.User Using the "-Force" parameter the module update check is skipped. The '-Force' parameter should be used when using the JumpCloud module in scripts or other automation environments. + + -------------------------- Example 4 -------------------------- + Connect-JCOnline -JumpCloudAPIKey eu8792c9d4y2398is1tb6h0b83ebf0e92s97t382 -JCEnvironment 'EU' + + Use the "-JCEnvironment" parameter to change the environment location ("STANDARD" or "EU") + + @@ -6259,6 +6266,7 @@ PS C:\> $BackupJcOrganizationResults.User User System + Policy System.String @@ -6599,26 +6607,50 @@ PS C:\> $BackupJcOrganizationResults.User Get-JCPolicyGroup - - Name + + Fields - The Name of the JumpCloud policy group you wish to query. + The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - System.String + System.Collections.Generic.List`1[System.String] - System.String + System.Collections.Generic.List`1[System.String] + + + None + + + Filter + + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] None + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + Get-JCPolicyGroup - - PolicyGroupID + + Id - The ID of the JumpCloud policy group you wish to query + ObjectID of the Policy Group. System.String @@ -6629,24 +6661,52 @@ PS C:\> $BackupJcOrganizationResults.User + + Get-JCPolicyGroup + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + - - Name + + Fields - The Name of the JumpCloud policy group you wish to query. + The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - System.String + System.Collections.Generic.List`1[System.String] - System.String + System.Collections.Generic.List`1[System.String] None - - PolicyGroupID + + Filter + + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + Id - The ID of the JumpCloud policy group you wish to query + ObjectID of the Policy Group. System.String @@ -6655,12 +6715,36 @@ PS C:\> $BackupJcOrganizationResults.User None + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + - None + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity @@ -6670,7 +6754,7 @@ PS C:\> $BackupJcOrganizationResults.User - System.Object + JumpCloud.SDK.V2.Models.IPolicyGroup @@ -6727,10 +6811,46 @@ PS C:\> $BackupJcOrganizationResults.User Get-JCPolicyGroupMember + + Authorization + + Authorization header for the System Context API + + System.String + + System.String + + + None + + + Date + + Current date header for the System Context API + + System.String + + System.String + + + None + + + Filter + + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + - Name + PolicyId - The Name of the JumpCloud policy group to query and return members of + ObjectID of the Policy. System.String @@ -6740,13 +6860,89 @@ PS C:\> $BackupJcOrganizationResults.User None + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + Get-JCPolicyGroupMember - - PolicyGroupID + + Authorization + + Authorization header for the System Context API + + System.String + + System.String + + + None + + + Date + + Current date header for the System Context API + + System.String + + System.String + + + None + + + Filter + + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + + Get-JCPolicyGroupMember + + GroupId - The ID of the JumpCloud policy group to query and return members of + ObjectID of the Policy Group. System.String @@ -6759,10 +6955,10 @@ PS C:\> $BackupJcOrganizationResults.User - - Name + + Authorization - The Name of the JumpCloud policy group to query and return members of + Authorization header for the System Context API System.String @@ -6771,10 +6967,58 @@ PS C:\> $BackupJcOrganizationResults.User None - - PolicyGroupID + + Date + + Current date header for the System Context API + + System.String + + System.String + + + None + + + Filter + + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + GroupId + + ObjectID of the Policy Group. + + System.String + + System.String + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + PolicyId - The ID of the JumpCloud policy group to query and return members of + ObjectID of the Policy. System.String @@ -6784,11 +7028,23 @@ PS C:\> $BackupJcOrganizationResults.User None + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + - None + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity @@ -6798,7 +7054,15 @@ PS C:\> $BackupJcOrganizationResults.User - System.Object + JumpCloud.SDK.V2.Models.IGraphConnection + + + + + + + + JumpCloud.SDK.V2.Models.IGraphObjectWithPaths @@ -9359,43 +9623,248 @@ $reportContent = Get-JCReport -reportID $lastReport.id -type 'csv' - Get-JCSystemGroupMember + Get-JCSystemGroup Get - JCSystemGroupMember + JCSystemGroup - Returns the System Group members of a JumpCloud System Group. + This endpoint returns the details of a System Group. - The Get-JCSystemGroupMember function returns all the System Group members of a JumpCloud System Group. + This endpoint returns the details of a System Group. - Get-JCSystemGroupMember - - ByID + Get-JCSystemGroup + + Fields - If searching for a System Group using the GroupID populate the GroupID in the -ByID field. + The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - System.String + System.Collections.Generic.List`1[System.String] - System.String + System.Collections.Generic.List`1[System.String] None - - - - Get-JCSystemGroupMember - - GroupName + + Filter - The name of the JumpCloud System Group you want to return the members of. + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` - System.String + System.Collections.Generic.List`1[System.String] - System.String + System.Collections.Generic.List`1[System.String] + + + None + + + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + + Get-JCSystemGroup + + Id + + ObjectID of the System Group. + + System.String + + System.String + + + None + + + + + Get-JCSystemGroup + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + + + + + Fields + + The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + Filter + + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + Id + + ObjectID of the System Group. + + System.String + + System.String + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + + + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + + + + + + + + JumpCloud.SDK.V2.Models.ISystemGroup + + + + + + + + + COMPLEX PARAMETER PROPERTIES + To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + INPUTOBJECT <IJumpCloudApiIdentity>: Identity Parameter [AccountId <String>]: [ActivedirectoryId <String>]: [AdministratorId <String>]: [AgentId <String>]: [AppleMdmId <String>]: [ApplicationId <String>]: ObjectID of the Application. [ApprovalFlowId <String>]: [CommandId <String>]: ObjectID of the Command. [CustomEmailType <String>]: [DeviceId <String>]: [GroupId <String>]: ObjectID of the Policy Group. [GsuiteId <String>]: ObjectID of the G Suite instance. [Id <String>]: ObjectID of this Active Directory instance. [JobId <String>]: [LdapserverId <String>]: ObjectID of the LDAP Server. [Office365Id <String>]: ObjectID of the Office 365 instance. [PolicyId <String>]: ObjectID of the Policy. [ProviderId <String>]: [PushEndpointId <String>]: [RadiusserverId <String>]: ObjectID of the Radius Server. [SoftwareAppId <String>]: ObjectID of the Software App. [SystemId <String>]: ObjectID of the System. [UserId <String>]: ObjectID of the User. [WorkdayId <String>]: + + + + + -------------------------- EXAMPLE 1 -------------------------- + Get-JCSystemGroup -Fields:(<string[]>) -Filter:(<string[]>) -Sort:(<string[]>) + + --- + Attributes JumpCloud.SDK.V2.Models.GraphAttributes Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String Type String + + + + -------------------------- EXAMPLE 2 -------------------------- + Get-JCSystemGroup -Id:(<string>) + + --- + Attributes JumpCloud.SDK.V2.Models.GraphAttributes Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String Type String + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/ + + + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkSystemGroup.md + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkSystemGroup.md + + + + + + Get-JCSystemGroupMember + Get + JCSystemGroupMember + + Returns the System Group members of a JumpCloud System Group. + + + + The Get-JCSystemGroupMember function returns all the System Group members of a JumpCloud System Group. + + + + Get-JCSystemGroupMember + + ByID + + If searching for a System Group using the GroupID populate the GroupID in the -ByID field. + + System.String + + System.String + + + None + + + + + Get-JCSystemGroupMember + + GroupName + + The name of the JumpCloud System Group you want to return the members of. + + System.String + + System.String None @@ -11045,39 +11514,63 @@ Get-JCUser -Username cClemons - Get-JCUserGroupMember + Get-JCUserGroup Get - JCUserGroupMember + JCUserGroup - Returns the User Group members of a JumpCloud User Group. + This endpoint returns the details of a User Group. - The Get-JCUserGroupMember function returns all the User Group members of a JumpCloud User Group. + This endpoint returns the details of a User Group. - Get-JCUserGroupMember - - ByID + Get-JCUserGroup + + Fields - If searching for a User Group using the GroupID populate the GroupID in the -ByID field. + The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - System.String + System.Collections.Generic.List`1[System.String] - System.String + System.Collections.Generic.List`1[System.String] + + + None + + + Filter + + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] None + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + - Get-JCUserGroupMember - - GroupName + Get-JCUserGroup + + Id - The name of the JumpCloud User Group you want to return the members of. + ObjectID of the User Group. System.String @@ -11088,44 +11581,225 @@ Get-JCUser -Username cClemons + + Get-JCUserGroup + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + - - ByID + + Fields - If searching for a User Group using the GroupID populate the GroupID in the -ByID field. + The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - System.String + System.Collections.Generic.List`1[System.String] - System.String + System.Collections.Generic.List`1[System.String] None - - GroupName + + Filter - The name of the JumpCloud User Group you want to return the members of. + A filter to apply to the query. Filter structure : `<field>:<operator>:<value>`. field = Populate with a valid field from an endpoint response. operator = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. Note: v1 operators differ from v2 operators. value = Populate with the value you want to search for. Is case sensitive. Supports wild cards. EX: `GET /api/v2/groups?filter=name:eq:Test+Group` - System.String + System.Collections.Generic.List`1[System.String] - System.String + System.Collections.Generic.List`1[System.String] None - - - - + + Id + + ObjectID of the User Group. + + System.String System.String + + None + + + InputObject - + Identity Parameter - - + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + + Sort + + The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + + System.Collections.Generic.List`1[System.String] + + System.Collections.Generic.List`1[System.String] + + + None + + + + + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + + + + + + + + JumpCloud.SDK.V2.Models.IUserGroup + + + + + + + + + COMPLEX PARAMETER PROPERTIES + To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + INPUTOBJECT <IJumpCloudApiIdentity>: Identity Parameter [AccountId <String>]: [ActivedirectoryId <String>]: [AdministratorId <String>]: [AgentId <String>]: [AppleMdmId <String>]: [ApplicationId <String>]: ObjectID of the Application. [ApprovalFlowId <String>]: [CommandId <String>]: ObjectID of the Command. [CustomEmailType <String>]: [DeviceId <String>]: [GroupId <String>]: ObjectID of the Policy Group. [GsuiteId <String>]: ObjectID of the G Suite instance. [Id <String>]: ObjectID of this Active Directory instance. [JobId <String>]: [LdapserverId <String>]: ObjectID of the LDAP Server. [Office365Id <String>]: ObjectID of the Office 365 instance. [PolicyId <String>]: ObjectID of the Policy. [ProviderId <String>]: [PushEndpointId <String>]: [RadiusserverId <String>]: ObjectID of the Radius Server. [SoftwareAppId <String>]: ObjectID of the Software App. [SystemId <String>]: ObjectID of the System. [UserId <String>]: ObjectID of the User. [WorkdayId <String>]: + + + + + -------------------------- EXAMPLE 1 -------------------------- + Get-JCUserGroup -Fields:(<string[]>) -Filter:(<string[]>) -Sort:(<string[]>) + + --- + Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String SuggestionCountAdd Int SuggestionCountRemove Int SuggestionCountTotal Int Type String + + + + -------------------------- EXAMPLE 2 -------------------------- + Get-JCUserGroup -Id:(<string>) + + --- + Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String SuggestionCountAdd Int SuggestionCountRemove Int SuggestionCountTotal Int Type String + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/ + + + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkUserGroup.md + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Get-JcSdkUserGroup.md + + + + + + Get-JCUserGroupMember + Get + JCUserGroupMember + + Returns the User Group members of a JumpCloud User Group. + + + + The Get-JCUserGroupMember function returns all the User Group members of a JumpCloud User Group. + + + + Get-JCUserGroupMember + + ByID + + If searching for a User Group using the GroupID populate the GroupID in the -ByID field. + + System.String + + System.String + + + None + + + + + Get-JCUserGroupMember + + GroupName + + The name of the JumpCloud User Group you want to return the members of. + + System.String + + System.String + + + None + + + + + + + ByID + + If searching for a User Group using the GroupID populate the GroupID in the -ByID field. + + System.String + + System.String + + + None + + + GroupName + + The name of the JumpCloud User Group you want to return the members of. + + System.String + + System.String + + + None + + + + + + + System.String + + + + + + @@ -12824,39 +13498,48 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV New-JCPolicyGroup - - Description + + Body - The description of the policy group to create + PolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData None - - Name + + + Confirm - The name of the policy group to create + Prompts you for confirmation before running the cmdlet. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False - New-JCPolicyGroup - - - TemplateID + + Name - The Policy Template ID to apply to this MTP org. This parameter will only work in MTP organizations + The name of the policy group to create System.String @@ -12865,22 +13548,45 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + - - Description + + Body - The description of the policy group to create + PolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData None - + Name The name of the policy group to create @@ -12893,23 +13599,35 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV None - - TemplateID + + Confirm - The Policy Template ID to apply to this MTP org. This parameter will only work in MTP organizations + Prompts you for confirmation before running the cmdlet. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False - None + JumpCloud.SDK.V2.Models.IPolicyGroupData @@ -12919,7 +13637,7 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV - System.Object + JumpCloud.SDK.V2.Models.IPolicyGroup @@ -16402,37 +17120,34 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV Remove-JCPolicyGroup - - Force + + Id - A SwitchParameter which suppresses the warning message when removing a JumpCloud Policy. + ObjectID of the Policy Group. + System.String - System.Management.Automation.SwitchParameter + System.String - False + None - - Name + + PassThru - The Name of the JumpCloud policy group you wish to remove. + Returns true when the command succeeds - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - - Remove-JCPolicyGroup - - Force + + Confirm - A SwitchParameter which suppresses the warning message when removing a JumpCloud Policy. + Prompts you for confirmation before running the cmdlet. System.Management.Automation.SwitchParameter @@ -16440,26 +17155,97 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV False - - PolicyGroupID + + WhatIf - The ID of the JumpCloud policy group you wish to remove. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.String - System.String + System.Management.Automation.SwitchParameter + + + False + + + + Remove-JCPolicyGroup + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity None + + PassThru + + Returns true when the command succeeds + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + Id + + ObjectID of the Policy Group. + + System.String + + System.String + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + - Force + PassThru - A SwitchParameter which suppresses the warning message when removing a JumpCloud Policy. + Returns true when the command succeeds System.Management.Automation.SwitchParameter @@ -16468,36 +17254,36 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV False - - Name + + + Confirm - The Name of the JumpCloud policy group you wish to remove. + Prompts you for confirmation before running the cmdlet. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False - - PolicyGroupID + + WhatIf - The ID of the JumpCloud policy group you wish to remove. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False - - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity @@ -16507,7 +17293,7 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV - System.Object + JumpCloud.SDK.V2.Models.IPolicyGroup @@ -19409,22 +20195,22 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli Set-JCPolicyGroup - - Description + + Body - The Description of the JumpCloud policy group you wish to set. + PolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData None - - Name + + Id - The Name of the JumpCloud policy group you wish to set. + ObjectID of the Policy Group. System.String @@ -19433,26 +20219,86 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - NewName + + + Confirm - The new name to set on the existing JumpCloud policy group. If left unspecified, the cmdlet will not rename the existing policy group. + Prompts you for confirmation before running the cmdlet. - System.String - System.String + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCPolicyGroup + + Body + + PolicyGroupData + + JumpCloud.SDK.V2.Models.IPolicyGroupData + + JumpCloud.SDK.V2.Models.IPolicyGroupData + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity None + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + Set-JCPolicyGroup - - Description + + Id - The Description of the JumpCloud policy group you wish to set. + ObjectID of the Policy Group. System.String @@ -19462,9 +20308,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - NewName + Name - The new name to set on the existing JumpCloud policy group. If left unspecified, the cmdlet will not rename the existing policy group. + The Name of the JumpCloud policy group you wish to set. System.String @@ -19473,10 +20319,48 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - PolicyGroupID + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCPolicyGroup + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + Name - The Id of the JumpCloud policy group you wish to set. + The Name of the JumpCloud policy group you wish to set. System.String @@ -19486,25 +20370,47 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + - - Description + + Body - The Description of the JumpCloud policy group you wish to set. + PolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData - System.String + JumpCloud.SDK.V2.Models.IPolicyGroupData None - - Name + + Id - The Name of the JumpCloud policy group you wish to set. + ObjectID of the Policy Group. System.String @@ -19513,22 +20419,22 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - NewName + + InputObject - The new name to set on the existing JumpCloud policy group. If left unspecified, the cmdlet will not rename the existing policy group. + Identity Parameter - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity None - - PolicyGroupID + + Name - The Id of the JumpCloud policy group you wish to set. + The Name of the JumpCloud policy group you wish to set. System.String @@ -19538,11 +20444,43 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + + + + + + JumpCloud.SDK.V2.Models.IPolicyGroupData @@ -19552,7 +20490,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.Object + JumpCloud.SDK.V2.Models.IPolicyGroup @@ -19596,35 +20534,35 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - Set-JCRadiusReplyAttribute + Set-JCPolicyGroupMember Set - JCRadiusReplyAttribute + JCPolicyGroupMember - Updates or adds Radius reply attributes to a JumpCloud user group. + This endpoint allows you to manage the Policy members of a Policy Group. - Updates or adds Radius reply attributes to a JumpCloud user group. User authentication Radius requests will return with the Radius reply attributes configured on the JumpCloud user groups which associates the user to JumpCloud Radius. Any RADIUS reply attributes configured on a JumpCloud user group which associates a user to a RADIUS server will be returned in the Access-Accept message sent to the endpoint configured to authenticate with JumpCloud Radius. If a user is a member of more then one JumpCloud user group associated with a given RADIUS server all Reply attributes for the groups that associate the user to the RADIUS server will be returned in the Access-Accept message. If a user is a member of more then one JumpCloud user group associated with a given RADIUS server and these groups are configured with conflicting RADIUS reply attributes then the values of the attributes for the group that was created most recently will be returned in the Access-Accept message. RADIUS reply attribute conflicts are resolved based on the creation date of the user group where groups that are created more recently take precedent over older groups. Conflicts occur when groups are configured with the same RADIUS reply attributes and have conflicting attribute values. RADIUS reply attributes with the same attribute names but different tag values do not create conflicts. + This endpoint allows you to manage the Policy members of a Policy Group. - Set-JCRadiusReplyAttribute - - GroupName + Set-JCPolicyGroupMember + + Attributes - The JumpCloud user group to add or update the specified Radius reply attributes on. + The graph attributes. - System.String + System.Collections.Hashtable - System.String + System.Collections.Hashtable None - - Attribute1_name + + GroupId - Enter an attribute name + ObjectID of the Policy Group. System.String @@ -19633,10 +20571,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Attribute1_value + + Id - Enter an attribute value + The ObjectID of graph object being added or removed as an association. System.String @@ -19645,10 +20583,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Attribute2_name + + Op - Enter an attribute name + How to modify the graph connection. System.String @@ -19657,10 +20595,59 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Attribute2_value + + PassThru - Enter an attribute value + Returns true when the command succeeds + + + System.Management.Automation.SwitchParameter + + + False + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCPolicyGroupMember + + Attributes + + The graph attributes. + + System.Collections.Hashtable + + System.Collections.Hashtable + + + None + + + Id + + The ObjectID of graph object being added or removed as an association. System.String @@ -19669,34 +20656,22 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - NumberOfAttributes + + InputObject - The number of RADIUS reply attributes you wish to add to a user group. - If an attributes exists with a name that matches the new attribute then the existing attribute will be updated. - Based on the NumberOfAttributes value two Dynamic Parameters will be created for each Attribute: Attribute_name and Attribute_value with an associated number. - See an example for working with Custom Attribute in EXAMPLE 3 above. - Attributes must be valid RADIUS attributes. Find a list of valid RADIUS attributes within the dictionary files of this repro broken down by vendor: github.com/FreeRADIUS/freeradius-server/tree/v3.0.x/share - If an invalid attribute is configured on a user group this will prevent users within this group from being able to authenticate via RADIUS until the invalid attribute is removed. + Identity Parameter - System.Int32 + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity - System.Int32 + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity None - - - VLAN + + Op - By specifying the '-VLAN' parameter three radius attributes are added or updated on the target user group. - These attributes and values are are: - name value - ---- ----- - Tunnel-Medium-Type IEEE-802 - Tunnel-Type VLAN - Tunnel-Private-Group-Id VALUE of -VLAN The value specified for the '-VLAN' parameter is populated for the value of Tunnel-Private-Group-Id . + How to modify the graph connection. System.String @@ -19705,44 +20680,60 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - VLANTag + + PassThru - Specifies the VLAN id which is applied to all attribute names. + Returns true when the command succeeds + + + System.Management.Automation.SwitchParameter + + + False + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCPolicyGroupMember + + Body + + GraphOperation (PolicyGroup-Member) + + JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember + + JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember + + + None + + + GroupId + + ObjectID of the Policy Group. - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - System.String System.String @@ -19750,37 +20741,132 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None + + PassThru + + Returns true when the command succeeds + + + System.Management.Automation.SwitchParameter + + + False + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCPolicyGroupMember + + Body + + GraphOperation (PolicyGroup-Member) + + JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember + + JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + PassThru + + Returns true when the command succeeds + + + System.Management.Automation.SwitchParameter + + + False + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + - - Attribute1_name + + Attributes - Enter an attribute name + The graph attributes. - System.String + System.Collections.Hashtable - System.String + System.Collections.Hashtable None - - Attribute1_value + + Body - Enter an attribute value + GraphOperation (PolicyGroup-Member) - System.String + JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember - System.String + JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember None - - Attribute2_name + + GroupId - Enter an attribute name + ObjectID of the Policy Group. System.String @@ -19789,10 +20875,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Attribute2_value + + Id - Enter an attribute value + The ObjectID of graph object being added or removed as an association. System.String @@ -19801,10 +20887,22 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - GroupName + + InputObject - The JumpCloud user group to add or update the specified Radius reply attributes on. + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + Op + + How to modify the graph connection. System.String @@ -19813,59 +20911,48 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - NumberOfAttributes + + PassThru - The number of RADIUS reply attributes you wish to add to a user group. - If an attributes exists with a name that matches the new attribute then the existing attribute will be updated. - Based on the NumberOfAttributes value two Dynamic Parameters will be created for each Attribute: Attribute_name and Attribute_value with an associated number. - See an example for working with Custom Attribute in EXAMPLE 3 above. - Attributes must be valid RADIUS attributes. Find a list of valid RADIUS attributes within the dictionary files of this repro broken down by vendor: github.com/FreeRADIUS/freeradius-server/tree/v3.0.x/share - If an invalid attribute is configured on a user group this will prevent users within this group from being able to authenticate via RADIUS until the invalid attribute is removed. + Returns true when the command succeeds - System.Int32 + System.Management.Automation.SwitchParameter - System.Int32 + System.Management.Automation.SwitchParameter - None + False - - VLAN + + Confirm - By specifying the '-VLAN' parameter three radius attributes are added or updated on the target user group. - These attributes and values are are: - name value - ---- ----- - Tunnel-Medium-Type IEEE-802 - Tunnel-Type VLAN - Tunnel-Private-Group-Id VALUE of -VLAN The value specified for the '-VLAN' parameter is populated for the value of Tunnel-Private-Group-Id . + Prompts you for confirmation before running the cmdlet. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False - - VLANTag + + WhatIf - Specifies the VLAN id which is applied to all attribute names. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False - System.String + JumpCloud.SDK.V2.Models.IGraphOperationPolicyGroupMember @@ -19873,7 +20960,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.Int32 + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity @@ -19883,7 +20970,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.Object + System.Boolean @@ -19892,79 +20979,58 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - + COMPLEX PARAMETER PROPERTIES + To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + BODY <IGraphOperationPolicyGroupMember>: GraphOperation (PolicyGroup-Member) Id <String>: The ObjectID of graph object being added or removed as an association. Op <String>: How to modify the graph connection. [Attributes <IGraphAttributes>]: The graph attributes. [(Any) <Object>]: This indicates any property can be added to this object. + INPUTOBJECT <IJumpCloudApiIdentity>: Identity Parameter [AccountId <String>]: [ActivedirectoryId <String>]: [AdministratorId <String>]: [AgentId <String>]: [AppleMdmId <String>]: [ApplicationId <String>]: ObjectID of the Application. [ApprovalFlowId <String>]: [CommandId <String>]: ObjectID of the Command. [CustomEmailType <String>]: [DeviceId <String>]: [GroupId <String>]: ObjectID of the Policy Group. [GsuiteId <String>]: ObjectID of the G Suite instance. [Id <String>]: ObjectID of this Active Directory instance. [JobId <String>]: [LdapserverId <String>]: ObjectID of the LDAP Server. [Office365Id <String>]: ObjectID of the Office 365 instance. [PolicyId <String>]: ObjectID of the Policy. [ProviderId <String>]: [PushEndpointId <String>]: [RadiusserverId <String>]: ObjectID of the Radius Server. [SoftwareAppId <String>]: ObjectID of the Software App. [SystemId <String>]: ObjectID of the System. [UserId <String>]: ObjectID of the User. [WorkdayId <String>]: - -------------------------- Example 1 -------------------------- - Set-JCRadiusReplyAttribute -GroupName "BoulderOffice" -VLAN 24 - - By specifying the '-VLAN' parameter three radius attributes are updated on the JumpCloud user group 'BoulderOffice'. - These attributes are: - name value ---- ----- Tunnel-Medium-Type IEEE-802 Tunnel-Type VLAN Tunnel-Private-Group-Id 24 - The value specified for the '-VLAN' parameter is populated for the value of Tunnel-Private-Group-Id . - - - - -------------------------- Example 2 -------------------------- - Set-JCRadiusReplyAttribute -GroupName "BoulderOffice" -VLAN 24 -VLANTag 4 + -------------------------- EXAMPLE 1 -------------------------- + Set-JCPolicyGroupMember -GroupId:(<string>) -Body:(<JumpCloud.SDK.V2.Models.GraphOperationPolicyGroupMember>) - By specifying the '-VLAN' parameter three radius attributes are update on the JumpCloud user group 'BoulderOffice'. The use of '-VLANTag' appends each VLAN attribute name with a colon and the tag number specified. - These attributes are: - name value ---- ----- Tunnel-Medium-Type:4 IEEE-802 Tunnel-Type:4 VLAN Tunnel-Private-Group-Id:4 24 + - -------------------------- Example 3 -------------------------- - Set-JCRadiusReplyAttribute -GroupName "BoulderOffice" -NumberOfAttributes 2 -Attribute1_name "Session-Timeout" -Attribute1_value 200 -Attribute2_name "Termination-Action" -Attribute2_value 2 + -------------------------- EXAMPLE 2 -------------------------- + Set-JCPolicyGroupMember -GroupId:(<string>) -Id:(<string>) -Op:(<string>) -Attributes:(<hashtable>) - Updates two Radius attributes to the JumpCloud user group 'BoulderOffice'. - These attribute are: - name value ---- ----- Session-Timeout 200 Termination-Action 2 - The parameter '-NumberOfAttributes' is a dynamic parameter that generates two required parameters for each custom attribute specified. In this example these parameters are -Attribute1_name,-Attribute1_value, -Attribute2_name and -Attribute2_value. - If the Radius reply attribute being updated already exists on the target user group the value for this attribute is updated. If the Radius reply attribute does not exist the attribute is added. + Online Version: - https://github.com/TheJumpCloud/support/wiki/Set-JCRadiusReplyAttribute + https://github.com/TheJumpCloud/support/wiki/ + + + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkPolicyGroupMember.md + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkPolicyGroupMember.md - Set-JCRadiusServer + Set-JCRadiusReplyAttribute Set - JCRadiusServer + JCRadiusReplyAttribute - Updates a JumpCloud radius server. + Updates or adds Radius reply attributes to a JumpCloud user group. - Use this function to update a radius server in a JumpCloud tenet. + Updates or adds Radius reply attributes to a JumpCloud user group. User authentication Radius requests will return with the Radius reply attributes configured on the JumpCloud user groups which associates the user to JumpCloud Radius. Any RADIUS reply attributes configured on a JumpCloud user group which associates a user to a RADIUS server will be returned in the Access-Accept message sent to the endpoint configured to authenticate with JumpCloud Radius. If a user is a member of more then one JumpCloud user group associated with a given RADIUS server all Reply attributes for the groups that associate the user to the RADIUS server will be returned in the Access-Accept message. If a user is a member of more then one JumpCloud user group associated with a given RADIUS server and these groups are configured with conflicting RADIUS reply attributes then the values of the attributes for the group that was created most recently will be returned in the Access-Accept message. RADIUS reply attribute conflicts are resolved based on the creation date of the user group where groups that are created more recently take precedent over older groups. Conflicts occur when groups are configured with the same RADIUS reply attributes and have conflicting attribute values. RADIUS reply attributes with the same attribute names but different tag values do not create conflicts. - Set-JCRadiusServer - - Id - - The unique id of the object. - - System.String[] - - System.String[] - - - None - - - newName + Set-JCRadiusReplyAttribute + + GroupName - The new name of the Radius Server. + The JumpCloud user group to add or update the specified Radius reply attributes on. System.String @@ -19973,10 +21039,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - networkSourceIp + + Attribute1_name - The ip of the new Radius Server. + Enter an attribute name System.String @@ -19985,10 +21051,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - sharedSecret + + Attribute1_value - The shared secret for the new Radius Server. + Enter an attribute value System.String @@ -19997,15 +21063,11 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - mfa + + Attribute2_name - If MFA should be requried to authenticate to the RADIUS Server + Enter an attribute name - - DISABLED - ENABLED - System.String System.String @@ -20013,15 +21075,11 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - userLockoutAction + + Attribute2_value - The behavior when user accounts get locked out + Enter an attribute value - - MAINTAIN - REMOVE - System.String System.String @@ -20029,110 +21087,35 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - userPasswordExpirationAction + + NumberOfAttributes - The behavior when user accounts expire + The number of RADIUS reply attributes you wish to add to a user group. + If an attributes exists with a name that matches the new attribute then the existing attribute will be updated. + Based on the NumberOfAttributes value two Dynamic Parameters will be created for each Attribute: Attribute_name and Attribute_value with an associated number. + See an example for working with Custom Attribute in EXAMPLE 3 above. + Attributes must be valid RADIUS attributes. Find a list of valid RADIUS attributes within the dictionary files of this repro broken down by vendor: github.com/FreeRADIUS/freeradius-server/tree/v3.0.x/share + If an invalid attribute is configured on a user group this will prevent users within this group from being able to authenticate via RADIUS until the invalid attribute is removed. - - MAINTAIN - REMOVE - - System.String + System.Int32 - System.String + System.Int32 None + - Force + VLAN - Bypass user prompts and dynamic ValidateSet. - - - System.Management.Automation.SwitchParameter - - - False - - - - - Set-JCRadiusServer - - Name - - The name of the object. - - System.String[] - - System.String[] - - - None - - - newName - - The new name of the Radius Server. - - System.String - - System.String - - - None - - - networkSourceIp - - The ip of the new Radius Server. - - System.String - - System.String - - - None - - - sharedSecret - - The shared secret for the new Radius Server. - - System.String - - System.String - - - None - - - mfa - - If MFA should be requried to authenticate to the RADIUS Server - - - DISABLED - ENABLED - - System.String - - System.String - - - None - - - userLockoutAction - - The behavior when user accounts get locked out + By specifying the '-VLAN' parameter three radius attributes are added or updated on the target user group. + These attributes and values are are: + name value + ---- ----- + Tunnel-Medium-Type IEEE-802 + Tunnel-Type VLAN + Tunnel-Private-Group-Id VALUE of -VLAN The value specified for the '-VLAN' parameter is populated for the value of Tunnel-Private-Group-Id . - - MAINTAIN - REMOVE - System.String System.String @@ -20140,14 +21123,43 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - userPasswordExpirationAction + + VLANTag - The behavior when user accounts expire + Specifies the VLAN id which is applied to all attribute names. - MAINTAIN - REMOVE + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 System.String @@ -20156,49 +21168,25 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Force - - Bypass user prompts and dynamic ValidateSet. - - - System.Management.Automation.SwitchParameter - - - False - - - - Force - - Bypass user prompts and dynamic ValidateSet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Id + + Attribute1_name - The unique id of the object. + Enter an attribute name - System.String[] + System.String - System.String[] + System.String None - - mfa + + Attribute1_value - If MFA should be requried to authenticate to the RADIUS Server + Enter an attribute value System.String @@ -20207,22 +21195,22 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Name + + Attribute2_name - The name of the object. + Enter an attribute name - System.String[] + System.String - System.String[] + System.String None - - networkSourceIp + + Attribute2_value - The ip of the new Radius Server. + Enter an attribute value System.String @@ -20231,10 +21219,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - newName + + GroupName - The new name of the Radius Server. + The JumpCloud user group to add or update the specified Radius reply attributes on. System.String @@ -20243,23 +21231,34 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - - sharedSecret + + NumberOfAttributes - The shared secret for the new Radius Server. + The number of RADIUS reply attributes you wish to add to a user group. + If an attributes exists with a name that matches the new attribute then the existing attribute will be updated. + Based on the NumberOfAttributes value two Dynamic Parameters will be created for each Attribute: Attribute_name and Attribute_value with an associated number. + See an example for working with Custom Attribute in EXAMPLE 3 above. + Attributes must be valid RADIUS attributes. Find a list of valid RADIUS attributes within the dictionary files of this repro broken down by vendor: github.com/FreeRADIUS/freeradius-server/tree/v3.0.x/share + If an invalid attribute is configured on a user group this will prevent users within this group from being able to authenticate via RADIUS until the invalid attribute is removed. - System.String + System.Int32 - System.String + System.Int32 None - - userLockoutAction + + + VLAN - The behavior when user accounts get locked out + By specifying the '-VLAN' parameter three radius attributes are added or updated on the target user group. + These attributes and values are are: + name value + ---- ----- + Tunnel-Medium-Type IEEE-802 + Tunnel-Type VLAN + Tunnel-Private-Group-Id VALUE of -VLAN The value specified for the '-VLAN' parameter is populated for the value of Tunnel-Private-Group-Id . System.String @@ -20268,10 +21267,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - userPasswordExpirationAction + + VLANTag - The behavior when user accounts expire + Specifies the VLAN id which is applied to all attribute names. System.String @@ -20284,15 +21283,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.Management.Automation.SwitchParameter - - - - - - - - System.String[] + System.String @@ -20300,7 +21291,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.String + System.Int32 @@ -20325,186 +21316,97 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli -------------------------- Example 1 -------------------------- - PS C:\> Set-JCRadiusServer -Id:('5d6802c46eb05c5971151558') -newName:('RadiusServer2') -networkSourceIp:('111.111.111.111') -sharedSecret:('dUtU9FDvPc8Wdvoc#jKmZr7aJSXv5pR') + Set-JCRadiusReplyAttribute -GroupName "BoulderOffice" -VLAN 24 - Update a radius server by Id from a JumpCloud tenet. + By specifying the '-VLAN' parameter three radius attributes are updated on the JumpCloud user group 'BoulderOffice'. + These attributes are: + name value ---- ----- Tunnel-Medium-Type IEEE-802 Tunnel-Type VLAN Tunnel-Private-Group-Id 24 + The value specified for the '-VLAN' parameter is populated for the value of Tunnel-Private-Group-Id . -------------------------- Example 2 -------------------------- - PS C:\> Set-JCRadiusServer -Name:('RadiusServer1') -newName:('RadiusServer2') -networkSourceIp:('111.111.111.111') -sharedSecret:('MzQDUuDhqhSgMoryi#fNpB2wEpvu8U1') + Set-JCRadiusReplyAttribute -GroupName "BoulderOffice" -VLAN 24 -VLANTag 4 - Update a radius server by Name from a JumpCloud tenet. + By specifying the '-VLAN' parameter three radius attributes are update on the JumpCloud user group 'BoulderOffice'. The use of '-VLANTag' appends each VLAN attribute name with a colon and the tag number specified. + These attributes are: + name value ---- ----- Tunnel-Medium-Type:4 IEEE-802 Tunnel-Type:4 VLAN Tunnel-Private-Group-Id:4 24 -------------------------- Example 3 -------------------------- - PS C:\> Get-JCRadiusServer -Id:('5d6802c46eb05c5971151558') | Set-JCRadiusServer -networkSourceIp:('111.111.111.111') + Set-JCRadiusReplyAttribute -GroupName "BoulderOffice" -NumberOfAttributes 2 -Attribute1_name "Session-Timeout" -Attribute1_value 200 -Attribute2_name "Termination-Action" -Attribute2_value 2 - Update the networkSourceIp of a radius server by Id from a JumpCloud tenet. - - + Updates two Radius attributes to the JumpCloud user group 'BoulderOffice'. + These attribute are: + name value ---- ----- Session-Timeout 200 Termination-Action 2 + The parameter '-NumberOfAttributes' is a dynamic parameter that generates two required parameters for each custom attribute specified. In this example these parameters are -Attribute1_name,-Attribute1_value, -Attribute2_name and -Attribute2_value. + If the Radius reply attribute being updated already exists on the target user group the value for this attribute is updated. If the Radius reply attribute does not exist the attribute is added. + + Online Version: - https://github.com/TheJumpCloud/support/wiki/Set-JCRadiusServer + https://github.com/TheJumpCloud/support/wiki/Set-JCRadiusReplyAttribute - Set-JCSettingsFile + Set-JCRadiusServer Set - JCSettingsFile + JCRadiusServer - Updates the JumpCloud Module Settings File + Updates a JumpCloud radius server. - The Set-JCSettingsFile function updates an the JumpCloud Module settings file. + Use this function to update a radius server in a JumpCloud tenet. - Set-JCSettingsFile - - JCEnvironmentLocation + Set-JCRadiusServer + + Id - sets the System.Management.Automation.PSCustomObject Location=@{write=True; copy=True; value=STANDARD} settings for the System.Management.Automation.PSCustomObject JCEnvironment=@{Location=} feature + The unique id of the object. - System.Management.Automation.PSObject + System.String[] - System.Management.Automation.PSObject + System.String[] None - - moduleBannerMessageCount + + newName - sets the messageCount settings for the moduleBanner feature + The new name of the Radius Server. - System.Management.Automation.PSObject + System.String - System.Management.Automation.PSObject + System.String None - - parallelOverride + + networkSourceIp - sets the Override settings for the parallel feature + The ip of the new Radius Server. - System.Management.Automation.PSObject + System.String - System.Management.Automation.PSObject + System.String None - - - - - - JCEnvironmentLocation - - sets the System.Management.Automation.PSCustomObject Location=@{write=True; copy=True; value=STANDARD} settings for the System.Management.Automation.PSCustomObject JCEnvironment=@{Location=} feature - - System.Management.Automation.PSObject - - System.Management.Automation.PSObject - - - None - - - moduleBannerMessageCount - - sets the messageCount settings for the moduleBanner feature - - System.Management.Automation.PSObject - - System.Management.Automation.PSObject - - - None - - - parallelOverride - - sets the Override settings for the parallel feature - - System.Management.Automation.PSObject - - System.Management.Automation.PSObject - - - None - - - - - - - None - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> Set-JCSettingsFile -ParallelOverride $true - - Disables parallel processing of results in the JumpCloud PowerShell Module - - - - - - Online Version: - https://github.com/TheJumpCloud/support/wiki/ - - - - - - Set-JCSystem - Set - JCSystem - - Updates an existing JumpCloud System - - - - The Set-JCSystem function updates an existing JumpCloud System. Common use cases are updated SSH parameters and the system displayName. Actions can be completed in bulk for multiple systems by using the pipeline and Parameter Binding to query system properties with the Get-JCSystem function and then applying updates with Set-JCSystem function. - - - - Set-JCSystem - - SystemID + + sharedSecret - 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. SystemID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically by calling a JumpCloud function that returns the SystemID. This is shown in EXAMPLE 2 + The shared secret for the new Radius Server. System.String @@ -20513,58 +21415,85 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - allowMultiFactorAuthentication + + mfa - A boolean $true/$false value to allow for MFA during system login. Note this setting only applies systems running Linux or Mac. + If MFA should be requried to authenticate to the RADIUS Server - System.Boolean + + DISABLED + ENABLED + + System.String - System.Boolean + System.String None - - allowPublicKeyAuthentication + + userLockoutAction - A boolean $true/$false value to allow for public key authentication. + The behavior when user accounts get locked out - System.Boolean + + MAINTAIN + REMOVE + + System.String - System.Boolean + System.String None - - allowSshPasswordAuthentication + + userPasswordExpirationAction - A boolean $true/$false value to allow for ssh password authentication. + The behavior when user accounts expire - System.Boolean + + MAINTAIN + REMOVE + + System.String - System.Boolean + System.String None - allowSshRootLogin + Force - A boolean $true/$false value to allow for ssh root login. + Bypass user prompts and dynamic ValidateSet. - System.Boolean - System.Boolean + System.Management.Automation.SwitchParameter + + + False + + + + + Set-JCRadiusServer + + Name + + The name of the object. + + System.String[] + + System.String[] None - - description + + newName - The system description. String param to set system description + The new name of the Radius Server. System.String @@ -20573,10 +21502,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - displayName + + networkSourceIp - The system displayName. The displayName is set to the hostname of the system during agent installation. When the system hostname updates the displayName does not update. + The ip of the new Radius Server. System.String @@ -20585,86 +21514,133 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - primarySystemUser + + sharedSecret - A string value indicating a JumpCloud users email, username or userID. This will add the user to the device associations + The shared secret for the new Radius Server. - System.Object + System.String - System.Object + System.String None - - - systemInsights + + mfa - Setting this value to $true will enable systemInsights and collect data for this system. Setting this value to $false will disable systemInsights and data collection for the system. + If MFA should be requried to authenticate to the RADIUS Server - System.Boolean + + DISABLED + ENABLED + + System.String - System.Boolean + System.String None - - - + + userLockoutAction + + The behavior when user accounts get locked out + + + MAINTAIN + REMOVE + + System.String + + System.String + + + None + + + userPasswordExpirationAction + + The behavior when user accounts expire + + + MAINTAIN + REMOVE + + System.String + + System.String + + + None + + + Force + + Bypass user prompts and dynamic ValidateSet. + + + System.Management.Automation.SwitchParameter + + + False + + + + + - allowMultiFactorAuthentication + Force - A boolean $true/$false value to allow for MFA during system login. Note this setting only applies systems running Linux or Mac. + Bypass user prompts and dynamic ValidateSet. - System.Boolean + System.Management.Automation.SwitchParameter - System.Boolean + System.Management.Automation.SwitchParameter - None + False - - allowPublicKeyAuthentication + + Id - A boolean $true/$false value to allow for public key authentication. + The unique id of the object. - System.Boolean + System.String[] - System.Boolean + System.String[] None - - allowSshPasswordAuthentication + + mfa - A boolean $true/$false value to allow for ssh password authentication. + If MFA should be requried to authenticate to the RADIUS Server - System.Boolean + System.String - System.Boolean + System.String None - - allowSshRootLogin + + Name - A boolean $true/$false value to allow for ssh root login. + The name of the object. - System.Boolean + System.String[] - System.Boolean + System.String[] None - - description + + networkSourceIp - The system description. String param to set system description + The ip of the new Radius Server. System.String @@ -20673,10 +21649,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - displayName + + newName - The system displayName. The displayName is set to the hostname of the system during agent installation. When the system hostname updates the displayName does not update. + The new name of the Radius Server. System.String @@ -20685,23 +21661,23 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - primarySystemUser + + + sharedSecret - A string value indicating a JumpCloud users email, username or userID. This will add the user to the device associations + The shared secret for the new Radius Server. - System.Object + System.String - System.Object + System.String None - - - SystemID + + userLockoutAction - 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. SystemID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically by calling a JumpCloud function that returns the SystemID. This is shown in EXAMPLE 2 + The behavior when user accounts get locked out System.String @@ -20710,14 +21686,14 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - systemInsights + + userPasswordExpirationAction - Setting this value to $true will enable systemInsights and collect data for this system. Setting this value to $false will disable systemInsights and data collection for the system. + The behavior when user accounts expire - System.Boolean + System.String - System.Boolean + System.String None @@ -20726,7 +21702,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.String + System.Management.Automation.SwitchParameter @@ -20734,7 +21710,15 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.Boolean + System.String[] + + + + + + + + System.String @@ -20759,183 +21743,130 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli -------------------------- Example 1 -------------------------- - PS C:\> Set-JCSystem -SystemID 5n0795a712704la4eve154r -displayName 'WorkStation001' + PS C:\> Set-JCRadiusServer -Id:('5d6802c46eb05c5971151558') -newName:('RadiusServer2') -networkSourceIp:('111.111.111.111') -sharedSecret:('dUtU9FDvPc8Wdvoc#jKmZr7aJSXv5pR') - This example updates the displayName of the System with SystemID '5n0795a712704la4eve154r' to 'WorkStation001'. Note the JumpCloud displayName is simply a text field and does not have any system impact. + Update a radius server by Id from a JumpCloud tenet. -------------------------- Example 2 -------------------------- - PS C:\> Get-JCSystem | Where-Object os -Like *Mac* | Set-JCSystem -allowMultiFactorAuthentication $true + PS C:\> Set-JCRadiusServer -Name:('RadiusServer1') -newName:('RadiusServer2') -networkSourceIp:('111.111.111.111') -sharedSecret:('MzQDUuDhqhSgMoryi#fNpB2wEpvu8U1') - This example updates all Systems with an operating system like 'Mac' and allows for MFA login. + Update a radius server by Name from a JumpCloud tenet. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-JCRadiusServer -Id:('5d6802c46eb05c5971151558') | Set-JCRadiusServer -networkSourceIp:('111.111.111.111') + + Update the networkSourceIp of a radius server by Id from a JumpCloud tenet. Online Version: - https://github.com/TheJumpCloud/support/wiki/Set-JCSystem + https://github.com/TheJumpCloud/support/wiki/Set-JCRadiusServer - Set-JCSystemUser + Set-JCSettingsFile Set - JCSystemUser + JCSettingsFile - Updates the permissions of a JumpCloud user on a JumpCloud system + Updates the JumpCloud Module Settings File - The Set-JCSystemUser function updates the permissions between a JumpCloud user and a JumpCloud system. The command can be used to add or remove Administrator permissions for a JumpCloud user on a JumpCloud managed system. + The Set-JCSettingsFile function updates an the JumpCloud Module settings file. - Set-JCSystemUser - - Administrator - - A boolean $true/$false value to add or remove Administrator permissions on a target JumpCloud system - - System.Boolean - - System.Boolean - - - None - - - - SystemID - - The _id of the JumpCloud System which you want to modify the permissions on - - System.String - - System.String - - - None - - - UserID + Set-JCSettingsFile + + JCEnvironmentLocation - The _id of the JumpCloud User whose system permissions will be modified + Sets the Environment Location settings to allow connection to the region-specific datacenters (https://jumpcloud.com/support/jumpcloud-data-centers-login-urls-and-service-endpoints) - System.String + System.Management.Automation.PSObject - System.String + System.Management.Automation.PSObject None - - - Set-JCSystemUser - - Username + + moduleBannerMessageCount - The Username of the JumpCloud User whose system permissions will be modified + sets the messageCount settings for the moduleBanner feature - System.String + System.Management.Automation.PSObject - System.String + System.Management.Automation.PSObject None - - Administrator + + parallelOverride - A boolean $true/$false value to add or remove Administrator permissions on a target JumpCloud system + sets the Override settings for the parallel feature - System.Boolean + System.Management.Automation.PSObject - System.Boolean + System.Management.Automation.PSObject None - - SystemID - - The _id of the JumpCloud System which you want to modify the permissions on - - System.String - - System.String - - - None - - - Administrator + + JCEnvironmentLocation - A boolean $true/$false value to add or remove Administrator permissions on a target JumpCloud system + Sets the Environment Location settings to allow connection to the region-specific datacenters (https://jumpcloud.com/support/jumpcloud-data-centers-login-urls-and-service-endpoints) - System.Boolean + System.Management.Automation.PSObject - System.Boolean + System.Management.Automation.PSObject None - - - SystemID + + moduleBannerMessageCount - The _id of the JumpCloud System which you want to modify the permissions on + sets the messageCount settings for the moduleBanner feature - System.String + System.Management.Automation.PSObject - System.String + System.Management.Automation.PSObject None - - UserID - - The _id of the JumpCloud User whose system permissions will be modified - - System.String - - System.String - - - None - - - Username + + parallelOverride - The Username of the JumpCloud User whose system permissions will be modified + sets the Override settings for the parallel feature - System.String + System.Management.Automation.PSObject - System.String + System.Management.Automation.PSObject None + - System.String - - - - - - - - System.Boolean + None @@ -20960,64 +21891,57 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli -------------------------- Example 1 -------------------------- - PS C:\> Set-JCSystemUser -SystemID 5n0795a712704la4eve154r -Username cclemons -Administrator $True + PS C:\> Set-JCSettingsFile -ParallelOverride $true - Sets user with username 'cclemons' as an Administrator on the JumpCloud system with SystemID '5n0795a712704la4eve154r' + Disables parallel processing of results in the JumpCloud PowerShell Module -------------------------- Example 2 -------------------------- - PS C:\> Set-JCSystemUser -SystemID 5n0795a712704la4eve154r -Username cclemons -Administrator $False - - Sets user with username 'cclemons' as a standard user on the JumpCloud system with SystemID '5n0795a712704la4eve154r' - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-JCSystemUser 5n0795a712704la4eve154r | Set-JCSystemUser -Administrator $False + PS C:\> Set-JCSettingsFile -JCEnvironmentLocation "EU" - Gets all users bound to JumpCloud system with SystemID '5n0795a712704la4eve154r' and sets them as standard users. Note any users who have Global Administrator permissions would keep their Administrator permissions. To find users with Global Administrator permissions run the command: 'Get-JCUser | Where-Object sudo -EQ $true' + Changes the location for the PowerShell Module to use the EU Datacenter Online Version: - https://github.com/TheJumpCloud/support/wiki/Set-JCSystemUser + https://github.com/TheJumpCloud/support/wiki/ - Set-JCUser + Set-JCSystem Set - JCUser + JCSystem - Updates an existing JumpCloud User + Updates an existing JumpCloud System - The Set-JCUser function updates an existing JumpCloud user account. Common use cases are account locks and unlocks, email address updates, or custom attribute modifications. Actions can be completed in bulk for multiple users by using the pipeline and Parameter Binding to query users with the Get-JCUser function and then applying updates with Set-JCUser function. + The Set-JCSystem function updates an existing JumpCloud System. Common use cases are updated SSH parameters and the system displayName. Actions can be completed in bulk for multiple systems by using the pipeline and Parameter Binding to query system properties with the Get-JCSystem function and then applying updates with Set-JCSystem function. - Set-JCUser - - account_locked + Set-JCSystem + + SystemID - unlock or lock a users JumpCloud account + 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. SystemID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically by calling a JumpCloud function that returns the SystemID. This is shown in EXAMPLE 2 - System.Boolean + System.String - System.Boolean + System.String None - allow_public_key + allowMultiFactorAuthentication - A boolean $true/$false value for allowing pubic key authentication + A boolean $true/$false value to allow for MFA during system login. Note this setting only applies systems running Linux or Mac. System.Boolean @@ -21027,108 +21951,37 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - alternateEmail - - The alternateEmail for the user - - System.String - - System.String - - - None - - - Attribute1_name - - Enter an attribute name - - System.String - - System.String - - - None - - - Attribute1_value - - Enter an attribute value - - System.String - - System.String - - - None - - - Attribute2_name - - Enter an attribute name - - System.String - - System.String - - - None - - - Attribute2_value - - Enter an attribute value - - System.String - - System.String - - - None - - - 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 'RemoveCustomAttribute' Parameter - - - System.Management.Automation.SwitchParameter - - - False - - - company + allowPublicKeyAuthentication - Specifies the user's company. The LDAP displayName of this property is company. + A boolean $true/$false value to allow for public key authentication. - System.String + System.Boolean - System.String + System.Boolean None - costCenter + allowSshPasswordAuthentication - Specifies the user's costCenter. The LDAP displayName of this property is businessCategory. + A boolean $true/$false value to allow for ssh password authentication. - System.String + System.Boolean - System.String + System.Boolean None - department + allowSshRootLogin - Specifies the user's department. The LDAP displayName of this property is departmentNumber. + A boolean $true/$false value to allow for ssh root login. - System.String + System.Boolean - System.String + System.Boolean None @@ -21136,43 +21989,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli description - Specifies the user's description. The LDAP displayName of this property is description. This field is limited to 1024 characters. - - System.String - - System.String - - - None - - - displayname - - Specifies the user's preferredName. The LDAP displayName of this property is displayName. - - System.String - - System.String - - - None - - - email - - The email address for the user. This must be a unique value. - - System.String - - System.String - - - None - - - employeeIdentifier - - Specifies the user's employeeIdentifier. The LDAP displayName of this property is employeeNumber. Note this field must be unique per user. + The system description. String param to set system description System.String @@ -21182,9 +21999,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - employeeType + displayName - Specifies the user's employeeType. The LDAP displayName of this property is employeeType. + The system displayName. The displayName is set to the hostname of the system during agent installation. When the system hostname updates the displayName does not update. System.String @@ -21193,22 +22010,23 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - enable_managed_uid + + primarySystemUser - A boolean $true/$false value for enabling managed uid + A string value indicating a JumpCloud users email, username or userID. This will add the user to the device associations - System.Boolean + System.Object - System.Boolean + System.Object None + - enable_user_portal_multifactor + systemInsights - A boolean $true/$false value for enabling MFA at the user portal + Setting this value to $true will enable systemInsights and collect data for this system. Setting this value to $false will disable systemInsights and data collection for the system. System.Boolean @@ -21217,58 +22035,208 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - EnrollmentDays - - Number of days to allow for MFA enrollment. - - System.Int32 - - System.Int32 - - - None - - - external_dn - - The distinguished name of the AD domain (ADB Externally managed users only) - - System.String - - System.String - - - None - - - external_source_type - - The externally managed user source type (ADB Externally managed users only) - - System.String - - System.String - - - None - - - externally_managed + + + + + allowMultiFactorAuthentication + + A boolean $true/$false value to allow for MFA during system login. Note this setting only applies systems running Linux or Mac. + + System.Boolean + + System.Boolean + + + None + + + allowPublicKeyAuthentication + + A boolean $true/$false value to allow for public key authentication. + + System.Boolean + + System.Boolean + + + None + + + allowSshPasswordAuthentication + + A boolean $true/$false value to allow for ssh password authentication. + + System.Boolean + + System.Boolean + + + None + + + allowSshRootLogin + + A boolean $true/$false value to allow for ssh root login. + + System.Boolean + + System.Boolean + + + None + + + description + + The system description. String param to set system description + + System.String + + System.String + + + None + + + displayName + + The system displayName. The displayName is set to the hostname of the system during agent installation. When the system hostname updates the displayName does not update. + + System.String + + System.String + + + None + + + primarySystemUser + + A string value indicating a JumpCloud users email, username or userID. This will add the user to the device associations + + System.Object + + System.Object + + + None + + + + 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. SystemID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically by calling a JumpCloud function that returns the SystemID. This is shown in EXAMPLE 2 + + System.String + + System.String + + + None + + + systemInsights + + Setting this value to $true will enable systemInsights and collect data for this system. Setting this value to $false will disable systemInsights and data collection for the system. + + System.Boolean + + System.Boolean + + + None + + + + + + System.String + + + + + + + + System.Boolean + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Set-JCSystem -SystemID 5n0795a712704la4eve154r -displayName 'WorkStation001' + + This example updates the displayName of the System with SystemID '5n0795a712704la4eve154r' to 'WorkStation001'. Note the JumpCloud displayName is simply a text field and does not have any system impact. + + + + -------------------------- Example 2 -------------------------- + PS C:\> Get-JCSystem | Where-Object os -Like *Mac* | Set-JCSystem -allowMultiFactorAuthentication $true + + This example updates all Systems with an operating system like 'Mac' and allows for MFA login. + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/Set-JCSystem + + + + + + Set-JCSystemGroup + Set + JCSystemGroup + + This endpoint allows you to do a full set of the System Group. + See the \ Dynamic Group Configuration KB article\ (https://jumpcloud.com/support/configure-dynamic-device-groups)for more details on maintaining a Dynamic Group. + + + + This endpoint allows you to do a full set of the System Group. + See the \ Dynamic Group Configuration KB article\ (https://jumpcloud.com/support/configure-dynamic-device-groups)for more details on maintaining a Dynamic Group. + + + + Set-JCSystemGroup + + Attributes - A boolean $true/$false value for enabling externally_managed + The graph attributes. - System.Boolean + System.Collections.Hashtable - System.Boolean + System.Collections.Hashtable None - - firstname + + Description - The first name of the user + Description of a System Group System.String @@ -21277,10 +22245,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - home_country + + Email - Specifies the user's country on the home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + Email address of a System Group System.String @@ -21289,10 +22257,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - home_locality + + Id - Specifies the user's city on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + ObjectID of the System Group. System.String @@ -21301,34 +22269,34 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - home_number + + MemberQueryExemptions - Specifies the user's home number. The LDAP displayName of this property is homePhone. + Array of GraphObjects exempted from the query - System.String + JumpCloud.SDK.V2.Models.IGraphObject[] - System.String + JumpCloud.SDK.V2.Models.IGraphObject[] None - - home_poBox + + MemberQueryFilters - Specifies the user's poBox on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. - System.String + System.String[] - System.String + System.String[] None - - home_postalCode + + MemberQuerySearchFilters - Specifies the user's postalCode on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. System.String @@ -21337,10 +22305,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - home_region + + MemberQueryType - Specifies the user's state on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + . System.String @@ -21349,10 +22317,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - home_streetAddress + + MembershipMethod - Specifies the user's streetAddress on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. System.String @@ -21361,22 +22329,21 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - jobTitle + + MemberSuggestionsNotify - Specifies the user's job title. The LDAP displayName of this property is title. + True if notification emails are to be sent for membership suggestions. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - lastname + + Name - The last name of the user + Display name of a System Group. System.String @@ -21385,58 +22352,48 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - ldap_binding_user + + + Confirm - A boolean $true/$false value to enable the user as an LDAP binding user + Prompts you for confirmation before running the cmdlet. - System.Boolean - System.Boolean + System.Management.Automation.SwitchParameter - None - - - location - - Specifies the user's home location. The LDAP displayName of this property is physicalDeliveryOfficeName. - - System.String - - System.String - - - None + False - - managedAppleId + + WhatIf - The managedAppleId for the user + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - manager + + + Set-JCSystemGroup + + Attributes - The manager for the user + The graph attributes. - System.Object + System.Collections.Hashtable - System.Object + System.Collections.Hashtable None - - middlename + + Description - Specifies the user's home location. The LDAP displayName of this property is initials. + Description of a System Group System.String @@ -21445,10 +22402,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - mobile_number + + Email - Specifies the user's mobile number. The LDAP displayName of this property is mobile. + Email address of a System Group System.String @@ -21457,59 +22414,46 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - NumberOfCustomAttributes - - If you intend to update a user with existing Custom Attributes or add new Custom Attributes you must declare how many Custom Attributes you intend to update or add. If an Custom Attribute exists with a name that matches the new attribute then the existing attribute will be updated. Based on the NumberOfCustomAttributes value two Dynamic Parameters will be created for each Custom Attribute: Attribute_name and Attribute_value with an associated number. See an example for working with Custom Attribute in EXAMPLE 4 - - System.Int32 - - System.Int32 - - - None - - - password + + InputObject - The password for the user + Identity Parameter - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity None - - password_never_expires + + MemberQueryExemptions - A boolean $true/$false value for enabling password_never_expires + Array of GraphObjects exempted from the query - System.Boolean + JumpCloud.SDK.V2.Models.IGraphObject[] - System.Boolean + JumpCloud.SDK.V2.Models.IGraphObject[] None - - passwordless_sudo + + MemberQueryFilters - A boolean $true/$false value if you want to enable passwordless_sudo + For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. - System.Boolean + System.String[] - System.Boolean + System.String[] None - - - recoveryEmail + + MemberQuerySearchFilters - The recoveryEmail for the user + For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. System.String @@ -21518,15 +22462,11 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - state + + MemberQueryType - A string value for putting the account into a staged, activated or suspended state + . - - ACTIVATED - SUSPENDED - System.String System.String @@ -21534,50 +22474,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - sudo - - A boolean $true/$false value if you want to enable the user to be an administrator on any and all systems the user is bound to. - - System.Boolean - - System.Boolean - - - None - - - unix_guid - - The unix_guid for the user. Note this value must be a number. - - System.Int32 - - System.Int32 - - - None - - - unix_uid - - The unix_uid for the user. Note this value must be an number. - - System.Int32 - - System.Int32 - - - None - - - UserID + + MembershipMethod - The _id of the User which you want to modify. - To find a JumpCloud UserID run the command: - PS C:\> Get-JCUser | Select username, _id - The UserID will be the 24 character string populated for the _id field. - UserID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically using the Get-JCUser function before calling Add-JCUserGroupMember. This is shown in EXAMPLES 3, 4, and 5. + The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. System.String @@ -21586,22 +22486,21 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_country + + MemberSuggestionsNotify - Specifies the user's country on the work address object. This property is nested within the LDAP property with the displayName postalAddress. + True if notification emails are to be sent for membership suggestions. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - work_fax_number + + Name - Specifies the user's work fax number. The LDAP displayName of this property is facsimileTelephoneNumber. + Display name of a System Group. System.String @@ -21610,46 +22509,48 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_locality + + + Confirm - Specifies the user's city on their work address object. The LDAP displayName of this property is l. + Prompts you for confirmation before running the cmdlet. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - work_mobile_number + + WhatIf - Specifies the user's work mobile number. The LDAP displayName of this property is pager. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - work_number + + + Set-JCSystemGroup + + Body - Specifies the user's work number. The LDAP displayName of this property is telephoneNumber. + SystemGroupPut - System.String + JumpCloud.SDK.V2.Models.ISystemGroupPut - System.String + JumpCloud.SDK.V2.Models.ISystemGroupPut None - - work_poBox + + Id - Specifies the user's poBox on their work address object. The LDAP displayName of this property is postOfficeBox. + ObjectID of the System Group. System.String @@ -21658,97 +22559,362 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_postalCode + + + Confirm - Specifies the user's postalCode on their work address object. The LDAP displayName of this property is postalCode. + Prompts you for confirmation before running the cmdlet. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - work_region + + WhatIf - Specifies the user's state on their work address object. This property is nested within the LDAP property with the displayName postalAddress. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.String - System.String + System.Management.Automation.SwitchParameter - None + False - - work_streetAddress + + + Set-JCSystemGroup + + Body - Specifies the user's streetAddress on their work address object. This property is nested within the LDAP property with the displayName postalAddress. + SystemGroupPut - System.String + JumpCloud.SDK.V2.Models.ISystemGroupPut - System.String + JumpCloud.SDK.V2.Models.ISystemGroupPut None - - - Set-JCUser - - Username + + InputObject - The Username of the JumpCloud user you wish to modify + Identity Parameter - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity None - - account_locked + + + Confirm - unlock or lock a users JumpCloud account + Prompts you for confirmation before running the cmdlet. - System.Boolean - System.Boolean + System.Management.Automation.SwitchParameter - None + False - - allow_public_key + + WhatIf - A boolean $true/$false value for allowing pubic key authentication + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.Boolean - System.Boolean + System.Management.Automation.SwitchParameter - None + False - - alternateEmail - - The alternateEmail for the user - - System.String + + + + + Attributes + + The graph attributes. + + System.Collections.Hashtable + + System.Collections.Hashtable + + + None + + + Body + + SystemGroupPut + + JumpCloud.SDK.V2.Models.ISystemGroupPut + + JumpCloud.SDK.V2.Models.ISystemGroupPut + + + None + + + Description + + Description of a System Group + + System.String + + System.String + + + None + + + Email + + Email address of a System Group + + System.String + + System.String + + + None + + + Id + + ObjectID of the System Group. + + System.String + + System.String + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + MemberQueryExemptions + + Array of GraphObjects exempted from the query + + JumpCloud.SDK.V2.Models.IGraphObject[] + + JumpCloud.SDK.V2.Models.IGraphObject[] + + + None + + + MemberQueryFilters + + For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + + System.String[] + + System.String[] + + + None + + + MemberQuerySearchFilters + + For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + + System.String + + System.String + + + None + + + MemberQueryType + + . + + System.String + + System.String + + + None + + + MembershipMethod + + The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + + System.String + + System.String + + + None + + + MemberSuggestionsNotify + + True if notification emails are to be sent for membership suggestions. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Display name of a System Group. + + System.String + + System.String + + + None + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + + + + + + JumpCloud.SDK.V2.Models.ISystemGroupPut + + + + + + + + + + JumpCloud.SDK.V2.Models.ISystemGroup + + + + + + + + + COMPLEX PARAMETER PROPERTIES + To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + BODY <ISystemGroupPut>: SystemGroupPut Name <String>: Display name of a System Group. [Attributes <IGraphAttributes>]: The graph attributes. [(Any) <Object>]: This indicates any property can be added to this object. [Description <String>]: Description of a System Group [Email <String>]: Email address of a System Group [MemberQueryExemptions <List<IGraphObject>>]: Array of GraphObjects exempted from the query Id <String>: The ObjectID of the graph object. Type <String>: The type of graph object. [Attributes <IGraphAttributes>]: The graph attributes. [MemberQueryFilters <List<String>>]: For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. [MemberQuerySearchFilters <String>]: For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. [MemberQueryType <String>]: [MemberSuggestionsNotify <Boolean?>]: True if notification emails are to be sent for membership suggestions. [MembershipMethod <String>]: The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED. Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices). Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + INPUTOBJECT <IJumpCloudApiIdentity>: Identity Parameter [AccountId <String>]: [ActivedirectoryId <String>]: [AdministratorId <String>]: [AgentId <String>]: [AppleMdmId <String>]: [ApplicationId <String>]: ObjectID of the Application. [ApprovalFlowId <String>]: [CommandId <String>]: ObjectID of the Command. [CustomEmailType <String>]: [DeviceId <String>]: [GroupId <String>]: ObjectID of the Policy Group. [GsuiteId <String>]: ObjectID of the G Suite instance. [Id <String>]: ObjectID of this Active Directory instance. [JobId <String>]: [LdapserverId <String>]: ObjectID of the LDAP Server. [Office365Id <String>]: ObjectID of the Office 365 instance. [PolicyId <String>]: ObjectID of the Policy. [ProviderId <String>]: [PushEndpointId <String>]: [RadiusserverId <String>]: ObjectID of the Radius Server. [SoftwareAppId <String>]: ObjectID of the Software App. [SystemId <String>]: ObjectID of the System. [UserId <String>]: ObjectID of the User. [WorkdayId <String>]: + MEMBERQUERYEXEMPTIONS <IGraphObject[]>: Array of GraphObjects exempted from the query Id <String>: The ObjectID of the graph object. Type <String>: The type of graph object. [Attributes <IGraphAttributes>]: The graph attributes. [(Any) <Object>]: This indicates any property can be added to this object. + + + + + -------------------------- EXAMPLE 1 -------------------------- + Set-JCSystemGroup -Id:(<string>) -Body:(<JumpCloud.SDK.V2.Models.SystemGroupPut>) + + --- + Attributes JumpCloud.SDK.V2.Models.GraphAttributes Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String Type String + + + + -------------------------- EXAMPLE 2 -------------------------- + Set-JCSystemGroup -Id:(<string>) -Name:(<string>) -Attributes:(<hashtable>) -Description:(<string>) -Email:(<string>) -MemberQueryExemptions:(<JumpCloud.SDK.V2.Models.GraphObject[]>) -MemberQueryFilters:(<JumpCloud.SDK.V2.Models.Any[]>) -MemberQueryType:(<string>) -MemberSuggestionsNotify:(<switch>) -MembershipMethod:(<string>) + + --- + Attributes JumpCloud.SDK.V2.Models.GraphAttributes Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String Type String + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/ + + + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkSystemGroup.md + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkSystemGroup.md + + + + + + Set-JCSystemUser + Set + JCSystemUser + + Updates the permissions of a JumpCloud user on a JumpCloud system + + + + The Set-JCSystemUser function updates the permissions between a JumpCloud user and a JumpCloud system. The command can be used to add or remove Administrator permissions for a JumpCloud user on a JumpCloud managed system. + + + + Set-JCSystemUser + + Administrator + + A boolean $true/$false value to add or remove Administrator permissions on a target JumpCloud system + + System.Boolean - System.String + System.Boolean None - - Attribute1_name + + + SystemID - Enter an attribute name + The _id of the JumpCloud System which you want to modify the permissions on System.String @@ -21758,9 +22924,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - Attribute1_value + UserID - Enter an attribute value + The _id of the JumpCloud User whose system permissions will be modified System.String @@ -21769,10 +22935,13 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Attribute2_name + + + Set-JCSystemUser + + Username - Enter an attribute name + The Username of the JumpCloud User whose system permissions will be modified System.String @@ -21782,7 +22951,235 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - Attribute2_value + Administrator + + A boolean $true/$false value to add or remove Administrator permissions on a target JumpCloud system + + System.Boolean + + System.Boolean + + + None + + + + SystemID + + The _id of the JumpCloud System which you want to modify the permissions on + + System.String + + System.String + + + None + + + + + + Administrator + + A boolean $true/$false value to add or remove Administrator permissions on a target JumpCloud system + + System.Boolean + + System.Boolean + + + None + + + + SystemID + + The _id of the JumpCloud System which you want to modify the permissions on + + System.String + + System.String + + + None + + + UserID + + The _id of the JumpCloud User whose system permissions will be modified + + System.String + + System.String + + + None + + + Username + + The Username of the JumpCloud User whose system permissions will be modified + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + System.Boolean + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Set-JCSystemUser -SystemID 5n0795a712704la4eve154r -Username cclemons -Administrator $True + + Sets user with username 'cclemons' as an Administrator on the JumpCloud system with SystemID '5n0795a712704la4eve154r' + + + + -------------------------- Example 2 -------------------------- + PS C:\> Set-JCSystemUser -SystemID 5n0795a712704la4eve154r -Username cclemons -Administrator $False + + Sets user with username 'cclemons' as a standard user on the JumpCloud system with SystemID '5n0795a712704la4eve154r' + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-JCSystemUser 5n0795a712704la4eve154r | Set-JCSystemUser -Administrator $False + + Gets all users bound to JumpCloud system with SystemID '5n0795a712704la4eve154r' and sets them as standard users. Note any users who have Global Administrator permissions would keep their Administrator permissions. To find users with Global Administrator permissions run the command: 'Get-JCUser | Where-Object sudo -EQ $true' + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/Set-JCSystemUser + + + + + + Set-JCUser + Set + JCUser + + Updates an existing JumpCloud User + + + + The Set-JCUser function updates an existing JumpCloud user account. Common use cases are account locks and unlocks, email address updates, or custom attribute modifications. Actions can be completed in bulk for multiple users by using the pipeline and Parameter Binding to query users with the Get-JCUser function and then applying updates with Set-JCUser function. + + + + Set-JCUser + + account_locked + + unlock or lock a users JumpCloud account + + System.Boolean + + System.Boolean + + + None + + + allow_public_key + + A boolean $true/$false value for allowing pubic key authentication + + System.Boolean + + System.Boolean + + + None + + + alternateEmail + + The alternateEmail for the user + + System.String + + System.String + + + None + + + Attribute1_name + + Enter an attribute name + + System.String + + System.String + + + None + + + Attribute1_value + + Enter an attribute value + + System.String + + System.String + + + None + + + Attribute2_name + + Enter an attribute name + + System.String + + System.String + + + None + + + Attribute2_value Enter an attribute value @@ -21793,6 +23190,17 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None + + 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 'RemoveCustomAttribute' Parameter + + + System.Management.Automation.SwitchParameter + + + False + company @@ -22214,18 +23622,6 @@ 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 - - System.String[] - - System.String[] - - - None - state @@ -22278,8 +23674,24 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_country + + UserID + + The _id of the User which you want to modify. + To find a JumpCloud UserID run the command: + PS C:\> Get-JCUser | Select username, _id + The UserID will be the 24 character string populated for the _id field. + UserID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically using the Get-JCUser function before calling Add-JCUserGroupMember. This is shown in EXAMPLES 3, 4, and 5. + + System.String + + System.String + + + None + + + work_country Specifies the user's country on the work address object. This property is nested within the LDAP property with the displayName postalAddress. @@ -22906,6 +24318,18 @@ 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 + + System.String[] + + System.String[] + + + None + state @@ -23067,234 +24491,914 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - - - account_locked - - unlock or lock a users JumpCloud account - - System.Boolean - - System.Boolean - - - None - - - allow_public_key - - A boolean $true/$false value for allowing pubic key authentication - - System.Boolean - - System.Boolean - - - None - - - alternateEmail - - The alternateEmail for the user - - System.String - - System.String - - - None - - - Attribute1_name - - Enter an attribute name - - System.String - - System.String - - - None - - - Attribute1_value - - Enter an attribute value - - System.String - - System.String - - - None - - - Attribute2_name - - Enter an attribute name - - System.String - - System.String - - - None - - - Attribute2_value - - Enter an attribute value - - System.String - - System.String - - - None - - - 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 'RemoveCustomAttribute' Parameter - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - company - - Specifies the user's company. The LDAP displayName of this property is company. - - System.String - - System.String - - - None - - - costCenter - - Specifies the user's costCenter. The LDAP displayName of this property is businessCategory. - - System.String - - System.String - - - None - - - department - - Specifies the user's department. The LDAP displayName of this property is departmentNumber. - - System.String - - System.String - - - None - - - description - - Specifies the user's description. The LDAP displayName of this property is description. This field is limited to 1024 characters. - - System.String - - System.String - - - None - - - displayname - - Specifies the user's preferredName. The LDAP displayName of this property is displayName. - - System.String - - System.String - - - None - - - email - - The email address for the user. This must be a unique value. - - System.String - - System.String - - - None - - - employeeIdentifier - - Specifies the user's employeeIdentifier. The LDAP displayName of this property is employeeNumber. Note this field must be unique per user. - - System.String - - System.String - - - None - - - employeeType - - Specifies the user's employeeType. The LDAP displayName of this property is employeeType. - - System.String - - System.String - - - None - - - enable_managed_uid - - A boolean $true/$false value for enabling managed uid - - System.Boolean - - System.Boolean - - - None - - - enable_user_portal_multifactor - - A boolean $true/$false value for enabling MFA at the user portal - - System.Boolean - - System.Boolean - - - None - - - EnrollmentDays - - Number of days to allow for MFA enrollment. - - System.Int32 - - System.Int32 - - + + Set-JCUser + + Username + + The Username of the JumpCloud user you wish to modify + + System.String + + System.String + + + None + + + account_locked + + unlock or lock a users JumpCloud account + + System.Boolean + + System.Boolean + + + None + + + allow_public_key + + A boolean $true/$false value for allowing pubic key authentication + + System.Boolean + + System.Boolean + + + None + + + alternateEmail + + The alternateEmail for the user + + System.String + + System.String + + + None + + + Attribute1_name + + Enter an attribute name + + System.String + + System.String + + + None + + + Attribute1_value + + Enter an attribute value + + System.String + + System.String + + + None + + + Attribute2_name + + Enter an attribute name + + System.String + + System.String + + + None + + + Attribute2_value + + Enter an attribute value + + System.String + + System.String + + + None + + + company + + Specifies the user's company. The LDAP displayName of this property is company. + + System.String + + System.String + + + None + + + costCenter + + Specifies the user's costCenter. The LDAP displayName of this property is businessCategory. + + System.String + + System.String + + + None + + + department + + Specifies the user's department. The LDAP displayName of this property is departmentNumber. + + System.String + + System.String + + + None + + + description + + Specifies the user's description. The LDAP displayName of this property is description. This field is limited to 1024 characters. + + System.String + + System.String + + + None + + + displayname + + Specifies the user's preferredName. The LDAP displayName of this property is displayName. + + System.String + + System.String + + + None + + + email + + The email address for the user. This must be a unique value. + + System.String + + System.String + + + None + + + employeeIdentifier + + Specifies the user's employeeIdentifier. The LDAP displayName of this property is employeeNumber. Note this field must be unique per user. + + System.String + + System.String + + + None + + + employeeType + + Specifies the user's employeeType. The LDAP displayName of this property is employeeType. + + System.String + + System.String + + + None + + + enable_managed_uid + + A boolean $true/$false value for enabling managed uid + + System.Boolean + + System.Boolean + + + None + + + enable_user_portal_multifactor + + A boolean $true/$false value for enabling MFA at the user portal + + System.Boolean + + System.Boolean + + + None + + + EnrollmentDays + + Number of days to allow for MFA enrollment. + + System.Int32 + + System.Int32 + + + None + + + external_dn + + The distinguished name of the AD domain (ADB Externally managed users only) + + System.String + + System.String + + + None + + + external_source_type + + The externally managed user source type (ADB Externally managed users only) + + System.String + + System.String + + + None + + + externally_managed + + A boolean $true/$false value for enabling externally_managed + + System.Boolean + + System.Boolean + + + None + + + firstname + + The first name of the user + + System.String + + System.String + + + None + + + home_country + + Specifies the user's country on the home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + + System.String + + System.String + + + None + + + home_locality + + Specifies the user's city on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + + System.String + + System.String + + + None + + + home_number + + Specifies the user's home number. The LDAP displayName of this property is homePhone. + + System.String + + System.String + + + None + + + home_poBox + + Specifies the user's poBox on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + + System.String + + System.String + + + None + + + home_postalCode + + Specifies the user's postalCode on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + + System.String + + System.String + + + None + + + home_region + + Specifies the user's state on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + + System.String + + System.String + + + None + + + home_streetAddress + + Specifies the user's streetAddress on their home address object. This property is nested within the LDAP property with the displayName homePostalAddress. + + System.String + + System.String + + + None + + + jobTitle + + Specifies the user's job title. The LDAP displayName of this property is title. + + System.String + + System.String + + + None + + + lastname + + The last name of the user + + System.String + + System.String + + + None + + + ldap_binding_user + + A boolean $true/$false value to enable the user as an LDAP binding user + + System.Boolean + + System.Boolean + + + None + + + location + + Specifies the user's home location. The LDAP displayName of this property is physicalDeliveryOfficeName. + + System.String + + System.String + + + None + + + managedAppleId + + The managedAppleId for the user + + System.String + + System.String + + + None + + + manager + + The manager for the user + + System.Object + + System.Object + + + None + + + middlename + + Specifies the user's home location. The LDAP displayName of this property is initials. + + System.String + + System.String + + + None + + + mobile_number + + Specifies the user's mobile number. The LDAP displayName of this property is mobile. + + System.String + + System.String + + + None + + + NumberOfCustomAttributes + + If you intend to update a user with existing Custom Attributes or add new Custom Attributes you must declare how many Custom Attributes you intend to update or add. If an Custom Attribute exists with a name that matches the new attribute then the existing attribute will be updated. Based on the NumberOfCustomAttributes value two Dynamic Parameters will be created for each Custom Attribute: Attribute_name and Attribute_value with an associated number. See an example for working with Custom Attribute in EXAMPLE 4 + + System.Int32 + + System.Int32 + + + None + + + password + + The password for the user + + System.String + + System.String + + + None + + + password_never_expires + + A boolean $true/$false value for enabling password_never_expires + + System.Boolean + + System.Boolean + + + None + + + passwordless_sudo + + A boolean $true/$false value if you want to enable passwordless_sudo + + System.Boolean + + System.Boolean + + + None + + + + recoveryEmail + + The recoveryEmail for the user + + System.String + + System.String + + + None + + + state + + A string value for putting the account into a staged, activated or suspended state + + + ACTIVATED + SUSPENDED + + System.String + + System.String + + + None + + + sudo + + A boolean $true/$false value if you want to enable the user to be an administrator on any and all systems the user is bound to. + + System.Boolean + + System.Boolean + + + None + + + unix_guid + + The unix_guid for the user. Note this value must be a number. + + System.Int32 + + System.Int32 + + + None + + + unix_uid + + The unix_uid for the user. Note this value must be an number. + + System.Int32 + + System.Int32 + + + None + + + work_country + + Specifies the user's country on the work address object. This property is nested within the LDAP property with the displayName postalAddress. + + System.String + + System.String + + + None + + + work_fax_number + + Specifies the user's work fax number. The LDAP displayName of this property is facsimileTelephoneNumber. + + System.String + + System.String + + + None + + + work_locality + + Specifies the user's city on their work address object. The LDAP displayName of this property is l. + + System.String + + System.String + + + None + + + work_mobile_number + + Specifies the user's work mobile number. The LDAP displayName of this property is pager. + + System.String + + System.String + + + None + + + work_number + + Specifies the user's work number. The LDAP displayName of this property is telephoneNumber. + + System.String + + System.String + + + None + + + work_poBox + + Specifies the user's poBox on their work address object. The LDAP displayName of this property is postOfficeBox. + + System.String + + System.String + + + None + + + work_postalCode + + Specifies the user's postalCode on their work address object. The LDAP displayName of this property is postalCode. + + System.String + + System.String + + + None + + + work_region + + Specifies the user's state on their work address object. This property is nested within the LDAP property with the displayName postalAddress. + + System.String + + System.String + + + None + + + work_streetAddress + + Specifies the user's streetAddress on their work address object. This property is nested within the LDAP property with the displayName postalAddress. + + System.String + + System.String + + + None + + + + + + account_locked + + unlock or lock a users JumpCloud account + + System.Boolean + + System.Boolean + + + None + + + allow_public_key + + A boolean $true/$false value for allowing pubic key authentication + + System.Boolean + + System.Boolean + + + None + + + alternateEmail + + The alternateEmail for the user + + System.String + + System.String + + + None + + + Attribute1_name + + Enter an attribute name + + System.String + + System.String + + + None + + + Attribute1_value + + Enter an attribute value + + System.String + + System.String + + + None + + + Attribute2_name + + Enter an attribute name + + System.String + + System.String + + + None + + + Attribute2_value + + Enter an attribute value + + System.String + + System.String + + + None + + + 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 'RemoveCustomAttribute' Parameter + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + company + + Specifies the user's company. The LDAP displayName of this property is company. + + System.String + + System.String + + + None + + + costCenter + + Specifies the user's costCenter. The LDAP displayName of this property is businessCategory. + + System.String + + System.String + + + None + + + department + + Specifies the user's department. The LDAP displayName of this property is departmentNumber. + + System.String + + System.String + + + None + + + description + + Specifies the user's description. The LDAP displayName of this property is description. This field is limited to 1024 characters. + + System.String + + System.String + + + None + + + displayname + + Specifies the user's preferredName. The LDAP displayName of this property is displayName. + + System.String + + System.String + + + None + + + email + + The email address for the user. This must be a unique value. + + System.String + + System.String + + + None + + + employeeIdentifier + + Specifies the user's employeeIdentifier. The LDAP displayName of this property is employeeNumber. Note this field must be unique per user. + + System.String + + System.String + + + None + + + employeeType + + Specifies the user's employeeType. The LDAP displayName of this property is employeeType. + + System.String + + System.String + + + None + + + enable_managed_uid + + A boolean $true/$false value for enabling managed uid + + System.Boolean + + System.Boolean + + + None + + + enable_user_portal_multifactor + + A boolean $true/$false value for enabling MFA at the user portal + + System.Boolean + + System.Boolean + + + None + + + EnrollmentDays + + Number of days to allow for MFA enrollment. + + System.Int32 + + System.Int32 + + None @@ -23441,10 +25545,267 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - lastname + + lastname + + The last name of the user + + System.String + + System.String + + + None + + + ldap_binding_user + + A boolean $true/$false value to enable the user as an LDAP binding user + + System.Boolean + + System.Boolean + + + None + + + location + + Specifies the user's home location. The LDAP displayName of this property is physicalDeliveryOfficeName. + + System.String + + System.String + + + None + + + managedAppleId + + The managedAppleId for the user + + System.String + + System.String + + + None + + + manager + + The manager for the user + + System.Object + + System.Object + + + None + + + middlename + + Specifies the user's home location. The LDAP displayName of this property is initials. + + System.String + + System.String + + + None + + + mobile_number + + Specifies the user's mobile number. The LDAP displayName of this property is mobile. + + System.String + + System.String + + + None + + + NumberOfCustomAttributes + + If you intend to update a user with existing Custom Attributes or add new Custom Attributes you must declare how many Custom Attributes you intend to update or add. If an Custom Attribute exists with a name that matches the new attribute then the existing attribute will be updated. Based on the NumberOfCustomAttributes value two Dynamic Parameters will be created for each Custom Attribute: Attribute_name and Attribute_value with an associated number. See an example for working with Custom Attribute in EXAMPLE 4 + + System.Int32 + + System.Int32 + + + None + + + password + + The password for the user + + System.String + + System.String + + + None + + + password_never_expires + + A boolean $true/$false value for enabling password_never_expires + + System.Boolean + + System.Boolean + + + None + + + passwordless_sudo + + A boolean $true/$false value if you want to enable passwordless_sudo + + System.Boolean + + System.Boolean + + + None + + + + recoveryEmail + + The recoveryEmail for the user + + System.String + + System.String + + + 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 + + System.String[] + + System.String[] + + + None + + + state + + A string value for putting the account into a staged, activated or suspended state + + System.String + + System.String + + + None + + + sudo + + A boolean $true/$false value if you want to enable the user to be an administrator on any and all systems the user is bound to. + + System.Boolean + + System.Boolean + + + None + + + unix_guid + + The unix_guid for the user. Note this value must be a number. + + System.Int32 + + System.Int32 + + + None + + + unix_uid + + The unix_uid for the user. Note this value must be an number. + + System.Int32 + + System.Int32 + + + None + + + UserID + + The _id of the User which you want to modify. + To find a JumpCloud UserID run the command: + PS C:\> Get-JCUser | Select username, _id + The UserID will be the 24 character string populated for the _id field. + UserID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically using the Get-JCUser function before calling Add-JCUserGroupMember. This is shown in EXAMPLES 3, 4, and 5. + + System.String + + System.String + + + None + + + Username + + The Username of the JumpCloud user you wish to modify + + System.String + + System.String + + + None + + + work_country + + Specifies the user's country on the work address object. This property is nested within the LDAP property with the displayName postalAddress. + + System.String + + System.String + + + None + + + work_fax_number + + Specifies the user's work fax number. The LDAP displayName of this property is facsimileTelephoneNumber. + + System.String + + System.String + + + None + + + work_locality - The last name of the user + Specifies the user's city on their work address object. The LDAP displayName of this property is l. System.String @@ -23454,21 +25815,21 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - ldap_binding_user + work_mobile_number - A boolean $true/$false value to enable the user as an LDAP binding user + Specifies the user's work mobile number. The LDAP displayName of this property is pager. - System.Boolean + System.String - System.Boolean + System.String None - location + work_number - Specifies the user's home location. The LDAP displayName of this property is physicalDeliveryOfficeName. + Specifies the user's work number. The LDAP displayName of this property is telephoneNumber. System.String @@ -23478,9 +25839,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - managedAppleId + work_poBox - The managedAppleId for the user + Specifies the user's poBox on their work address object. The LDAP displayName of this property is postOfficeBox. System.String @@ -23490,21 +25851,21 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - manager + work_postalCode - The manager for the user + Specifies the user's postalCode on their work address object. The LDAP displayName of this property is postalCode. - System.Object + System.String - System.Object + System.String None - - middlename + + work_region - Specifies the user's home location. The LDAP displayName of this property is initials. + Specifies the user's state on their work address object. This property is nested within the LDAP property with the displayName postalAddress. System.String @@ -23514,9 +25875,9 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - mobile_number + work_streetAddress - Specifies the user's mobile number. The LDAP displayName of this property is mobile. + Specifies the user's streetAddress on their work address object. This property is nested within the LDAP property with the displayName postalAddress. System.String @@ -23525,59 +25886,582 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - NumberOfCustomAttributes + + + + + System.String + - If you intend to update a user with existing Custom Attributes or add new Custom Attributes you must declare how many Custom Attributes you intend to update or add. If an Custom Attribute exists with a name that matches the new attribute then the existing attribute will be updated. Based on the NumberOfCustomAttributes value two Dynamic Parameters will be created for each Custom Attribute: Attribute_name and Attribute_value with an associated number. See an example for working with Custom Attribute in EXAMPLE 4 + - System.Int32 + + + + System.Boolean + + + + + + System.Int32 - - None - - - password - The password for the user + - System.String + + - System.String - + System.String[] - None - - - password_never_expires - A boolean $true/$false value for enabling password_never_expires + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + System.Object + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> Set-JCUser -Username cclemons -account_locked $false + + This example unlocks the account for the user with username cclemons by setting the value of the property -account_locked to $false. + + + + -------------------------- Example 2 -------------------------- + PS C:\> Set-JCUser -Username cclemons -account_locked $true -email 'clarence@clemons.com' + + This example locks the account for user with username cclemons by setting the value of the property -account_locked to $true and also updates the email address for this user to 'clarence@clemons.com'. + + + + -------------------------- Example 3 -------------------------- + PS C:\> Get-JCUser | Select-Object _id, @{ Name = 'email'; Expression = { ($_.email).replace('olddomain.com','newdomain.com') }} | foreach {Set-JCUser -ByID -UserID $_._id -email $_.email} + + This example updates the domain on the email addresses associated with every user in the JumpCloud tenant using Parameter Binding, the pipeline, and a calculated property. The 'olddomain.com' would represent the current domain and the 'newdomain.com' would be the new domain. + + + + -------------------------- Example 4 -------------------------- + PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -NumberOfCustomAttributes 1 -Attribute1_name 'Department' -Attribute1_value 'Sales' + + This example either updates or adds the Custom Attribute 'name = Department, value = Sales' to all JumpCloud Users in the JumpCloud User Group 'Sales' + + + + -------------------------- Example 5 -------------------------- + PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveCustomAttribute ATTRIBUTENAME + + This example removes the Custom Attribute with the name 'ATTRIBUTENAME' from all JumpCloud Users in the JumpCloud User Group 'Sales' + + + + -------------------------- Example 6 -------------------------- + PS C:\> Set-JCUser -Username cclemons -enable_user_portal_multifactor $True -enrollmentdays 14 + + This example enables the account for the user with username cclemons for MFA login to the user portal and sets an enrollment period of 14 days. + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/Set-JCUser + + + + + + Set-JCUserGroup + Set + JCUserGroup + + This endpoint allows you to do a full set of the User Group. + See the \ Dynamic Group Configuration KB article\ (https://jumpcloud.com/support/configure-dynamic-device-groups)for more details on maintaining a Dynamic Group. + + + + This endpoint allows you to do a full set of the User Group. + See the \ Dynamic Group Configuration KB article\ (https://jumpcloud.com/support/configure-dynamic-device-groups)for more details on maintaining a Dynamic Group. + + + + Set-JCUserGroup + + Attributes + + The graph attributes for a UserGroup. + + System.Collections.Hashtable + + System.Collections.Hashtable + + + None + + + Description + + Description of a User Group + + System.String + + System.String + + + None + + + Email + + Email address of a User Group + + System.String + + System.String + + + None + + + Id + + ObjectID of the User Group. + + System.String + + System.String + + + None + + + MemberQueryExemptions + + Array of GraphObjects exempted from the query + + JumpCloud.SDK.V2.Models.IGraphObject[] + + JumpCloud.SDK.V2.Models.IGraphObject[] + + + None + + + MemberQueryFilters + + For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + + System.String[] + + System.String[] + + + None + + + MemberQuerySearchFilters + + For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + + System.String + + System.String + + + None + + + MemberQueryType + + . + + System.String + + System.String + + + None + + + MembershipMethod + + The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + + System.String + + System.String + + + None + + + MemberSuggestionsNotify + + True if notification emails are to be sent for membership suggestions. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Display name of a User Group. + + System.String + + System.String + + + None + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCUserGroup + + Attributes + + The graph attributes for a UserGroup. + + System.Collections.Hashtable + + System.Collections.Hashtable + + + None + + + Description + + Description of a User Group + + System.String + + System.String + + + None + + + Email + + Email address of a User Group + + System.String + + System.String + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + MemberQueryExemptions + + Array of GraphObjects exempted from the query + + JumpCloud.SDK.V2.Models.IGraphObject[] + + JumpCloud.SDK.V2.Models.IGraphObject[] + + + None + + + MemberQueryFilters + + For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. + + System.String[] + + System.String[] + + + None + + + MemberQuerySearchFilters + + For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. + + System.String + + System.String + + + None + + + MemberQueryType + + . + + System.String + + System.String + + + None + + + MembershipMethod + + The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + + System.String + + System.String + + + None + + + MemberSuggestionsNotify + + True if notification emails are to be sent for membership suggestions. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Display name of a User Group. + + System.String + + System.String + + + None + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCUserGroup + + Body + + UserGroupPut + + JumpCloud.SDK.V2.Models.IUserGroupPut + + JumpCloud.SDK.V2.Models.IUserGroupPut + + + None + + + Id + + ObjectID of the User Group. + + System.String + + System.String + + + None + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-JCUserGroup + + Body + + UserGroupPut + + JumpCloud.SDK.V2.Models.IUserGroupPut + + JumpCloud.SDK.V2.Models.IUserGroupPut + + + None + + + InputObject + + Identity Parameter + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity + + + None + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Attributes + + The graph attributes for a UserGroup. - System.Boolean + System.Collections.Hashtable - System.Boolean + System.Collections.Hashtable None - - passwordless_sudo + + Body - A boolean $true/$false value if you want to enable passwordless_sudo + UserGroupPut - System.Boolean + JumpCloud.SDK.V2.Models.IUserGroupPut - System.Boolean + JumpCloud.SDK.V2.Models.IUserGroupPut None - - - recoveryEmail + + Description - The recoveryEmail for the user + Description of a User Group System.String @@ -23586,22 +26470,10 @@ 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 - - System.String[] - - System.String[] - - - None - - - state + + Email - A string value for putting the account into a staged, activated or suspended state + Email address of a User Group System.String @@ -23610,50 +26482,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - sudo - - A boolean $true/$false value if you want to enable the user to be an administrator on any and all systems the user is bound to. - - System.Boolean - - System.Boolean - - - None - - - unix_guid - - The unix_guid for the user. Note this value must be a number. - - System.Int32 - - System.Int32 - - - None - - - unix_uid - - The unix_uid for the user. Note this value must be an number. - - System.Int32 - - System.Int32 - - - None - - - UserID + + Id - The _id of the User which you want to modify. - To find a JumpCloud UserID run the command: - PS C:\> Get-JCUser | Select username, _id - The UserID will be the 24 character string populated for the _id field. - UserID has an Alias of _id. This means you can leverage the PowerShell pipeline to populate this field automatically using the Get-JCUser function before calling Add-JCUserGroupMember. This is shown in EXAMPLES 3, 4, and 5. + ObjectID of the User Group. System.String @@ -23662,46 +26494,46 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - Username + + InputObject - The Username of the JumpCloud user you wish to modify + Identity Parameter - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity - System.String + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity None - - work_country + + MemberQueryExemptions - Specifies the user's country on the work address object. This property is nested within the LDAP property with the displayName postalAddress. + Array of GraphObjects exempted from the query - System.String + JumpCloud.SDK.V2.Models.IGraphObject[] - System.String + JumpCloud.SDK.V2.Models.IGraphObject[] None - - work_fax_number + + MemberQueryFilters - Specifies the user's work fax number. The LDAP displayName of this property is facsimileTelephoneNumber. + For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. - System.String + System.String[] - System.String + System.String[] None - - work_locality + + MemberQuerySearchFilters - Specifies the user's city on their work address object. The LDAP displayName of this property is l. + For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. System.String @@ -23710,10 +26542,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_mobile_number + + MemberQueryType - Specifies the user's work mobile number. The LDAP displayName of this property is pager. + . System.String @@ -23722,10 +26554,10 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_number + + MembershipMethod - Specifies the user's work number. The LDAP displayName of this property is telephoneNumber. + The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED.Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices).Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. System.String @@ -23734,22 +26566,22 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_poBox + + MemberSuggestionsNotify - Specifies the user's poBox on their work address object. The LDAP displayName of this property is postOfficeBox. + True if notification emails are to be sent for membership suggestions. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False - - work_postalCode + + Name - Specifies the user's postalCode on their work address object. The LDAP displayName of this property is postalCode. + Display name of a User Group. System.String @@ -23758,67 +26590,36 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli None - - work_region + + + Confirm - Specifies the user's state on their work address object. This property is nested within the LDAP property with the displayName postalAddress. + Prompts you for confirmation before running the cmdlet. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False - - work_streetAddress + + WhatIf - Specifies the user's streetAddress on their work address object. This property is nested within the LDAP property with the displayName postalAddress. + Shows what would happen if the cmdlet runs. The cmdlet is not run. - System.String + System.Management.Automation.SwitchParameter - System.String + System.Management.Automation.SwitchParameter - None + False - System.String - - - - - - - - System.Boolean - - - - - - - - System.Int32 - - - - - - - - System.String[] - - - - - - - - System.Management.Automation.SwitchParameter + JumpCloud.SDK.V2.Models.IJumpCloudApiIdentity @@ -23826,7 +26627,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.Object + JumpCloud.SDK.V2.Models.IUserGroupPut @@ -23836,7 +26637,7 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - System.Object + JumpCloud.SDK.V2.Models.IUserGroup @@ -23845,57 +26646,39 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli - + COMPLEX PARAMETER PROPERTIES + To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + BODY <IUserGroupPut>: UserGroupPut Name <String>: Display name of a User Group. [Attributes <IGroupAttributesUserGroup>]: The graph attributes for a UserGroup. [(Any) <Object>]: This indicates any property can be added to this object. [SudoEnabled <Boolean?>]: Enables sudo [SudoWithoutPassword <Boolean?>]: Enable sudo without password (requires 'enabled' to be true) [LdapGroups <List<ILdapGroup>>]: [Name <String>]: [PosixGroups <List<IGraphAttributePosixGroupsItem>>]: Id <Int32>: Name <String>: [RadiusReply <List<IGraphAttributeRadiusReplyItem>>]: Name <String>: Value <String>: [SambaEnabled <Boolean?>]: [Description <String>]: Description of a User Group [Email <String>]: Email address of a User Group [MemberQueryExemptions <List<IGraphObject>>]: Array of GraphObjects exempted from the query Id <String>: The ObjectID of the graph object. Type <String>: The type of graph object. [Attributes <IGraphAttributes>]: The graph attributes. [(Any) <Object>]: This indicates any property can be added to this object. [MemberQueryFilters <List<String>>]: For queryType 'Filter', this is a stringified JSON filter array that will be validated by API middleware. [MemberQuerySearchFilters <String>]: For queryType 'Search', this is a stringified JSON filter object that will be validated by API middleware. [MemberQueryType <String>]: [MemberSuggestionsNotify <Boolean?>]: True if notification emails are to be sent for membership suggestions. [MembershipMethod <String>]: The type of membership method for this group. Valid values include NOTSET, STATIC, DYNAMIC_REVIEW_REQUIRED, and DYNAMIC_AUTOMATED. Note DYNAMIC_AUTOMATED and DYNAMIC_REVIEW_REQUIRED group rules will supersede any group enrollment for \ group-associated MDM-enrolled devices\ (https://jumpcloud.com/support/change-a-default-device-group-for-apple-devices). Use caution when creating dynamic device groups with MDM-enrolled devices to avoid creating conflicting rule sets. + INPUTOBJECT <IJumpCloudApiIdentity>: Identity Parameter [AccountId <String>]: [ActivedirectoryId <String>]: [AdministratorId <String>]: [AgentId <String>]: [AppleMdmId <String>]: [ApplicationId <String>]: ObjectID of the Application. [ApprovalFlowId <String>]: [CommandId <String>]: ObjectID of the Command. [CustomEmailType <String>]: [DeviceId <String>]: [GroupId <String>]: ObjectID of the Policy Group. [GsuiteId <String>]: ObjectID of the G Suite instance. [Id <String>]: ObjectID of this Active Directory instance. [JobId <String>]: [LdapserverId <String>]: ObjectID of the LDAP Server. [Office365Id <String>]: ObjectID of the Office 365 instance. [PolicyId <String>]: ObjectID of the Policy. [ProviderId <String>]: [PushEndpointId <String>]: [RadiusserverId <String>]: ObjectID of the Radius Server. [SoftwareAppId <String>]: ObjectID of the Software App. [SystemId <String>]: ObjectID of the System. [UserId <String>]: ObjectID of the User. [WorkdayId <String>]: + MEMBERQUERYEXEMPTIONS <IGraphObject[]>: Array of GraphObjects exempted from the query Id <String>: The ObjectID of the graph object. Type <String>: The type of graph object. [Attributes <IGraphAttributes>]: The graph attributes. [(Any) <Object>]: This indicates any property can be added to this object. - -------------------------- Example 1 -------------------------- - PS C:\> Set-JCUser -Username cclemons -account_locked $false - - This example unlocks the account for the user with username cclemons by setting the value of the property -account_locked to $false. - - - - -------------------------- Example 2 -------------------------- - PS C:\> Set-JCUser -Username cclemons -account_locked $true -email 'clarence@clemons.com' - - This example locks the account for user with username cclemons by setting the value of the property -account_locked to $true and also updates the email address for this user to 'clarence@clemons.com'. - - - - -------------------------- Example 3 -------------------------- - PS C:\> Get-JCUser | Select-Object _id, @{ Name = 'email'; Expression = { ($_.email).replace('olddomain.com','newdomain.com') }} | foreach {Set-JCUser -ByID -UserID $_._id -email $_.email} - - This example updates the domain on the email addresses associated with every user in the JumpCloud tenant using Parameter Binding, the pipeline, and a calculated property. The 'olddomain.com' would represent the current domain and the 'newdomain.com' would be the new domain. - - - - -------------------------- Example 4 -------------------------- - PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -NumberOfCustomAttributes 1 -Attribute1_name 'Department' -Attribute1_value 'Sales' - - This example either updates or adds the Custom Attribute 'name = Department, value = Sales' to all JumpCloud Users in the JumpCloud User Group 'Sales' - - - - -------------------------- Example 5 -------------------------- - PS C:\> Get-JCUserGroupMember -GroupName 'Sales' | Set-JCUser -RemoveCustomAttribute ATTRIBUTENAME + -------------------------- EXAMPLE 1 -------------------------- + Set-JCUserGroup -Id:(<string>) -Body:(<JumpCloud.SDK.V2.Models.UserGroupPut>) - This example removes the Custom Attribute with the name 'ATTRIBUTENAME' from all JumpCloud Users in the JumpCloud User Group 'Sales' + --- + Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String SuggestionCountAdd Int SuggestionCountRemove Int SuggestionCountTotal Int Type String - -------------------------- Example 6 -------------------------- - PS C:\> Set-JCUser -Username cclemons -enable_user_portal_multifactor $True -enrollmentdays 14 + -------------------------- EXAMPLE 2 -------------------------- + Set-JCUserGroup -Id:(<string>) -Name:(<string>) -Attributes:(<hashtable>) -Description:(<string>) -Email:(<string>) -MemberQueryExemptions:(<JumpCloud.SDK.V2.Models.GraphObject[]>) -MemberQueryFilters:(<JumpCloud.SDK.V2.Models.Any[]>) -MemberQueryType:(<string>) -MemberSuggestionsNotify:(<switch>) -MembershipMethod:(<string>) - This example enables the account for the user with username cclemons for MFA login to the user portal and sets an enrollment period of 14 days. + --- + Attributes JumpCloud.SDK.V2.Models.GroupAttributesUserGroup Description String Email String Id String MemberQueryExemptions JumpCloud.SDK.V2.Models.GraphObject[] MemberQueryFilters JumpCloud.SDK.V2.Models.Any[] MemberQueryType String MembershipMethod String MemberSuggestionsNotify Boolean Name String SuggestionCountAdd Int SuggestionCountRemove Int SuggestionCountTotal Int Type String Online Version: - https://github.com/TheJumpCloud/support/wiki/Set-JCUser + https://github.com/TheJumpCloud/support/wiki/ + + + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkUserGroup.md + https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.V2/docs/exports/Set-JcSdkUserGroup.md diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 5fa78c0f0..d2adceccd 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,28 @@ +## 3.1.0 + +Release Date: May 12, 2026 + +#### RELEASE NOTES + +``` +- Adds new SDK-based cmdlets: Get-JCSystemGroup, Get-JCUserGroup, Get-JCPolicyGroup, New-JCPolicyGroup, Remove-JCPolicyGroup, Get-JCPolicyGroupMember, Set-JCPolicyGroupMember +- Adds and updates Pester tests for all new group and policy group cmdlets +- Improves test coverage and error handling for group and policy group management +- Fixes test parameter usage to match SDK model (e.g., -Id, -Filter, .Name) +- Minor bug fixes and documentation updates +- Update the .reg file import to support additional type of registry key values +``` + +## 3.0.2 + +Release Date: May 05, 2026 + +#### RELEASE NOTES + +``` +Update the .reg file import to support additional type of registry key values +``` + ## 3.0.2 Release Date: January 22, 2026 @@ -818,7 +843,7 @@ This release incorperates the "alternateEmail", "manager" and "managedAppleID" f [alternateEmail, manager, managedAppleID attributes added to module](https://github.com/TheJumpCloud/support/pull/353) ``` -SDKs should prompt to update on Connect-JConline +SDKs should prompt to update on Connect-JCOnline ``` #### IMPROVEMENTS: