Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why static classes? Pin
PIEBALDconsult4-Dec-12 3:37
mvePIEBALDconsult4-Dec-12 3:37 
GeneralRe: Why static classes? Pin
Eddy Vluggen4-Dec-12 4:21
professionalEddy Vluggen4-Dec-12 4:21 
GeneralRe: Why static classes? Pin
PIEBALDconsult4-Dec-12 4:34
mvePIEBALDconsult4-Dec-12 4:34 
GeneralRe: Why static classes? Pin
Eddy Vluggen4-Dec-12 5:02
professionalEddy Vluggen4-Dec-12 5:02 
GeneralRe: Why static classes? Pin
PIEBALDconsult4-Dec-12 8:47
mvePIEBALDconsult4-Dec-12 8:47 
Questioni need advice on joining an Open source project Pin
Syrian_guy3-Dec-12 5:08
Syrian_guy3-Dec-12 5:08 
AnswerRe: i need advice on joining an Open source project Pin
DaveyM693-Dec-12 5:24
professionalDaveyM693-Dec-12 5:24 
AnswerCross posted from the Lounge. Pin
Pete O'Hanlon3-Dec-12 5:24
mvePete O'Hanlon3-Dec-12 5:24 
AnswerRe: i need advice on joining an Open source project Pin
fjdiewornncalwe3-Dec-12 5:27
professionalfjdiewornncalwe3-Dec-12 5:27 
QuestionDetect if ANY control is clicked inside a form Pin
Dennis Bork3-Dec-12 3:05
Dennis Bork3-Dec-12 3:05 
QuestionRe: Detect if ANY control is clicked inside a form Pin
Richard Deeming3-Dec-12 3:10
mveRichard Deeming3-Dec-12 3:10 
AnswerRe: Detect if ANY control is clicked inside a form Pin
Dennis Bork3-Dec-12 3:14
Dennis Bork3-Dec-12 3:14 
SuggestionRe: Detect if ANY control is clicked inside a form Pin
Richard Deeming3-Dec-12 3:25
mveRichard Deeming3-Dec-12 3:25 
AnswerRe: Detect if ANY control is clicked inside a form Pin
Simon_Whale3-Dec-12 3:45
Simon_Whale3-Dec-12 3:45 
GeneralRe: Detect if ANY control is clicked inside a form Pin
Thomas Daniels3-Dec-12 7:28
mentorThomas Daniels3-Dec-12 7:28 
AnswerRe: Detect if ANY control is clicked inside a form Pin
DaveyM693-Dec-12 5:02
professionalDaveyM693-Dec-12 5:02 
Question[SOLVED] Setting the focus back to the window which had it last Pin
Dennis Bork3-Dec-12 2:33
Dennis Bork3-Dec-12 2:33 
QuestionAD Directory catastrophic failure Pin
MacUseless2-Dec-12 21:56
MacUseless2-Dec-12 21:56 
Hi,

I'm having some issues with reading an AD directory,
Each time i request the directory from AD i get the following catastrophic failure
Later in the program i'm using a impersonation class.
When i disable this the code works otherwise it returns the catastrophic failure.

C#
//string OU = "OU=Medewerkers,OU=Hogeschool Utrecht,DC=medewerkers,DC=ad,DC=hvu,DC=nl"; // AD LDAP medewerkers
//dirEntry.AuthenticationType = AuthenticationTypes.Secure;
string OU = "DC=medewerkers,DC=ad,DC=hvu,DC=nl"; // AD LDAP medewerkers
DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + OU);
DirectorySearcher dirSearcher = new DirectorySearcher(dirEntry);
dirSearcher.SearchScope = SearchScope.Subtree;

dirSearcher.Filter = "mail=" + user;// er wordt hier gefilterd op email adres

dirSearcher.PropertiesToLoad.Add("profilePath");// Reads AD profile and returns the profilePath i.e. \\mdw\dfs\profiles\benjamin.diepeveen
SearchResult sResult = dirSearcher.FindOne();// Returns catastrophic failure



This is my impersonation, when i disable this my code works but only for local users.
C#
                using (new Impersonator(txtGebruiker.Text, txtDomein.Text, txtPw.Text))
                {
                    // this will attempt to change the directory to <directoryname>.old if you have proper acccess
                    string profile = GetProfilePath(txtProfiel.Text);
                    //Directory.Move(profile, profile + ".old");
                    Directory.Move(@"C:\Test", @"C:\Test.old");
                    txtLog.Text = "Profiel locatie\n" + profile + "is omgezet naar .old "; // displays the profile name in log
}


Any help / suggestions or hints on what i did wrong are
appriciated.

Thanks in advance Smile | :)
AnswerRe: AD Directory catastrophic failure Pin
Dave Kreskowiak3-Dec-12 2:20
mveDave Kreskowiak3-Dec-12 2:20 
AnswerRe: AD Directory catastrophic failure Pin
Jason Gleim3-Dec-12 10:05
professionalJason Gleim3-Dec-12 10:05 
GeneralRe: AD Directory catastrophic failure Pin
MacUseless3-Dec-12 20:34
MacUseless3-Dec-12 20:34 
QuestionTFS 2010 : Email alerts are not working Pin
NarVish2-Dec-12 21:04
NarVish2-Dec-12 21:04 
AnswerRe: TFS 2010 : Email alerts are not working Pin
Richard MacCutchan2-Dec-12 21:52
mveRichard MacCutchan2-Dec-12 21:52 
GeneralRe: TFS 2010 : Email alerts are not working Pin
NarVish2-Dec-12 21:59
NarVish2-Dec-12 21:59 
AnswerRe: TFS 2010 : Email alerts are not working Pin
Pete O'Hanlon2-Dec-12 21:53
mvePete O'Hanlon2-Dec-12 21:53 

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.