一个UserPrincipal相当于DirectoryEntry.Invoke? [英] A UserPrincipal equivalent to DirectoryEntry.Invoke?

查看:297
本文介绍了一个UserPrincipal相当于DirectoryEntry.Invoke?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新code,随着我们的应用程序中的广告互动。目前的code使用ActiveDs接口。我改变了code使用System.DirectoryServices.AccountManagement命名空间。我们的应用程序允许用户存储密码提示。这被存储在AD一个用户定义的参数下。我知道我可以用 DirectoryEntry.Invoke(放)办法做到这一点。

I'm updating code that interacts with the AD in our application. The current code uses the ActiveDs interface. I'm changing the code to use the System.DirectoryServices.AccountManagement namespace. Our application allows a user to store a password hint. This is stored in the AD under a user defined parameter. I know I can do this with the DirectoryEntry.Invoke("put") method.

反正是有与UserPrincipal做到这一点,或者我需要调用 GetUnderlyingObject 方法,然后在 DirectoryEntry.Invoke(放 )打电话?

Is there anyway to do this with UserPrincipal, or do I need to call the GetUnderlyingObject method and then the DirectoryEntry.Invoke("put") call?

任何建议/意见将AP preciated。

Any suggestions/comments would be appreciated.

推荐答案

UserPrincipal 类是可扩展的,所以你可以在面更底层的属性的DirectoryEntry 对象,就在您的用户主体。

The UserPrincipal class is extensible, so you can "surface" more of the properties of the underlying DirectoryEntry object right on your user principal.

使用可扩展的技术,这是在MSDN文章管理目录安全主体在.NET Framework 3.5 ,你应该能够也使提供的自定义属性(我假设你是怎么商店的密码提示的在的DirectoryEntry )的扩展 UserPrincipal 类。

Using that extensibility technique, which is explained in the MSDN article Managing Directory Security Principals in the .NET Framework 3.5, you should be able to also make available a custom attribute (which I assume is how you store that password hint in your DirectoryEntry) on an extended UserPrincipal class.

这篇关于一个UserPrincipal相当于DirectoryEntry.Invoke?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