microsoft / shell-intune-samples

Sample shell scripts for Intune admins.
MIT License
637 stars 213 forks source link

Failed to install Microsoft Teams #52

Closed hlgrbmbm closed 2 years ago

hlgrbmbm commented 2 years ago

Hi all, I am using the shell-intune script to install MS Teams as specified:

Run script as logged in user : No Hide script notifications on devices : Not configured Script frequency : Not configured Number of retries if script fails : 3

Nevertheless, I get the following error message in the log:

##############################################################
# Mon May  2 14:49:44 CEST 2022 | Logging install of [Microsoft Teams] to [/Library/Logs/Microsoft/IntuneScripts/installTeams/Microsoft Teams.log]
############################################################

Mon May  2 14:49:44 CEST 2022 | Checking if we need Rosetta 2 or not
Mon May  2 14:49:44 CEST 2022 | Waiting for other [/usr/sbin/softwareupdate] processes to end
Mon May  2 14:49:44 CEST 2022 | No instances of [/usr/sbin/softwareupdate] found, safe to proceed
usage: softwareupdate <cmd> [<args> ...]

** Manage Updates:
    -l | --list     List all appropriate update labels (options:  --no-scan, --product-types)
    -d | --download     Download Only
    -i | --install      Install
        <label> ... specific updates
        -a | --all      All appropriate updates
        -R | --restart      Automatically restart (or shut down) if required to complete installation.
        -r | --recommended  Only recommended updates
             --os-only  Only OS updates
             --safari-only  Only Safari updates
             --stdinpass    Password to authenticate as an owner. Apple Silicon only.
             --user Local username to authenticate as an owner. Apple Silicon only.
    --list-full-installers      List the available macOS Installers
    --fetch-full-installer      Install the latest recommended macOS Installer
        --full-installer-version    The version of macOS to install. Ex: --full-installer-version 10.15
    --install-rosetta   Install Rosetta 2
    --background        Trigger a background scan and update operation

** Other Tools:
    --dump-state        Log the internal state of the SU daemon to /var/log/install.log
    --evaluate-products Evaluate a list of product keys specified by the --products option 
    --history       Show the install history.  By default, only displays updates installed by softwareupdate.  
    --all           Include all processes in history (including App installs) 

** Options:
    --no-scan       Do not scan when listing or installing updates (use available updates previously scanned)
    --product-types <type>      Limit a scan to a particular product type only - ignoring all others
        Ex:  --product-types macOS  || --product-types macOS,Safari 
    --products      A comma-separated (no spaces) list of product keys to operate on. 
    --force         Force an operation to complete.  Use with --background to trigger a background scan regardless of "Automatically check" pref 
    --agree-to-license      Agree to the software license agreement without user interaction.

    --verbose       Enable verbose output
    --help          Print this help

Mon May  2 14:49:44 CEST 2022 | Rosetta has been successfully installed.
Mon May  2 14:49:44 CEST 2022 | Checking if we need to install or update [Microsoft Teams]
Mon May  2 14:49:44 CEST 2022 | [Microsoft Teams] not installed, need to download and install
Mon May  2 14:49:44 CEST 2022 | Dock is here, lets carry on
Mon May  2 14:49:44 CEST 2022 | Starting downlading of [Microsoft Teams]
Mon May  2 14:49:44 CEST 2022 | Waiting for other [curl -f] processes to end
Mon May  2 14:49:44 CEST 2022 | No instances of [curl -f] found, safe to proceed
Mon May  2 14:49:44 CEST 2022 | Downloading Microsoft Teams
Mon May  2 14:49:46 CEST 2022 | Unknown file type [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Neo7RUCw/?linkid=869428], analysing metadata
Mon May  2 14:49:46 CEST 2022 | Downloaded [Microsoft Teams.app] to [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Neo7RUCw/install.pkg]
Mon May  2 14:49:46 CEST 2022 | Detected install type as [PKG]
Mon May  2 14:49:46 CEST 2022 | Waiting for other [/Applications/Microsoft Teams.app/Contents/MacOS/Teams] processes to end
Mon May  2 14:49:46 CEST 2022 | No instances of [/Applications/Microsoft Teams.app/Contents/MacOS/Teams] found, safe to proceed
Mon May  2 14:49:46 CEST 2022 | Installing Microsoft Teams
installer: This package requires Rosetta 2 to be installed.
                Please install Rosetta 2 and then try again.
                    `sudo softwareupdate --install-rosetta`

installer: Error - Microsoft Teams kann nicht auf diesem Computer installiert werden.
Mon May  2 14:49:46 CEST 2022 | Failed to install Microsoft Teams

I am unfortunately a complete beginner as far as shell scripting is concerned. Could someone help me with troubleshooting.

best regards and thanks in advance

mgdmdz commented 2 years ago

hi, you have it there :)

Please install Rosetta 2 and then try again.
                    `sudo softwareupdate --install-rosetta`
hlgrbmbm commented 2 years ago

i have run rosetta2 locally on the device via the terminal. How can I run the script again on the client?

In the script itself, is there a function for rosetta2?

Simple function to install Rosetta 2 if needed.

Does it need to be installed separately if needed? Best regards axel

theneiljohnson commented 2 years ago

There was a bug in the rosetta function, can you download again and re test please?

hlgrbmbm commented 2 years ago

Thanks for your help, I have updated the intune script and will install some macs today to check if it works. I have implemented some other scripts as well, they all fail (i.e. installAcrobatDC.sh), they all use the same fuction?

hlgrbmbm commented 2 years ago

the MS teams installation is working fine now.

theneiljohnson commented 2 years ago

Thanks for letting me know :-)