C#读取/写入Active Directory-AccountExpires属性 [英] C# Read/Write Active Directory - AccountExpires Property
本文介绍了C#读取/写入Active Directory-AccountExpires属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我在万维网上读到了有关该主题的内容,但没有任何效果.
你能帮我吗?
我如何使用C#读写此属性?
我尝试:
var oUserDE = new DirectoryEntry("my path to the object"); DirectorySearcher oSearch = new DirectorySearcher(oUserDE); SearchResult oResult = oSearch.FindOne(); oUserDE = oResult.GetDirectoryEntry(); //X is NULL var x = oUserDE.Properties["accountexpires"].Value;
解决方案
噢,我忘了解释,其他属性我可以阅读:
- adspath
- 更改后的
- 创建时
- 名称
- objectsid
- 描述
- objectcategory
- 成员
- samaccountname
- objectguid
- 以及更多...
Hello,
i read something about the theme in World wide web, but nothing works.
Can you help me?
How can i read and write this Property with C#?
I Try it:
var oUserDE = new DirectoryEntry("my path to the object"); DirectorySearcher oSearch = new DirectorySearcher(oUserDE); SearchResult oResult = oSearch.FindOne(); oUserDE = oResult.GetDirectoryEntry(); //X is NULL var x = oUserDE.Properties["accountexpires"].Value;
解决方案
Oh i forgott to explain, other propertys i can read:
- adspath
- usnchanged
- whencreated
- name
- objectsid
- description
- objectcategory
- memberof
- samaccountname
- objectguid
- and much more ...
这篇关于C#读取/写入Active Directory-AccountExpires属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文