Closed DanPrs closed 3 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.
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.
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.
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
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
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.
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.
Please reach out if you have any further questions or feedback.
Testing the PS function and it's not recognizing the defined key:
I tried single and double quotes. Also tried to run it from the directory the functions file is in - same error.