Skip to content

Commit

Permalink
Merge pull request #499 from TheJumpCloud/SA-3334_MTPImportUpdate
Browse files Browse the repository at this point in the history
Sa 3334 mtp import update
  • Loading branch information
jworkmanjc authored Jun 21, 2023
2 parents fc97cb1 + ab18764 commit a526529
Show file tree
Hide file tree
Showing 22 changed files with 1,655 additions and 29 deletions.
35 changes: 29 additions & 6 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ parameters:
PublishToPSGallery:
description: "When `true` and when run against Master branch, this workflow will publish the latest code to PSGallery"
type: boolean
default: false
default: true
ManualModuleVersion:
description: "When `true` the pipeline will use the Module Version specified in JumpCloud Module JumpCloud.psd1 file"
type: boolean
default: false
default: true
orbs:
win: circleci/[email protected]
executors:
Expand Down Expand Up @@ -135,6 +135,13 @@ workflows:
- Build Nuspec
- Invoke Git Commit
context: aws-credentials
- Pester Tests Linux MSP:
requires:
- Initial Setup
- Build Help and Test Files
- Build Nuspec
- Invoke Git Commit
context: aws-credentials
- Publish Module Validation:
requires:
- Initial Setup
Expand Down Expand Up @@ -231,7 +238,7 @@ jobs:
- invoke-pester:
JumpCloudApiKey: $env:XAPIKEY_PESTER
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP
ExcludeTagList: "ModuleValidation, JCDeployment"
ExcludeTagList: "ModuleValidation, JCDeployment, MSP"
IncludeTagList: "*"
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >>
Shell: "pwsh.exe"
Expand All @@ -242,7 +249,7 @@ jobs:
- invoke-pester:
JumpCloudApiKey: $env:XAPIKEY_PESTER_MAC
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP
ExcludeTagList: "ModuleValidation, JCDeployment"
ExcludeTagList: "ModuleValidation, JCDeployment, MSP"
IncludeTagList: "*"
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >>
Shell: "pwsh"
Expand All @@ -254,10 +261,23 @@ jobs:
- invoke-pester:
JumpCloudApiKey: $env:XAPIKEY_PESTER_LINUX
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP
ExcludeTagList: "ModuleValidation, JCDeployment"
ExcludeTagList: "ModuleValidation, JCDeployment, MSP"
IncludeTagList: "*"
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >>
Shell: "pwsh"
Pester Tests Linux MSP:
machine:
image: ubuntu-2004:202201-02
steps:
- setup-pester-env-linux
- invoke-pester:
JumpCloudApiKey: $env:XAPIKEY_PESTER_MTP
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP
JumpCloudMspOrg: $env:XORGID_PesterMSP
ExcludeTagList: "None"
IncludeTagList: "MSP"
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >>
Shell: "pwsh"
Publish Module Validation:
machine:
image: ubuntu-2004:202201-02
Expand Down Expand Up @@ -513,6 +533,9 @@ commands:
JumpCloudApiKeyMsp:
type: string
default: $env:XAPIKEY_PESTER_MTP
JumpCloudMspOrg:
type: string
default: $env:XORGID_PesterMSP
ExcludeTagList:
type: string
default: "None"
Expand All @@ -539,7 +562,7 @@ commands:
command: |
$ErrorActionPreference = 'stop'
./PowerShell\Deploy\SdkSync\jcapiToSupportSync.ps1 -RequiredModulesRepo << pipeline.parameters.RequiredModulesRepo >>
. "./PowerShell/JumpCloud Module/Tests/InvokePester.ps1" -JumpCloudApiKey << parameters.JumpCloudApiKey >> -JumpCloudApiKeyMsp << parameters.JumpCloudApiKeyMsp >> -ExcludeTagList << parameters.ExcludeTagList >> -IncludeTagList << parameters.IncludeTagList >> -RequiredModulesRepo << parameters.RequiredModulesRepo >>
. "./PowerShell/JumpCloud Module/Tests/InvokePester.ps1" -JumpCloudApiKey << parameters.JumpCloudApiKey >> -JumpCloudApiKeyMsp << parameters.JumpCloudApiKeyMsp >> -JumpCloudMspOrg << parameters.JumpCloudMspOrg >> -ExcludeTagList << parameters.ExcludeTagList >> -IncludeTagList << parameters.IncludeTagList >> -RequiredModulesRepo << parameters.RequiredModulesRepo >>
- store_test_results:
name: Uploading test results'
path: "./PowerShell/JumpCloud Module/Tests/test_results/"
Expand Down
1 change: 1 addition & 0 deletions PowerShell/Deploy/Get-Config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ param (
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, HelpMessage = 'Release Type')][ValidateNotNullOrEmpty()][System.String]$ReleaseType,
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, HelpMessage = 'Windows Pester JumpCloud API Key')][ValidateNotNullOrEmpty()][System.String]$XAPIKEY_PESTER = $env:XAPIKEY_PESTER,
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, HelpMessage = 'MTP Pester JumpCloud API Key')][ValidateNotNullOrEmpty()][System.String]$XAPIKEY_MTP = $env:XAPIKEY_PESTER_MTP,
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, HelpMessage = 'MTP Pester JumpCloud API Key')][ValidateNotNullOrEmpty()][System.String]$XMSP_ORGID = $env:XORGID_PesterMSP,
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, HelpMessage = 'Nuget API Key')][System.String]$NUGETAPIKEY = $env:NUGETAPIKEY,
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, HelpMessage = 'Required Modules Repository')][ValidateNotNullOrEmpty()][System.String]$RequiredModulesRepo = "PSGallery"
)
Expand Down
115 changes: 115 additions & 0 deletions PowerShell/JumpCloud Module/Docs/Import-JCMSPFromCSV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
external help file: JumpCloud-help.xml
Module Name: JumpCloud
online version: https://github.com/TheJumpCloud/support/wiki/
schema: 2.0.0
---

