Click here to Skip to main content
15,890,043 members
Home / Discussions / COM
   

COM

 
QuestionIE8 Addons Icon Pin
Juergen26-Jun-09 6:20
Juergen26-Jun-09 6:20 
QuestionRe: IE8 Addons Icon Pin
led mike1-Jul-09 6:41
led mike1-Jul-09 6:41 
AnswerRe: IE8 Addons Icon Pin
Juergen2-Jul-09 2:01
Juergen2-Jul-09 2:01 
GeneralRe: IE8 Addons Icon Pin
led mike2-Jul-09 4:45
led mike2-Jul-09 4:45 
QuestionRe: IE8 Addons Icon Pin
myLongNic9-Jul-09 15:22
myLongNic9-Jul-09 15:22 
AnswerRe: IE8 Addons Icon Pin
Juergen10-Jul-09 0:19
Juergen10-Jul-09 0:19 
GeneralRe: IE8 Addons Icon Pin
myLongNic10-Jul-09 6:02
myLongNic10-Jul-09 6:02 
Questionget last logon time Pin
caiena24-Jun-09 7:36
caiena24-Jun-09 7:36 
i am not sure how i would do this but i am trying to modify the code below to take a directory entry and check the last logon time on eache domain controler currently it does a directory sear on each domain controler and it becomes unresponsive (this method is being call 1 time for each user on my domain i have over 3,000 users and i already have a DictionaryEntry object created

public DateTime LastLogon(string user, string domain)
{
DirectoryContext context = new DirectoryContext(DirectoryContextType.Domain, domain);
DateTime latestLogon = DateTime.MinValue;
string servername = null;
bool processed = false;
DomainControllerCollection dcc = DomainController.FindAll(context);

foreach (DomainController dc in dcc)
{
DirectorySearcher ds;
//System.Console.WriteLine(dc.Name);
bool exist = false;
using (dc)
using (ds = dc.GetDirectorySearcher())
{
ds.Filter = String.Format("(sAMAccountName={0})", username);
ds.PropertiesToLoad.Add("lastLogon");
dc.GetDirectoryEntry
ds.SizeLimit = 1;


// this search is killing my server
SearchResult sr = ds.FindOne();

if (sr != null)
{

DateTime lastLogon = DateTime.MinValue;
if (sr.Properties.Contains("lastLogon"))
{
exist = true;
lastLogon = DateTime.FromFileTime((long)sr.Properties["lastLogon"][0]);
}

if (DateTime.Compare(lastLogon, latestLogon) > 0)
{
latestLogon = lastLogon;
servername = dc.Name;
}
}

}
}

return latestLogon;
}
AnswerRe: get last logon time Pin
Stuart Dootson24-Jun-09 21:37
professionalStuart Dootson24-Jun-09 21:37 
Questioncreate an ATL project with exsisting IDL Pin
kakamoni23-Jun-09 0:56
kakamoni23-Jun-09 0:56 
AnswerRe: create an ATL project with exsisting IDL Pin
Stuart Dootson23-Jun-09 2:37
professionalStuart Dootson23-Jun-09 2:37 
QuestionNeed help Pin
kuttiam21-Jun-09 23:48
kuttiam21-Jun-09 23:48 
AnswerRe: Need help Pin
Stuart Dootson22-Jun-09 0:30
professionalStuart Dootson22-Jun-09 0:30 
AnswerRe: Need help Pin
CPallini24-Jun-09 23:29
mveCPallini24-Jun-09 23:29 
QuestionClass not registered Pin
subhabasu18-Jun-09 22:14
subhabasu18-Jun-09 22:14 
AnswerRe: Class not registered Pin
Stuart Dootson18-Jun-09 23:30
professionalStuart Dootson18-Jun-09 23:30 
AnswerRe: Class not registered Pin
Md. Marufuzzaman6-Jul-09 21:53
professionalMd. Marufuzzaman6-Jul-09 21:53 
Question[SOLVED]Exception in COM Pin
denghp18-Jun-09 21:31
denghp18-Jun-09 21:31 
AnswerRe: Exception in COM Pin
Stuart Dootson18-Jun-09 22:08
professionalStuart Dootson18-Jun-09 22:08 
GeneralRe: Exception in COM Pin
denghp18-Jun-09 22:19
denghp18-Jun-09 22:19 
GeneralRe: Exception in COM Pin
Stuart Dootson18-Jun-09 23:01
professionalStuart Dootson18-Jun-09 23:01 
GeneralRe: Exception in COM Pin
denghp18-Jun-09 23:05
denghp18-Jun-09 23:05 
GeneralRe: Exception in COM Pin
Stuart Dootson18-Jun-09 23:15
professionalStuart Dootson18-Jun-09 23:15 
GeneralRe: Exception in COM Pin
denghp18-Jun-09 23:25
denghp18-Jun-09 23:25 
AnswerRe: Exception in COM Pin
Md. Marufuzzaman6-Jul-09 21:58
professionalMd. Marufuzzaman6-Jul-09 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.