It should be running them as root, same as it would when running from a policy, but since I probably only use Casper Remote like once a year at best, you may want to test it to be sure.
Thank you sir. I just started (seriously) playing with Casper Remote today. Wondered if "sudo" was redundant or not.
It is redundant. Casper Remote actually creates hidden policies in the JSS and runs the commands like a policy. So whether you use a policy or Casper Remote, you're doing the same thing.
Casper remote does run via policies. It creates a hidden policy, tells the client to execute it, then removes that policy. There was a post here about a month or so ago describing how it works internally. So Casper Remote or Policy all run the same.
sudo is certainly redundant. All scripts execute as root. Additionally, as you may know, many environment variables are skipped. That means you should set the full path to commands in your script, such as instead of 'launchctl list', you'd use '/bin/launchctl list'.
Yeah, the post describing how Casper Remote works may have been this one? https://jamfnation.jamfsoftware.com/featureRequest.html?id=4343#responseChild13197 From me ironically enough, although maybe it was a different one.
Anyway, yes, it runs stuff as root, because it really is just executing a policy in the end.