TheJumpCloud / jumpcloud-ADMU

JumpCloud Active Directory Migration Utility - JCADMU
23 stars 7 forks source link

Key not recognized #29

Closed DanPrs closed 3 years ago

DanPrs commented 4 years ago

Testing the PS function and it's not recognizing the defined key:

PS C:\> Start-Migration -DomainUserName "jdoe" -JumpCloudUserName "jdoe" -TempPassword "Welcome1!" -JumpCloudConnectKey "XXXXXXXXXXXXXXXXXXX" -AcceptEULA $true -InstallJCAgent $true -LeaveDomain $true -ForceReboot $true -AzureADProfile $false  You must supply a value for JumpCloudConnectKey when installing the JC Agent
At C:\cyb-temp\jumpcloud-ADMU-1.4.0\jumpcloud-ADMU\Powershell\Functions.ps1:5376 char:36
+ ...  -eq $true){Throw [System.Management.Automation.ValidationMetadataExc ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RuntimeException

I tried single and double quotes. Also tried to run it from the directory the functions file is in - same error.

egaachyuth commented 4 years ago

There is a mistake in the function.ps1 script: 5376 char:36 If ($InstallJCAgent -eq $true ----- This should be If ($InstallJCAgent -eq $false Replace true with false then load the function.ps1 again and run the command start-migration.

DanPrs commented 4 years ago

Thanks. I worked around it by installing the agent with my own function, so I did not get a chance to test if this would work for me. In any case, thanks again.

btstevens commented 4 years ago

Good find @egaachyuth and @DanPrs . Have a look at https://github.com/TheJumpCloud/jumpcloud-ADMU/releases/tag/v1.4.1

In v1.4.1 I updated it so if you call the 'Start-Migration' function the following scenarios should occur.

Start-Migration -DomainUserName "jdoe" -JumpCloudUserName "jdoe" -TempPassword "Welcome1!" -AcceptEULA $true -LeaveDomain $false -ForceReboot $false -AzureADProfile $false

This would allow you to run the migration WITHOUT leaving the domain OR installing the agent, this allows you to migrate accounts independent of installing the JCAgent.

Start-Migration -DomainUserName "jdoe" -JumpCloudUserName "jdoe" -TempPassword "Welcome1!" -AcceptEULA $true -LeaveDomain $false -ForceReboot $false -AzureADProfile $false -InstallJCAgent $true

Because -InstallJCAgent is set to $True it will error asking for the connect key param to be added. image

Start-Migration -DomainUserName "jdoe" -JumpCloudUserName "jdoe" -TempPassword "Welcome1!" -AcceptEULA $true -LeaveDomain $false -ForceReboot $false -AzureADProfile $false -InstallJCAgent $true -JumpCloudConnectKey '8b2123b123ad51812337f80b9231b0b509f37de'

If the connectkey is provided but is not the required 40chars it will error image

Start-Migration -DomainUserName "jdoe" -JumpCloudUserName "jdoe" -TempPassword "Welcome1!" -AcceptEULA $true -LeaveDomain $false -ForceReboot $false -AzureADProfile $false -InstallJCAgent $true -JumpCloudConnectKey '8b2123b123ad51812337f80b9231b0b509f37de1'

If the connect key is 40chars it will continue and start with the install JC agent step image

If connect key is 40chars but not valid, the script will try and run the JumpCloud installer and error after aprox 30s with the following and reverse/kill the installer. image

If InstallJCAgent is $true and connect key is passed but the jumpcloud agent is already installed on the system you would see the following in the log. ' The JumpCloud agent is already installed on the system' & would continue to the next step.

image

Please reach out if you have any further questions or feedback.