Example #1
0
 public void SetAccountAsLocalService()
 {
     ServiceCredentialsEditor.SetWindowsServiceCredentials(_serviceController.ServiceName, WellKnownSidType.LocalServiceSid);
 }
Example #2
0
 public void SetAccountAsLocalSystem()
 {
     ServiceCredentialsEditor.SetWindowsServiceCredentials(_serviceController.ServiceName, ServiceCredentialsEditor.LOCAL_SYSTEM_USER, null);
 }
Example #3
0
        public bool IsServiceRunAsLocalSystem()
        {
            var serviceUserName = "******" + ServiceCredentialsEditor.GetWindowsServiceUserName(_serviceController.ServiceName);

            return(serviceUserName.Equals(ServiceCredentialsEditor.LOCAL_SYSTEM_USER, StringComparison.CurrentCultureIgnoreCase));
        }