SharePoint 2016 AD 数据同步(一,数据导入)
class Program
{
static void Main(string[] args)
{
string ldapPath = "LDAP://10.xxx.xxx.xxx/DC=xxxx,DC=com";
string userName = "Administrator";
string password = "Admin123";
//reference http://www.cnblogs.com/CSharpDevelopers/p/3634635.html
//测试查找OU
DirectoryEntry rootDirectoryEntry;
if (userName != string.Empty)
{
rootDirectoryEntry = new DirectoryEntry(ldapPath, userName, password);
}
else
{
rootDirectoryEntry = new DirectoryEntry(ldapPath);
}
DataTable dt = GetTableFromExcel("D:\\SPCode_dct\\SPPM\\ADusers.xlsx");
//设定OU名
string currentValue = "FromCode";
/