# Import-JCMSPFromCSV

## SYNOPSIS

Imports a list of JumpCloud MSP organizations from a CSV file created using the New-JCMSPImportTemplate function.

## SYNTAX

### GUI (Default)
```
Import-JCMSPFromCSV [-CSVFilePath] <String> [<CommonParameters>]
```

### force
```
Import-JCMSPFromCSV [-CSVFilePath] <String> [-force] [-ProviderID <String>] [<CommonParameters>]
```

## DESCRIPTION

The Import-JCMSPFromCSV function does data validation when updating JumpCloud Organizations in bulk from a CSV file to warn the administrator of any potential issues during the import process. Examples of warnings include warning messages for organizations whose name already exists and duplicate organization names in the CSV file.

The Import-JCMSPFromCSV command can be used to import organization names and max user counts.

The Import-JCMSPFromCSV command also has a '-force' parameter which admins can use to skip the gui validation or to use the function in an automation script.

## EXAMPLES

### Example 1

```powershell
PS C:\> Import-JCMSPFromCSV ./JCMSPImport_06-14-2023.csv
```

Imports MSP orgs from the .csv file 'JCMSPImport_06-14-2023.csv'

### Example 2

```powershell
PS C:\> Import-JCMSPFromCSV ./JCMSPImport_06-14-2023.csv -Force
```

Uses the 'Force' parameter to skip the GUI and data validation and import MSP orgs from the file 'JCMSPImport_06-14-2023.csv

## PARAMETERS

### -CSVFilePath

