Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 9th, 2006, 01:16 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
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

Code:
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.

Regards
Ganesh
http://ganeshprof.blogspot.com
__________________
Regards
Ganesh
http://ganeshprof.blogspot.com
Find your solution here...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:29 PM.


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