Posts

Showing posts from February, 2021

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

Change Host name as serial number

#!/usr/bin/env bash # Get the Serial Number of the Machine sn=$(system_profiler SPHardwareDataType | awk '/Serial/ {print $4}') # Set the ComputerName, HostName and LocalHostName scutil --set ComputerName $sn scutil --set HostName $sn scutil --set LocalHostName $sn exit 0

JAMF First Setup

#!/bin/bash ############################################################################### # Name: First Setup - with JamfHelper # Version: 1.0 # Date: 19 september 2017 # Author: Mischa van der Bent # Purpose: show info to end user ############################################################################### ## Variabelen model=`/usr/sbin/system_profiler SPHardwareDataType | grep 'Model Name:' | awk -F': ' '{print substr($2,1)}'` LoggedInUser=`/usr/libexec/PlistBuddy -c "print :dsAttrTypeStandard\:RealName:0" /dev/stdin

Remove WIFI name on system preference

#!/bin/bash sudo networksetup -removepreferredwirelessnetwork en0 EXPO2020-GUEST sudo networksetup -removepreferredwirelessnetwork en1 EXPO2020-GUEST sudo networksetup -removepreferredwirelessnetwork en0 VR exit 0

Drop Box installation

#!/bin/sh curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15" -L https://www.dropbox.com/download?os=mac > /var/tmp/DropBoxInstaller.dmg hdiutil attach /var/tmp/DropBoxInstaller.dmg cd /Volumes/Dropbox\ Installer/Dropbox.app/Contents/MacOS/ ./Dropbox\ Installer hdiutil detach /Volumes/Dropbox\ Installer/ rm -rf /var/tmp/DropBoxInstaller.dmg exit 0

Chrome Auto update by script which will download and install

#!/bin/sh #################################################################################################### # # Google Chrome Installation Script # #################################################################################################### # # DESCRIPTION # # Automatically download and install Google Chrome # #################################################################################################### # # HISTORY # # Created by Pradeep Swain on 2021-01-17 # # # Added -nobrowse flag to hdiutil attach /tmp/$VendorDMG command line arguments # Shout out to Chad Brewer (cbrewer) on JAMFNation for this fix/update # https://jamfnation.jamfsoftware.com/viewProfile.html?userID=1685 # Google Chrome Installation script # Vendor supplied DMG file VendorDMG="googlechrome.dmg" # Download vendor supplied DMG file into /tmp/ curl https://dl.google.com/chrome/mac/stable/GGRO/$VendorDMG -o /tmp/$VendorDMG # Mount vendor supplied DMG File hdiutil attach /tmp/$VendorDM...

Catalina Update without user interaction if application in available on mac

#!/bin/bash /Users/Shared/Install\ macOS\ Catalina.app/Contents/Resources/startosinstall --agreetolicense --nointeraction

MAC OS Auto Update

#!/bin/zsh # This script is meant to be used with Jamf Pro and makes use of Jamf Helper. # The idea behind this script is that it alerts the user that there are required OS # updates that need to be installed. Rather than forcing updates to take place through the # command line using "softwareupdate", the user is encouraged to use the GUI to update. # In recent OS versions, Apple has done a poor job of testing command line-based workflows # of updates and failed to account for scenarios where users may or may not be logged in. # The update process through the GUI has not suffered from these kind of issues. The # script will allow end users to postpone/defer updates X amount of times and then will # give them one last change to postpone. # This script should work rather reliably going back to 10.12 and maybe further, but at # this point the real testing has only been done on 10.14. # Please note, that this script does NOT cache updates in advance. The reason for this is # tha...

Cisco AMP uninstall script

#!/bin/sh launchctl unload /Library/LaunchDaemons/com.cisco.amp.daemon.plist rm -rf "/Applications/Cisco AMP" rm -rf /Library/Extensions/ampfileop.kext rm -rf /Library/Extensions/ampnetworkflow.kext rm -rf "/Library/Application Support/Cisco/AMP for Endpoints Connector" rm -rf /opt/cisco/amp/ rm -f /Library/Logs/Cisco/amp* rm -f /var/run/ampdaemon.pid rm -f /Library/LaunchAgents/com.cisco.amp.agent.plist rm -f /Library/LaunchDaemons/com.cisco.amp.daemon.plist rm -f /Library/LaunchDaemons/com.cisco.amp.updater.plist rm -f ~/Library/Preferences/SourceFire-Inc.FireAMPMac.plist rm -f ~/Library/Preferences/Cisco-Inc.AMP-for-EndpointsConnector.plist exit 0

