Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 9th, 2006, 01:16 AM
Friend of Wrox
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default Set accountExpires property

Hi Experts,

I am using the following code to set the value of accountExpires for LDAP Users

DirectoryEntry oUserDE = new DirectoryEntry(strPath, LDAPUserName, LDAPPassword);;

DirectorySearcher oSearch = new DirectorySearcher(oUserDE);
oSearch.Filter = "(SAMAccountName=" + UserName + ")";
SearchResult oResult = oSearch.FindOne();
oUserDE = oResult.GetDirectoryEntry();

DateTime Dt = DateTime.Now.AddMonths(6);
oUserDE.Properties["accountExpires"].Value = Dt;
However, I am getting an error. Can anyone tell me how to do this. Basically I want to create users who should not able to login after a specific date.

Find your solution here...

Similar Threads
Thread Thread Starter Forum Replies Last Post
This property can not be set for anonymous users everest ASP.NET 2.0 Professional 2 April 19th, 2008 04:28 AM
Get Set Property value being lost asn187 ASP.NET 2.0 Professional 1 April 19th, 2007 03:09 PM
Set Listbox Selected property DaDeViL VB How-To 7 October 4th, 2006 04:04 PM
"Unable to set the FormulaArray property..." rduncan1 Excel VBA 2 August 18th, 2006 01:33 PM
DataColumn .Unique property not being set gp_mk ADO.NET 3 November 4th, 2004 06:50 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.