Thursday

C#:Active Directory:Check/Uncheck Password never expires


public void SetPasswordNeverExpiresProperty(bool PasswordNeverExpires)
{
DirectoryEntry de = GetDirectoryObject(UserName);
if (PasswordNeverExpires)
{
ActiveDirectoryHelper.SetProperty(de, "userAccountControl",
(int)de.Properties["userAccountControl"].Value | 0x10000);
}
else
{
ActiveDirectoryHelper.SetProperty(de, "userAccountControl",
(int)de.Properties["userAccountControl"].Value ^ 0x10000);
}
de.CommitChanges();
}

more...

No comments:

here is powershell script on how to get list of files from changesets associated with one tfs task

$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...