Tag Archives: Command

MacOS – Script – Getting the logged in user

loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' ) For more details see: https://scriptingosx.com/2019/09/get-current-user-in-shell-scripts-on-macos/

Posted in Labs | Tagged , , | Comments Off on MacOS – Script – Getting the logged in user

Mac – Set NTP time server from command line

Active Directory login, Keyserver access, SafeConnect, etc all require the connecting client to have a time setting that is within 5 minutes or so of the server’s time setting.  It is therefore useful to use a “network time protocol” server … Continue reading

Posted in Labs | Tagged , , , | Comments Off on Mac – Set NTP time server from command line

Labstats – Remote install and uninstall

See the useful information at: http://support.labstats.com/index.php?/Knowledgebase/Article/View/163/0/helpful-installuninstall-commands-for-the-labstats-client

Posted in Labs | Tagged , | Comments Off on Labstats – Remote install and uninstall

Mac – Using Install command line to install packages

Some software can not be installed on the master image computer because it needs to be uniquely installed on each clone.  So rather then have to copy packages to each clone after imaging, why not put the packages in a … Continue reading

Posted in Articles, Labs | Tagged , , | Comments Off on Mac – Using Install command line to install packages

Mac – Removing printers with command line

I use lpadmin -x to remove printers when needed as in: lpadmin -x Spencer-116-Color lpadmin can be used for a bunch of other chores.  See: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/lpadmin.8.html Interestingly, the -x option isn’t listed in the man page! See also: http://hints.macworld.com/article.php?story=20061203221317612 For … Continue reading

Posted in Labs | Tagged , | Comments Off on Mac – Removing printers with command line

Windows – Change computer decsription from command line

Sometimes it’s useful to use the computer description field to store information like the the image version.  I typically do this in automated post imaging tasks, however, it is sometime necessary to manually reset this description field. The command line … Continue reading

Posted in Labs | Tagged , | Comments Off on Windows – Change computer decsription from command line

Mac – Turn wireless on or off via command line

To control the network settings with the command line try: networksetup -listnetworkserviceorder Then: To display current state of wireless: networksetup -getairportpower <device name> Or to turn wireless off or on: networksetup -setairportpower <device name> <on off> For a longer description … Continue reading

Posted in Labs | Tagged , , | Comments Off on Mac – Turn wireless on or off via command line