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

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