Sharing settings report (security audit)
While I applaud the effort to learn how to collect these scripts, I would say you might just buy a copy of Apple's Remote Desktop tool.

It has pre-built data collection tools that will collect thousands of data points about each system, periodically get updates and you can run reports against the local database of last known configurations or tick a checkbox to refresh all status and then run the report.

Here is how the interface for what you ask looks:



That tool leverages ssh log in, remote apple events and Apple's own remote management hooks to be extremely flexible and running arbitrary shell scripts, custom packages, remote Apple Scripts as well as performing more direct data collection that is embedded into the OS.

The reports and data collected are all easily printed, copied or exported in tab/comma separated files for ease of re-use.