Hi I have done this, its getting stuck on this line
searchresult result = searcher.findone();
the username is being passed ok e.g. an example username would be "tsy".
its says "the "tsy" search filter is invalid" I dont understand how this can be invalid, it is the correct active directory username