The full path to the CSV file you wish to import.
You can use tab complete to search for .csv files.

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

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -force
A SwitchParameter which suppresses the GUI and data validation when using the Import-JCMSPFromCSV command.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: force
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ProviderID
Your Provider ID
```yaml
Type: System.String
Parameter Sets: force
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
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS
11 changes: 10 additions & 1 deletion PowerShell/JumpCloud Module/Docs/JumpCloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Module Name: JumpCloud
Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646
Download Help Link: https://github.com/TheJumpCloud/support/wiki
Help Version: 2.5.1
Help Version: 2.6.0
Locale: en-US
---

Expand Down Expand Up @@ -108,6 +108,9 @@ Returns the User Group members of a JumpCloud User Group.
### [Import-JCCommand](Import-JCCommand.md)
Imports a Mac, Linux or Windows JumpCloud Command into the JumpCloud admin portal from a URL

### [Import-JCMSPFromCSV](Import-JCMSPFromCSV.md)
Imports a list of JumpCloud MSP organizations from a CSV file created using the New-JCMSPImportTemplate function.

### [Import-JCUsersFromCSV](Import-JCUsersFromCSV.md)
Imports a set of JumpCloud users from a CSV file created using the New-JCImportTemplate function.

Expand All @@ -126,6 +129,9 @@ A guided walk through that creates a command deployment CSV file on your local m
### [New-JCImportTemplate](New-JCImportTemplate.md)
A guided walk through that creates a JumpCloud User Import CSV file on your local machine.

### [New-JCMSPImportTemplate](New-JCMSPImportTemplate.md)
Creates a CSV file to either create new or update existing MSP organizations in a MSP tenant.

### [New-JCPolicy](New-JCPolicy.md)
New-JCPolicy creates new JumpCloud Policies in an organization by TemplateID or TemplateNames. JumpCloud policies can be created in three different ways. The New/Set-JCPolicy functions each have a dynamic set of parameters specific to each policy template, this dynamic set of parameters is generated after specifying a valid TemplateID or TemplateName. New/Set-JCPolicy functions can also be set through a valid `value` parameter which is specific to each template policy. Lastly, New/Set-JCPolicy functions can be set through a guided interface.

Expand Down Expand Up @@ -227,6 +233,9 @@ The Set-JCUserGroupLDAP command adds or removes a JumpCloud user group and the m
### [Update-JCModule](Update-JCModule.md)
Running this function will trigger the update of the JumpCloud PowerShell module.

### [Update-JCMSPFromCSV](Update-JCMSPFromCSV.md)
Updates a list of JumpCloud MSP organizations from a CSV file created using the New-JCMSPImportTemplate function.

### [Update-JCUsersFromCSV](Update-JCUsersFromCSV.md)
Updates a set of JumpCloud users from a CSV file created using the New-JCImportTemplate function.

Expand Down
7 changes: 6 additions & 1 deletion PowerShell/JumpCloud Module/Docs/New-JCImportTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ schema: 2.0.0
# New-JCImportTemplate

## SYNOPSIS

A guided walk through that creates a JumpCloud User Import CSV file on your local machine.

## SYNTAX
Expand All @@ -17,6 +18,7 @@ New-JCImportTemplate [-Force] -Type <Object> [<CommonParameters>]
```

## DESCRIPTION

The New-JCImportTemplate command is a menu driven function that guides end users and creates a custom JumpCloud User Import .CSV file on their machine for populating with their users information for Importing into JumpCloud.
If users wish to bind users to existing JumpCloud systems the function will also output a .csv file with containing all existing JumpCloud machines to the users $Home directory. The user will need this file to associate SystemIDs with new users.

Expand All @@ -29,6 +31,7 @@ If users wish to bind users to existing JumpCloud systems the function will also
[Advanced User Import](https://youtu.be/L2hP-XtUJH8)

### Example 1

```powershell
PS C:\> New-JCImportTemplate
```
Expand All @@ -38,7 +41,8 @@ Launches the New-JCImportTemplate menu
## PARAMETERS

### -Force
Parameter to force populate CSV with all headers when creating an update template. When selected this option will forcefully replace existing files in the current working directory. i.e. If you

Parameter to force populate CSV with all headers when creating an update template. When selected this option will forcefully replace existing files in the current working directory.

```yaml
Type: System.Management.Automation.SwitchParameter
Expand All @@ -53,6 +57,7 @@ Accept wildcard characters: False
```
### -Type
Type of CSV to Create. Update or Import are valid options.
```yaml
Expand Down
85 changes: 85 additions & 0 deletions PowerShell/JumpCloud Module/Docs/New-JCMSPImportTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
external help file: JumpCloud-help.xml
Module Name: JumpCloud
online version: https://github.com/TheJumpCloud/support/wiki/
schema: 2.0.0
---

# New-JCMSPImportTemplate

## SYNOPSIS

Creates a CSV file to either create new or update existing MSP organizations in a MSP tenant.

## SYNTAX

```
New-JCMSPImportTemplate [-Force] [-Type <Object>] [<CommonParameters>]
```

## DESCRIPTION

The New-JCMSPImportTemplate command is a menu driven function that creates a CSV template for the `Update-JCMSPFromCSV` and `Import-JCMSPFromCSV` functions. Templates for updated existing orgs are populated with the ids, names and max user counts of existing orgs. The template for new organizations is populated with only a name and max user count column.

## EXAMPLES

### Example 1

```powershell
PS C:\> New-JCMSPImportTemplate
```

Launches the New-JCMSPImportTemplate menu

## PARAMETERS

### -Force

Parameter to force populate CSV with all headers when creating an update template.
When selected this option will forcefully replace existing files in the current working directory.
i.e.
If you

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Type
Type of CSV to Create.
Update or Import are valid options.
```yaml
Type: System.Object
Parameter Sets: (All)
Aliases:
Accepted values: Import, Update

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
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Updates the JumpCloud Module Settings File
## SYNTAX

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

## DESCRIPTION
Expand Down
Loading

0 comments on commit a526529

Please sign in to comment.