ldap

Converting a ldap date

♀尐吖头ヾ 提交于 2019-12-29 06:38:29
问题 I'm exporting users from an ldap programmatically. Therefor I'm retrieving the users from ldap. One of the attributes is whenCreated . One of the values I have to convert is: 20090813145607.0Z Directly splitting it up I get the following format: yyyyMMddHHmmss + .0Z . The problem is that the application is running in CET timezone and the time stored is UTC which is probably indicated by the .0Z . It is 14:56 UTC and the local representation is 16:56 . For summer time it seems to be 2 hours

Unknown Error (0x80005000) with LDAPS Connection

泄露秘密 提交于 2019-12-29 04:20:10
问题 I've been stuck for the last couple of hours on an annoying Active Directory bit. What I'm trying to accomplish is connect to an Active Directory via LDAP over SSL. The authentication type is anonymous. I'm using .NET Framework 4.0, C# and Visual Studio 2010. The following code should work according to various online resources. But it keeps coming up with the amazing self-explanatory: 'Unknown Error (0x80005000)'. DirectoryEntry entry = new DirectoryEntry(); entry.Path = "LDAPS://some.ldap

How to convert LDAP timestamp to Unix timestamp

拟墨画扇 提交于 2019-12-28 13:21:52
问题 When I retrieve the LDAP attribute "pwdLastSet" of an Active Directory using PHP I get a value like 1.29265206716E+17. I know that this value represents the date "Tue Aug 17 2010 14:11:11 GMT+0200". How can I convert this value to a Unix timestamp in PHP? Thanks for any hints! 回答1: Please see here. Actually it boils down to converting the FILETIME timestamp into a UNIX timestamp: $fileTime = "130435290000000000"; $winSecs = (int)($fileTime / 10000000); // divide by 10 000 000 to get seconds

Query From LDAP for User Groups

那年仲夏 提交于 2019-12-28 12:34:30
问题 How To Get User group of user from LDAP active directory in C# .NET for ASP. In my Scenario I want to Pass user name to method which query from LDAP Active directory and tell me my user is Member of This User Groups. Please help me in this 回答1: If you're on .NET 3.5 or newer, you can also use the new System.DirectoryServices.AccountManagement (S.DS.AM) namespaces. With this, you can do something like: // create context for domain PrincipalContext ctx = new PrincipalContext(ContextType.Domain)

Query From LDAP for User Groups

Deadly 提交于 2019-12-28 12:34:28
问题 How To Get User group of user from LDAP active directory in C# .NET for ASP. In my Scenario I want to Pass user name to method which query from LDAP Active directory and tell me my user is Member of This User Groups. Please help me in this 回答1: If you're on .NET 3.5 or newer, you can also use the new System.DirectoryServices.AccountManagement (S.DS.AM) namespaces. With this, you can do something like: // create context for domain PrincipalContext ctx = new PrincipalContext(ContextType.Domain)

.Net's Directory Services throws a strange exception

人盡茶涼 提交于 2019-12-28 04:22:07
问题 I have a small C# solution used to check users credentials. It works fine for two of my teammates, but on my PC I get an exception. The relevant code: PrincipalContext context = new PrincipalContext(ContextType.Domain); if (context.ValidateCredentials(System.Environment.UserDomainName + "\\" + usr, pwd)) return true; else return false; And the exception is: DirectoryOperationException, "The server cannot handle directory requests.". I tried creating context with the explicit server name and

How to get all the AD groups for a particular user?

老子叫甜甜 提交于 2019-12-27 17:01:50
问题 I checked this post already. But it doesn't answer my question. I want to get all the active directory groups in which a particular user is a member. I've written the following code. But I'm not able to proceed further as I don't know how to give the filter and how to access the properties. class Program { static void Main(string[] args) { DirectoryEntry de = new DirectoryEntry("LDAP://mydomain.com"); DirectorySearcher searcher = new DirectorySearcher(de); searcher.Filter = "(&(ObjectClass

Kerberos+LDAP+NFSv4 实现单点登录(中)

隐身守侯 提交于 2019-12-26 15:48:20
Kerberos+LDAP+NFSv4 实现单点登录(中) 五.nfs服务器的安装 1.安装nfs-kernel-server root@debian:~# apt-get install nfs-kernel-server nfs-common 修改/etc/default/nfs-kernel-server文件 将 NEED_SVCGSSD="" 改为 NEED_SVCGSSD="yes" 重启nfs-kernel-server root@debian:~# /etc/init.d/nfs-kernel-server stop root@debian:~# /etc/init.d/nfs-kernel-server start root@debian:~# ps -e |grep gss 10275 ? 00:00:00 rpc.svcgssd 2.安装libnss-ldapd、nslcd 为了获取ldap用户信息,要安装libnss-ldapd、nslcd 在新立得选上libnss-ldapd、nslcd会自动将libpam-ldapd、nscd、nslcd-utils三个包打上安装标记,可手工将该三个包去掉安装标记,不需此三个包 root@debian:~# apt-get install libnss-ldapd nslcd 注意安装nslcd配置过程中

Kerberos+LDAP+NFSv4 实现单点登录(续4)--SASL/GSSAPI

随声附和 提交于 2019-12-26 14:44:01
前篇<Kerberos+LDAP+NFSv4 实现单点登录(续1)--dns+dhcp>的krb5 + ldap + bind9 + bind9-dyndb-ldap 全面升级到debian 10,出现bind9-dyndb-ldap的GSSAPI+krb5_keytab认证机制无法连接ldap数据库. 查看日志: SASL/GSSAPI authentication started Error: Local error Additional info: SASL(-1): generic failure: GSSAPI Error: Miscellaneous failure (see text) (Did not find a plugin for ccache_ops) 网上搜索有关GSSAPI+ccache_ops未果,不得不自己动手调试. 思路:从bind9-dyndb-ldap软件包开始及其各依赖包逐个手动降级;或者从正常debian 9开始,修改软件源为debian 10,逐个升级.即降级/升级一个,测试一次. 说明:debian系统是无法自动降级的,可修改软件源为低版或手动下载低版deb包重装软件包 实际整个调试过程还是盲人摸象.krb5、ldap、sasl都是复杂的东西,问题有可能在服务端,也有可能在客户端,也有可能配置上漏缺. 本人能力有限

Get LastLogonUser and LastLogonDate on computers in AD

蹲街弑〆低调 提交于 2019-12-25 18:25:08
问题 We can use Get-ADComputer $computerName -Properties LastLogonDate to get LastLogonDate . But how to know which user did the Last Logon? Get-ADUser has a LastLogon property, but it seems we could not use it to decide which computer the user logon. 回答1: You're misunderstanding the meaning of LastLogonDate in this context. It's the timestamp of when the computer account last authenticated against the domain, not the timestamp of when a user last logged into that particular computer. To determine