Created
December 2, 2016 22:40
-
-
Save smashism/75ec3984f5cf549e32b450166c8946e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# gets user and location data to populate computer record | |
# can run on policy at any time | |
# by emily | |
# last updated 2016-12-02 | |
# Get the logged in users username | |
loggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') | |
echo "Running recon for $loggedInUser `date`..." | |
# Run recon, submitting the user's username which can then perform an LDAP lookup | |
sudo jamf recon -endUsername $loggedInUser | |
echo "Finished running recon for $loggedInUser `date`..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment