<PackageReference Include="System.Security.Permissions" Version="5.0.0-preview.2.20160.6" />

ServiceControllerPermissionAttribute

Allows declarative service controller permission checks.
public string MachineName { get; set; }

Gets or sets the name of the computer on which the service resides.

Gets or sets the access levels used in the permissions request.

public string ServiceName { get; set; }

Gets or sets the short name that identifies the service to the system.

Initializes a new instance of the ServiceControllerPermissionAttribute class.