cancel
Showing results for 
Search instead for 
Did you mean: 

Restricted Software

Highlighted
Head in the Cloud

Restricted Software

Hi All!

 

I created this Apple Script to look for applications and quit them if found. Currently I am running it from our directory controller, JumpCloud every 20 seconds and it seems to be working successfully. I thought I would share. Hoping to code in an email notification on violation at some point.

 

tell application "System Events"
	
	set ProcessList to name of every process
	
	if "Terminal" is in ProcessList then
		
		set ThePID to unix id of process "Terminal"
		
		do shell script "kill -KILL " & ThePID
		
		display dialog "This application is restricted. Please submit a ticket if you have legitimate need for this application"
		
	end if
	
end tell

Thought I would share if anyone else is looking for something similar,

Jared

Find this helpful? Click the kudos button. Thanks!
1 REPLY
Head in the Cloud

Re: Restricted Software

tell application "System Events"
	
	set ProcessList to name of every process
	
	if "Terminal" is in ProcessList then
		
		set ThePID to unix id of process "Terminal"
		
		do shell script "kill -KILL " & ThePID
		
		display dialog "This application is restricted. Please submit a ticket if you have legitimate need for this application."
		
		tell application "Mail"
			
			set theSubject to "Restricted Software Violation" -- the subject
			
			set theContent to "Violation - Terminal Opened " -- the content
			
			set theAddress to "technology@flitt.org" -- the receiver 
			
			set theSignatureName to "Automated Management" -- the signature name
			
			set msg to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
			
			tell msg to make new to recipient at end of every to recipient with properties {address:theAddress}
			
			send msg
			
		end tell
		
	end if
	
end tell

Updated Version that sends email notification.

Find this helpful? Click the kudos button. Thanks!
Labels