Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c#active directory临时组成员资格?_C#_Active Directory_Ldap_Ttl_Adgroup - Fatal编程技术网

c#active directory临时组成员资格?

c#active directory临时组成员资格?,c#,active-directory,ldap,ttl,adgroup,C#,Active Directory,Ldap,Ttl,Adgroup,是否有任何方法可以将用户添加到组中的确切时间,然后自动从组中删除该用户? 例如。: CN=testuser1和CN=testgroup1 现在我想将CN=testuser1添加到CN=testgroup1中一天。 在这一天之后,用户应该自动离开(不再是该组的成员)CN=testgroup1 这是否可以通过System.DirectoryServices.AccountManagement实现,System.DirectoryServices或者除了Powershell脚本之外还有其他解决方案吗

是否有任何方法可以将用户添加到组中的确切时间,然后自动从组中删除该用户?
例如。:
CN=testuser1
CN=testgroup1

现在我想将
CN=testuser1
添加到
CN=testgroup1
中一天。
在这一天之后,用户应该自动离开(不再是该组的成员)
CN=testgroup1
这是否可以通过
System.DirectoryServices.AccountManagement实现
System.DirectoryServices或者除了Powershell脚本之外还有其他解决方案吗

提示:我不想要带有powershell脚本之类的解决方案。这应该在我的c#程序中完成。我有一个windows窗体,其中有3个文本框:

  • 来自广告的用户名:在广告中搜索用户(我已经有了搜索者)
  • 广告中的Groupname:在广告中搜索组(我已经有了搜索者)
  • 和持续时间:我想在这里输入用户在该组中的持续时间(以天为单位)
当我按下“将用户临时添加到组”按钮时,应将用户添加到该组中一段特定时间,我可以在该持续时间文本框中输入该时间


提前谢谢

是的,这是可能的。它要求您具有Windows Server 2016林,并且启用了特权访问管理可选功能


一旦有了这些,就可以为链接值(如组成员资格)指定TTL。这个博客向你展示了如何做到这一点。我不知道您是否可以通过ADSI(System.DirectoryServices)提供语法,或者您是否需要返回到System.DirectoryServices.Protocols的直接LDAP调用。

因此,当我启用“PAM”时,我可以设置这样的路径(?):当我向组添加用户时,对吗?谢谢你的链接@如果有人能提供一个C#示例,Brian DesmondIt会很好。