Control Deadline Slave 'AfterTask' from deadlinecommand?

Oh boy. Lots of questions!

For “after current task completion” us the “RemoteControl” from deadlinecommand. It’s using the same code as the “Remote Control” menu in the Slave list.

deadlinecommand remotecontrol [machine name] OnLastTaskComplete ShutdownMachine

Here’s the list from the help text of dlc:

RemoteControl
  Send the remote command to the Deadline Launcher running on the specified
  machine(s).
    [Machine Name(s)]        The machine name, or a list of machine names
                             separated by commas.
    [Remote Command]         The remote command. The available commands are
                             StopLauncher, LaunchSlave, LaunchAllSlaves,
                             LaunchNewSlave, RemoveSlave, LaunchSlaveDelay,
                             StopSlave, RelaunchSlave, ForceStopSlave,
                             ForceRelaunchSlave, OnLastTaskComplete,
                             LaunchPulse, StopPulse, RestartPulse,
                             RemotePulseCommand, LaunchProxyServer,
                             StopProxyServer, RestartProxyServer,
                             LaunchBalancer, StopBalancer, RestartBalancer,
                             RemoteBalancerCommand, LaunchMonitor,
                             StopMonitor, StopConfig, RestartMachine,
                             StartMachine, ShutdownMachine, Execute,
                             ExecuteNoWait
    [Argument]               The argument for LaunchSlave, LaunchNewSlave,
                             and RemoveSlave is the name of the Slave. The
                             argument for Execute and ExecuteNoWait is the
                             command to execute. Valid arguments for
                             OnLastTaskComplete are Continue, StopSlave,
                             RestartSlave, CheckForTasks, CancelTask,
                             ClearFailureCache, ShutdownMachine [comment] and
                             RestartMachine [comment]. [comment] is a message
                             that can be sent to explain why the shutdown or
                             restart machine command was executed. It will be
                             recorded in the machines event log. Valid
                             arguments for RemotePulseCommand are
                             HouseCleaning, PendingJobScan, RepositoryRepair,
                             and PowerManagement. Valid arguments for
                             RemoteBalancerCommand are Balancing.

On the license front, Deadline actually has no awareness of how many licenses are available. It just knows when it can’t get one. You’d have to use the usual FlexLM tools for that like lmutil lmstat -S thinkbox -a

For the Slave info, this one:

deadlinecommand getslaves true