How to set Windows Services permissions from Powershell?

There isn't a .NET native base class for this. Microsoft did a good job for providing a way to set permissions for files, directories, registry, and Active Directory groups/objects, but not this.

To do this in managed code, one needs to create a custom class derived from NativeObjectSecurity. This is true for services, printers, and anything else not covered by the framework-supplied classes. Not too difficult in C#.