Here is a sample of shell (Bash) scripts that I've written to manage a fleet of MacBooks and Mac Pros.