v1.3.1 = Added option to delete Computer Objects

+ Added option to delete Computer Objects
This commit is contained in:
Zack T
2018-07-02 16:21:10 -07:00
parent 27816e9a68
commit 407d6ac244

View File

@@ -3,9 +3,9 @@
###################################################################################################
# Script Name: jamf_Maintenance.sh
# By: Zack Thompson / Created: 9/15/2017
# Version: 1.3 / Updated: 6/26/2018 / By: ZT
# Version: 1.3.1 / Updated: 7/2/2018 / By: ZT
#
# Description: This script is used for cleaning up packages in a Jamf Pro Server.
# Description: This script is used for cleaning up objects in a Jamf Pro Server.
#
###################################################################################################
@@ -19,9 +19,10 @@
jamfPS="https://jss.company.com:8443"
apiPackages="${jamfPS}/JSSResource/packages/id"
apiPolicies="${jamfPS}/JSSResource/policies/id"
apiComputers="${jamfPS}/JSSResource/computers/id"
apiComputerGroups="${jamfPS}/JSSResource/computergroups/id"
jamfAPIUser=""
jamfAPIPassword=""
jamfAPIUser="APIUsername"
jamfAPIPassword="APIPassword"
##################################################
# Setup Functions
@@ -47,6 +48,8 @@ Types:
--policies | -p
--computers | c
--computergroups | -g
"
@@ -110,6 +113,15 @@ deleteFunction() {
getHelp
fi
;;
--computers | -c )
if [[ -e "${switch3}" ]]; then
# Function deleteObjects
deleteObjects "${switch3}" "${apiComputers}"
else
# Function getHelp
getHelp
fi
;;
--computergroups | -g )
if [[ -e "${switch3}" ]]; then
# Function deleteObjects