using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.DirectoryServices;
namespace ADCommunicator
{
public class CreatADUsers
{
#region 启用户用
/// <summary>
/// 函 数 名:EnableAccount
/// 功能描述:启用用户
/// </summary>
/// <param name="de">目录实体</param>
private static void EnableAccount(DirectoryEntry newuser)
{
//514 表示禁用账户
newuser.Properties["userAccountControl"].Value = 512;
//密码永不过期
newuser.Properties["userAccountControl"].Value = 66048;
newuser.CommitChanges();
newuser.Close();
}
#endregion
}
}