[英]How to set accountExpires
dirEntry.Properties["userAccountControl"].Value = val & ~0x2; //enable user
//above line no error but below line get error
dirEntry.Properties["accountExpires"].Value = DateTime.UtcNow.AddDays(1).ToFileTimeUtc();
抛出的错误是errMsg =“System.Runtime.InteropServices.COMException(0x80004005):System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.PutEx(Int32 lnControlCode,String bstrName,Object vProp)中未指定的错误\\ r \\ n \\ r \\ n \\ r \\ n在System.DirectoryServices.PropertyValueColl ...
请指教。 如果这是一个权限问题,我会在第一行遇到错误...内部部署AD(不是Azure)谢谢
对于那些来到这里同样问题的人来说,这就解决了。 。 。
Convert.ToString((Int64)DateTime.UtcNow.AddDays(1).ToFileTimeUtc())
有关更详细的讨论,请参阅此主题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.