vmware-samples / euc-samples

Workspace ONE UEM (previously AirWatch) Samples and Guidance
https://code.vmware.com/web/workspace-one
BSD 3-Clause "New" or "Revised" License
271 stars 148 forks source link

MacOS migrationToolWS1 Revisions Were Needed to Function #238

Closed nverselab closed 1 year ago

nverselab commented 2 years ago

Just a few notes on adjustments I had to make to get the migrationToolWS1 working in my lab in case anyone else needs some direction:

Hope this helps!

Cillu commented 1 year ago

Hey @nverselab, thank you for the write up. It seems I am running into the same issues you have listed here. I am able to remedy most of them, but could you please elaborate what you did for point 2 and point 4? Thank you.

nverselab commented 1 year ago

@Cillu

2) in the migrator.sh script: In the init_registration() else statement

regex="'[A-Z0-9a-z.-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,3}'"
/bin/launchctl asuser "$currentUID" sudo -u $currentUser defaults write menu.nomad.DEPNotify textField1RegexPattern $regex

And at the begining of the Main Code under Read Configured Options

regex="^((-{1,2})([Hh]$|[Hh][Ee][Ll][Pp])|)$"
if [[ "$1" =~ $regex ]]; then

4) Also in the migrator.sh under the init_registration() function i added a button to the end of both the if and else statement:

  if [[ "$promptType" = "username" ]]; then
    log "prompting for username"
    /bin/launchctl asuser "$currentUID" sudo -u $currentUser defaults write menu.nomad.DEPNotify registrationMainTitle "Enter your username"
    /bin/launchctl asuser "$currentUID" sudo -u $currentUser defaults write menu.nomad.DEPNotify textField1Label "Username"
    /bin/launchctl asuser "$currentUID" sudo -u $currentUser defaults write menu.nomad.DEPNotify textField1RegexPattern '[A-Z0-9a-z.-_@]'
    ## Issue - Prompt for user email never shows up. Adding button to trigger registration page.
    depnotify "Status: Click the button below to start migrating."
    depnotify "Command: ContinueButtonRegister: Begin"
  else
    ## Issue - Regex does not resolve as value.  Made it a variable
    log "prompting for email"
    regex="'[A-Z0-9a-z.-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,3}'"
    /bin/launchctl asuser "$currentUID" sudo -u $currentUser defaults write menu.nomad.DEPNotify registrationMainTitle "Enter your email"
    /bin/launchctl asuser "$currentUID" sudo -u $currentUser defaults write menu.nomad.DEPNotify textField1Label "Email"
    /bin/launchctl asuser "$currentUID" sudo -u $currentUser defaults write menu.nomad.DEPNotify textField1RegexPattern $regex
    ## Issue - Prompt for user email never shows up. Adding button to trigger registration page.
    depnotify "Status: Click the button below to start migrating."
    depnotify "Command: ContinueButtonRegister: Begin"
  fi
Cillu commented 1 year ago

Thank you so much for the detailed response, much appreciated.

mzaske3 commented 1 year ago

Thanks for this and sorry for delay in getting these fixes in.