Posts

Uninstall ATP

#!/bin/bash echo "Is WDAV installed?" ls -ld '/Applications/Microsoft Defender ATP.app' 2>/dev/null echo "Uninstalling WDAV..." rm -rf '/Applications/Microsoft Defender ATP.app' echo "Is WDAV still installed?" ls -ld '/Applications/Microsoft Defender ATP.app' 2>/dev/null echo "Done!"

VLC Install by script

#!/bin/bash #Change Directory cd /Users/Shared/ #Download VLC curl -LO https://get.videolan.org/vlc/3.0.11.1/macosx/vlc-3.0.11.1.dmg vlc_dmg="/Users/Shared/vlc-3.0.11.1.dmg" #Mount VLC hdiutil attach /Users/Shared/vlc-3.0.11.1.dmg #Delete Old VLC Applicatio rm -rf /Applications/VLC.app #Installation cp -r /Volumes/VLC\ media\ player/VLC.app /Applications/ #Permission if [ -d /Applications/VLC\ media\ player.app ]; then chown -R root:admin /Applications/VLC.app chmod -R 775 /Applications/VLC.app fi #Cleanup /usr/bin/hdiutil detach -force /Volumes/VLC\ media\ player /bin/rm -rf "$vlc_dmg" exit 0

Remove Skype

#!/bin/sh consoleuser=$(ls -l /dev/console | awk '{ print $3 }') echo "logged in user is" $consoleuser pkill -f Skype security delete-generic-password -l "Skype for Business" /Users/$consoleuser/Library/Keychains/login.keychain folders=( "/Applications/Skype for Business.app" "/Library/Internet Plug-Ins/MeetingJoinPlugin.plugin" # "/Users/$consoleuser/Library/Containers/com.microsoft.SkypeForBusiness" "/Users/$consoleuser/Library/Logs/LwaTracing" "/Users/$consoleuser/Library/Saved Application State/com.microsoft.SkypeForBusiness.savedState" "/Users/$consoleuser/Library/Preferences/com.microsoft.SkypeForBusiness.plist" ) search="*" for i in "${folders[@]}" do echo "removing folder ${i}" rm -rf "${i}" done if [ $? == 0 ]; then echo "Success" else echo "Failure" fi

Remove Office 2016

#!/bin/sh ############################################################################################### # Name: Remove Microsoft office 2016 Mac # Version: 1.0 # Date: 23 augustus 2017 # Author: Mischa van der Bent # Purpose: This script uninstall office 2016 Mac with plist files. ############################################################################################### ## Set Logfile ##log() { ## echo "$1" ## /usr/bin/logger -t "Microsoft Uninstaller:" "$1" ##} ## log "Uninstalling Microsoft Office 2016" echo "Uninstalling Microsoft Office 2016" ## Set Variable currentuser=$(/bin/ls -la /dev/console | /usr/bin/cut -d ' ' -f 4) ## log "Uninstalling Applications" echo "Uninstalling Applications" rm -Rf "/Applications/Microsoft Excel.app" rm -Rf "/Applications/Microsoft OneNote.app" rm -Rf "/Applications/Microsoft Outlook.app" rm -Rf "/Application...

Remove office 2019

#!/bin/bash consoleuser=$(ls -l /dev/console | awk '{ print $3 }') echo "logged in user is" $consoleuser pkill -f Microsoft folders=( "/Applications/Microsoft Excel.app" "/Applications/Microsoft OneNote.app" "/Applications/Microsoft Outlook.app" "/Applications/Microsoft PowerPoint.app" "/Applications/Microsoft Word.app" # "/Users/$consoleuser/Library/Containers/com.microsoft.errorreporting" "/Users/$consoleuser/Library/Containers/com.microsoft.Excel" "/Users/$consoleuser/Library/Containers/com.microsoft.netlib.shipassertprocess" "/Users/$consoleuser/Library/Containers/com.microsoft.Office365ServiceV2" "/Users/$consoleuser/Library/Containers/com.microsoft.Outlook" "/Users/$consoleuser/Library/Containers/com.microsoft.Powerpoint" "/Users/$consoleuser/Library/Containers/com.microsoft.RMS-XPCService" "/Users/$consoleuser/Library/Containers/com...

Copy file one MAC to Another mac

#!/bin/bash hostName=$(scutil --get HostName) installLogName=$hostName-install.log systemLogName=$hostName-system.log server=10.96.81.21 folder=/Logs username=sftp_adm password=R10grandE@ currentUser=$(stat -f %Su /dev/console) if [[ ! -d /private/tmp/Logs ]] then mkdir /private/tmp/Logs fi cp /private/var/log/install.log /tmp/Logs cp /private/var/log/system.log /tmp/Logs mv /tmp/Logs/install.log /tmp/Logs/$installLogName mv /tmp/Logs/system.log /tmp/Logs/$systemLogName cd /tmp/Logs chmod 644 /tmp/Logs/$systemLogName su $currentUser -c "/usr/local/bin/expect \" send \"cd $folder\r\" expect \"sftp>\" send \"put /tmp/Logs/$systemLogName $systemLogName\r\" expect \"sftp>\" send \"put /tmp/Logs/$installLogName $installLogName\r\" expect \"sftp>\" send \"put /tmp/Logs/$installLogName $installLogName\r\" expect \"sftp>\" send \"quit\" EOF" #sftp -n $username@$server