public void GrantLogonAsService(WindowsUser windowsUser) { /*LsaManaged lsa = new LsaManaged(); * lsa.AddPrivileges(windowsUser.Username, "SeServiceLogonRight");*/ LsaUtility.SetRight(windowsUser.Username, "SeServiceLogonRight"); }
static void Main(string[] args) { foreach (string accountName in args) { LsaUtility.SetRight(accountName, "SeServiceLogonRight"); } }