Change password of one user by JAMF through script

#!/bin/bash sysadminctl -adminUser expo -adminPassword Enroll%.%Ex20 -resetPasswordFor expo -newPassword Live3x90@2o2o

Link for auto download and update patches

https://www.jamf.com/jamf-nation/discussions/33780/enable-automatic-software-updates-in-macos-catalina https://github.com/rtrouton/profiles/blob/master/EnableAutomaticDownloadandInstallationofAppleSoftwareUpdates/EnableAutomaticDownloadandInstallationofAppleSoftwareUpdates.mobileconfig https://raw.githubusercontent.com/rtrouton/profiles/master/EnableAutomaticDownloadandInstallofOffice2019Updates/EnableAutomaticDownloadandInstallofOffice2019Updates.mobileconfig

Script to download and install package by jamf on mac

#Go to shared cd /Volumes/Macintosh\ HD/Users/ #download tcl zip curl -LO http://downloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz #Unzip files tar -xvf tcl8.6.5-src.tar.gz #Go to TCL cd /Volumes/Macintosh\ HD/Users/Shared/tcl8.6.5/unix #run the command ./configure exit 0 #download expect zip curl -LO http://prdownloads.sourceforge.net/expect/expect5.45.tar.gz #Unzip files tar -xvf expect5.45.tar.gz #Go to Expect cd /Volumes/Macintosh\ HD/Users/Shared/expect5.45 #run the command ./configure exit 0

JAMF Server Upgrade process

Upgrading JSS Upgrading the JAMF Software Server (JSS) involves the following steps: 1. Prepare to upgrade. 2. Run the JSS Installer. 3. Finalize the upgrade and revert server settings. Note: The JSS Installer cannot be used to upgrade the JSS v8.1 or earlier. Prepare the JSS Installer Download the JSS Installer from JAMF Nation. 1. Connect to JAMF Nation 2. Go to My Assets. 3. Show Alternative Download (Click for Which OS want to download default for mac available.) 4. Down load the file in the server. (Both main server and DMZ if using DMZ) Note- If upgrading from version 9 to 10.5 first need to upgrade to 10.0 then 10.5. Step 1: Prepare to Upgrade Ensure the following: • You are logged in as a local administrator, not as a domain administrator. • Apache Tomcat is stopped. Tom Cat Start using command line On Mac Stop--sudo launchctl unload /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist Start-- sudo launchctl load /Library/LaunchDaemons/com.jamfsoftware....

JAMF Port and URL need to be allowed

APN and activation server to MAC and IOS devices and MAC and IOS Devices to APN (Below destination are by default allowed on network) SOURCE>> All Mac and IOS Devices DESTIONATION >> • 35-courier.push.apple.com 5223 • albert.apple.com 443 • mdmenrollment.apple.com 443 • 1-courier.push.apple.com5223 • gdmf.apple.com 8443 • deviceenrollment.apple.com • identity.apple.com • iprofiles.apple.com APN to JAMF server and JAMF to APN SOURCE>> On primes JAMF server DESTNATION>> • gateway.sandbox.push.apple.com 2195 • gateway.push.apple.com 2195 • feedback.push.apple.com 2196 • feedback.sandbox.push.apple.com 2196 • app.pendo.io 443 For VPP apps install through JAMF SOURCE>> On primes JAMF server DESTNATION>> • itunes.apple.com 80 • vpp.itunes.apple.com 80 • uclient-api.itunes.apple.com 443 For JAMF Nation connection for APN and Patch management SOURCE>> On primes JAMF server DESTNATION>> • jpp.jamfcloud.com 443 • j...

JAMF Ghost Record delete

1. After verifying the behavior above, log into MySQL as root: (Mac File Path)- /usr/local/mysql/bin/mysql -u root -p (Note: Password should be blank by default) 2. Next select the jamfsoftware Database: use jamfsoftware; 3. Next do a count on the computers table: a. OS X: select count(*) from computers; b. iOS: select count(*) from mobile_devices; 4. Next do a count on the computers_denormalized table: a. OS X: select count(*) from computers_denormalized; b. iOS: select count(*) from mobile_devices_denormalized; 5. Compare the counts and if the computers_denormalized/mobile_devices_denormalized count is not the same as the records count proceed to step 6, if it is, further troubleshooting is required to determine the root cause of your error. 6. If there is a ghost record(s) in the JSS, go into that record in the JSS and click on it, and take note of the id number(s) in the URL(s). 7. Verify that that ghost record(s) is/are actually in the denormalized table by looking in that ...