Skip to content

Commit

Permalink
Fix bug with user password expire.
Browse files Browse the repository at this point in the history
  • Loading branch information
KayleMine authored Aug 16, 2023
1 parent 139d9f3 commit dc6dbb4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion RAL/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Diagnostics;
Expand Down Expand Up @@ -126,6 +126,12 @@ private void button1_Click(object sender, EventArgs e) //create
{
log.Info("User groups - Add :: " + error.Message); MessageBox.Show(error.Message);
}
// Set the PasswordNeverExpires property
int ADS_UF_DONT_EXPIRE_PASSWD = 0x10000;
int userFlags = (int)NewUser.Properties["UserFlags"].Value;
NewUser.Properties["UserFlags"].Value = userFlags | ADS_UF_DONT_EXPIRE_PASSWD;

NewUser.CommitChanges();

Settings.Default.user = NameLog;
Settings.Default.Save();
Expand Down

0 comments on commit dc6dbb4

Please sign in to comment.