Hello all -
my first attempt at applescript (raised on windows - sorry-)
I created this script using data from the simple 'Get System Info' - It is supposed to display the user name that is logged in, computer name, ip address, and Mac address. - there is also a button to capture a screenshot for support purposes.
I have it set as a policy so the user can run in self service to supply the info to the helpdesk. A few issues when run via self service:
1. Shows 'root' as logged in user - I'm guessing because casper runs under these credentials?
2. shows my mac address as my wifi connection mac address even though wifi is disabled,
3. shows my ipaddress as 'missing value' - which happens with wifi enabled or disabled.
does anyone know how I can pull this data from the current active network connection?
I did go over the following link: https://jamfnation.jamfsoftware.com/discussion.html?id=11243
but can't figure out how to add mac address to the solution scripts, and we cannot install any freeware solutions
I's appreciate any help.
osascript <<EOD
set user to short user name of (system info)
set nm to computer name of (system info)
set mac to primary Ethernet address of (system info)
set ip4 to IPv4 address of (system info)
display dialog "You are logged in as: " & tab & tab & user & return & "Computer name: " & tab & tab & tab & nm & return & "IP address: " & tab & tab & tab & tab & ip4 & return & "Mac address: " & tab & tab & tab & mac ¬
with icon file "System:Library:PreferencePanes:Network.prefPane:Contents:Resources:Network.icns" with title "System Information" buttons {"Screenshot", "OK"}
if result = {button returned:"Screenshot"} then
tell application "System Events"
keystroke (ASCII character 36) using {command down}
key code 4 using {command down, shift down}
end tell
end if
EOD