Casting ActiveDirectory pwdLastSet property without using ActiveDs

前端 未结 2 1518
轮回少年
轮回少年 2021-01-06 11:30

Ok. So I\'m trying to find a way to avoid including ActiveDs in my project because I\'m having trouble getting the dll to show up in the installer. The only reason to have i

2条回答
  •  鱼传尺愫
    2021-01-06 12:09

    What is wrong with this code? It should work fine:

        SearchResult sr = ds.FindOne(); 
        hacked = DateTime.FromFileTime((long)sr.Properties["pwdLastSet"][0]); 
    

提交回复
热议问题