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

ServiceControllerPermissionEntry

Defines the smallest unit of a code access security permission that is set for a ServiceController.
public string MachineName { get; }

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

Gets the access levels used in the permissions request.

public string ServiceName { get; }

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

Initializes a new instance of the ServiceControllerPermissionEntry class.

public ServiceControllerPermissionEntry(ServiceControllerPermissionAccess permissionAccess, string machineName, string serviceName)

Initializes a new instance of the ServiceControllerPermissionEntry class with the specified permission access levels, the name of the computer, and a short name that identifies the service.