Active Directory Web Service for Infopath 2003 - InfoPath Dev Sign in | Join | Help in Web Services InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Web Services » Active Directory Web Service for Infopath 2003 Active Directory Web Service for Infopath 2003 Last post 07-06-2007 07:21 AM by ahardin. 11 replies. Page 1 of 1 (12 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 04-20-2007 06:08 AM ahardin Joined on 02-13-2006 United Kingdom Posts 55 Active Directory Web Service for Infopath 2003 Reply Contact HiHave got the following code from http://www.sharepointu.com/forums/Active_Directory_Web_Service_-_Updated!!!/m_41077/tm.htm and amended it for my own use to render Service.vbImports System SystemImports System.Data System.DataImports System.Web System.WebImports System.Web.Services System.Web.ServicesImports System.Web.Services.Protocols System.Web.Services.ProtocolsImports System.Web.UI.Page System.Web.UI.PageImports System.Xml<WebService(Namespace:="http://afdintranet/ADUserInfo")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ System.Xml<WebService(Namespace:="http://afdintranet/ADUserInfo")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _"http://afdintranet/ADUserInfo")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Public Class Service<WebMethod()> _Public Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End Function Class Service<WebMethod()> _Public Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End FunctionPublic Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End FunctionDim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End FunctionReturn objADL.GetAttribute(Attribute)End FunctionEnd Function<WebMethod()> _Public Function ADUserInfo() As DataSetDim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("AUTH_USER"))'Get information about the user.Public Function ADUserInfo() As DataSetDim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("AUTH_USER"))'Get information about the user.Dim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("AUTH_USER"))'Get information about the user.Dim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("AUTH_USER"))'Get information about the user.'Get information about the user.objADL.EnumerateSearch("sAMAccountName", usrCurrent) 'Search AD using the Account name of the current user."sAMAccountName", usrCurrent) 'Search AD using the Account name of the current user.Dim strGivenName As String = objADL.GetAttribute("givenName")Dim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strGivenName As String = objADL.GetAttribute("givenName")Dim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassReturn dsUserEnd FunctionEnd ClassEnd FunctionEnd Class ClassAD_Lookup.vbImports Microsoft.VisualBasic Microsoft.VisualBasicImports System.DirectoryServices System.DirectoryServicesImports System.Data System.DataPublic Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As Object Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPublic Function GetAttribute(ByVal Attribute As String) As ObjectReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionEnd FunctionPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubDim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubEnd SubPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassEnd FunctionEnd Class ClassBut am a loss to how to publish or whatever the term of phrase is as the Visual Web Developer 2005 Express project is only currently on my hard drive. I am using the code on the web site within my Form but am unable to get the ?WSDL Infopath needs to run the service.Can anyone help?AdamImports Microsoft.VisualBasicImports System.DirectoryServices System.DirectoryServicesImports System.Data System.DataPublic Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As Object Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPublic Function GetAttribute(ByVal Attribute As String) As ObjectReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionEnd FunctionPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubDim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubEnd SubPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassEnd FunctionEnd Class ClassBut am a loss to how to publish or whatever the term of phrase is as the Visual Web Developer 2005 Express project is only currently on my hard drive. I am using the code on the web site within my Form but am unable to get the ?WSDL Infopath needs to run the service.Can anyone help?Adam I'm from WALES[email protected] 04-24-2007 01:34 AM In reply to ahardin Joined on 02-13-2006 United Kingdom Posts 55 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact OK, Have the web service running successfully on the local host after installing .NET 2.0 SDK and from the SDK Command Prompt running Disco.exe. Question know is how to publsih the web service to an IIS server to roll out this service?Here's hoping for some help :-) Thanks Adam I'm from WALES[email protected] 04-25-2007 12:17 AM In reply to chang Joined on 03-29-2007 Posts 23 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact You need to create either a virtual directory or web site in IIS and then follow the instructions in this link: http://msdn2.microsoft.com/en-us/library/s9w05e9b(vs.80).aspx 07-04-2007 04:36 AM In reply to ahardin Joined on 02-13-2006 United Kingdom Posts 55 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact Now need to convert the whole script into C# before publishing, but have never programmed in C# so too much fun for me. I have tried converting the code using a web tool but creates errors. Anyone got any ideas? I'm from WALES[email protected] 07-04-2007 04:49 AM In reply to nukkumatti Joined on 12-08-2005 Germany Posts 349 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact Why do you need to convert everything in C# ? If you really need to then I guess you have to get through this by yourself. The best I can suggest is to use the msdn help and search a lot on google. If you have only small code snippets you have problems with I (others) can propably assist you but to translate your complete script into C# would just take to much time. Just had a look again and if you talk about the code you posted in this thread it's not scripting its vb.Net also managed code exactly like C# no need to convert it. Listen to Motörhead cos they play Rock'n Roll :) 07-04-2007 07:49 AM In reply to ahardin Joined on 02-13-2006 United Kingdom Posts 55 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact Hi Reason I need to convert to C# is because of policy statements in the company I am contracting for. VB is fine for development but ONLY C# for Live Web Services.I am sorry but I do not understand your point about vb.Net equalling Managed Code which in turn equals C#. The second code sample i posted was written in Visual Web Developer 2005 Express as a vb.Net web service, and works a treat.The first bit of code is my attempt at working it in to C#. Could you clarify which bits of code you are talking about and how they could be the same?Many thanks, sorry but I am very new to this programming gig and only doing under protest ?!?!?!Cheers Adam I'm from WALES[email protected] 07-05-2007 01:52 AM In reply to nukkumatti Joined on 12-08-2005 Germany Posts 349 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact Sorry but I think I am a bit confused now. In the code you posted (by the way you have the same problems than I do, everything is duplicated) I can't see any C# code.You can write managed on the .net platform with eiterh VB.NET or C#.NET. Could you please clarify one more time what code exactly you need to convert. Listen to Motörhead cos they play Rock'n Roll :) 07-05-2007 02:13 AM In reply to ahardin Joined on 02-13-2006 United Kingdom Posts 55 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact This the the successful VB code I need to convert into C#Service.vbImports System SystemImports System.Data System.DataImports System.Web System.WebImports System.Web.Services System.Web.ServicesImports System.Web.Services.Protocols System.Web.Services.ProtocolsImports System.Web.UI.Page System.Web.UI.PageImports System.Xml<WebService(Namespace:="http://afdintranet/ADLookup")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ System.Xml<WebService(Namespace:="http://afdintranet/ADLookup")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _"http://afdintranet/ADLookup")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Public Class Service<WebMethod()> _Public Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End Function Class Service<WebMethod()> _Public Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End FunctionPublic Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End FunctionDim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End FunctionReturn objADL.GetAttribute(Attribute)End FunctionEnd Function<WebMethod()> _Public Function ADUserInfo() As DataSetDim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("LOGON_USER"))'Get information about the user.Public Function ADUserInfo() As DataSetDim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("LOGON_USER"))'Get information about the user.Dim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("LOGON_USER"))'Get information about the user.Dim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("LOGON_USER"))'Get information about the user.'Get information about the user.objADL.EnumerateSearch("sAMAccountName", usrCurrent) 'Search AD using the Account name of the current user."sAMAccountName", usrCurrent) 'Search AD using the Account name of the current user.Dim strGivenName As String = objADL.GetAttribute("givenName")Dim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strGivenName As String = objADL.GetAttribute("givenName")Dim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassDim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class"department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd ClassReturn dsUserEnd FunctionEnd ClassEnd FunctionEnd Class ClassImports Microsoft.VisualBasic Microsoft.VisualBasicImports System.DirectoryServices System.DirectoryServicesImports System.Data System.DataPublic Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As Object Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPublic Function GetAttribute(ByVal Attribute As String) As ObjectReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionEnd FunctionPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubDim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubEnd SubPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassEnd FunctionEnd Class Class I'm from WALES[email protected] 07-05-2007 02:22 AM In reply to ahardin Joined on 02-13-2006 United Kingdom Posts 55 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact This is my C# conversion that 404's and produces a A first chance exception of type 'System.UriFormatException' occurred in System.dllusing System; System;using System.Data; System.Data;using System.Web; System.Web;using System.Web.Services; System.Web.Services;using System.Web.Services.Protocols; System.Web.Services.Protocols;using System.Web.UI; System.Web.UI;using System.Xml; System.Xml;using Microsoft.CSharp;[WebService(Namespace = "http://afdintranet/ADLookup")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] Microsoft.CSharp;[WebService(Namespace = "http://afdintranet/ADLookup")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]WebService(Namespace = "http://afdintranet/ADLookup")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]public class Service class Service{System.Web.HttpRequest Request = new HttpRequest("filename", "url", "query");[WebMethod()]public void ADQuery(string SearchParameter, string SearchString, string Attribute){AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.HttpRequest Request = new HttpRequest("filename", "url", "query");[WebMethod()]public void ADQuery(string SearchParameter, string SearchString, string Attribute){AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.WebMethod()]public void ADQuery(string SearchParameter, string SearchString, string Attribute){AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.public void ADQuery(string SearchParameter, string SearchString, string Attribute){AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.// Get information about the user.objADL.EnumerateSearch("sAMAccountName", usrCurrent);// Search AD using the Account name of the current user."sAMAccountName", usrCurrent);// Search AD using the Account name of the current user.// Search AD using the Account name of the current user.string strGivenName = Convert.ToString(objADL.GetAttribute("givenName"));string strSN = Convert.ToString(objADL.GetAttribute("sn"));string strTitle = Convert.ToString(objADL.GetAttribute("title"));string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}string strGivenName = Convert.ToString(objADL.GetAttribute("givenName"));string strSN = Convert.ToString(objADL.GetAttribute("sn"));string strTitle = Convert.ToString(objADL.GetAttribute("title"));string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}string strSN = Convert.ToString(objADL.GetAttribute("sn"));string strTitle = Convert.ToString(objADL.GetAttribute("title"));string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}string strTitle = Convert.ToString(objADL.GetAttribute("title"));string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}"department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}} I'm from WALES[email protected] 07-05-2007 02:28 AM In reply to nukkumatti Joined on 12-08-2005 Germany Posts 349 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact Oh man as you can the copy and paste messed up your code so that makes it already impossible to read it. Did you debug your code to actaully check where it fails. Set breakpoints into your code and then step through it with pressing F11 ind visual studio Listen to Motörhead cos they play Rock'n Roll :) 07-05-2007 02:34 AM In reply to ahardin Joined on 02-13-2006 United Kingdom Posts 55 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact If you want to see the unduplicated C# code that i am having trouble with then a link to another forum that doesn't have this problem is belowhttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1816186&SiteID=1 I'm from WALES[email protected] 07-06-2007 07:21 AM In reply to ahardin Joined on 02-13-2006 United Kingdom Posts 55 Re: Active Directory Web Service for Infopath 2003 Mark as Not AnswerMark as Answer... Reply Contact Hi no problem in debugging it compiles perfectly. It is just it exceptions out when invoking HTTP Post in IE it 404's but the output from Visual Studio says system.nullreferenceexception don't know where to go know, ah well I'm from WALES[email protected] Page 1 of 1 (12 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Hi
Have got the following code from http://www.sharepointu.com/forums/Active_Directory_Web_Service_-_Updated!!!/m_41077/tm.htm and amended it for my own use to render
Service.vb
Imports System
Imports System.Data
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.UI.Page
Imports System.Xml<WebService(Namespace:="http://afdintranet/ADUserInfo")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<WebService(Namespace:="http://afdintranet/ADUserInfo")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service<WebMethod()> _Public Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End Function
<WebMethod()> _
Public Function ADQuery(ByVal SearchParameter As String, ByVal SearchString As String, ByVal Attribute As String)Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End Function
Dim objADL As New AD_LookupobjADL.EnumerateSearch(SearchParameter, SearchString)Return objADL.GetAttribute(Attribute)End Function
objADL.EnumerateSearch(SearchParameter, SearchString)
Return objADL.GetAttribute(Attribute)End Function
End Function
Public Function ADUserInfo() As DataSetDim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("AUTH_USER"))'Get information about the user.
Dim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("AUTH_USER"))'Get information about the user.
Dim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("AUTH_USER"))'Get information about the user.
'Get information about the user.
objADL.EnumerateSearch("sAMAccountName", usrCurrent) 'Search AD using the Account name of the current user.
Dim strGivenName As String = objADL.GetAttribute("givenName")Dim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
Dim strSN As String = objADL.GetAttribute("sn")Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
Dim strTitle As String = objADL.GetAttribute("title")Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
Dim strMail As String = objADL.GetAttribute("mail")Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
Dim strDepartment As String = objADL.GetAttribute("department")Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
Dim dsUser As DataSet = New DataSet("AD_Info")Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
Dim dtUserInfo As DataTable = New DataTable("User_Info")Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
Dim drAttrib As DataRow = dtUserInfo.NewRow()dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("givenName")dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("sn")dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("title")dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("mail")dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("manager")dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("department")dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("description")dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Columns.Add("distinguishedName")drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
drAttrib("givenName") = strGivenNamedrAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
drAttrib("sn") = strSNdrAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
drAttrib("title") = strTitledrAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
drAttrib("mail") = strMaildrAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
drAttrib("department") = strDepartmentdtUserInfo.Rows.Add(drAttrib)dsUser.Tables.Add(dtUserInfo)Return dsUserEnd FunctionEnd Class
dtUserInfo.Rows.Add(drAttrib)
dsUser.Tables.Add(dtUserInfo)
Return dsUserEnd FunctionEnd Class
End FunctionEnd Class
End Class
AD_Lookup.vbImports Microsoft.VisualBasic Microsoft.VisualBasicImports System.DirectoryServices System.DirectoryServicesImports System.Data System.DataPublic Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As Object Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As ObjectPublic Function GetAttribute(ByVal Attribute As String) As ObjectReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionReturn m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd FunctionEnd FunctionPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubPublic Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubDim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End SubEnd SubPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringPublic Function Get_sAMAccountName(ByVal strLogonName As String) As StringReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassReturn strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd ClassEnd FunctionEnd Class ClassBut am a loss to how to publish or whatever the term of phrase is as the Visual Web Developer 2005 Express project is only currently on my hard drive. I am using the code on the web site within my Form but am unable to get the ?WSDL Infopath needs to run the service.Can anyone help?Adam
Imports Microsoft.VisualBasic
Imports System.DirectoryServices
Public Class AD_LookupPrivate m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As Object
Private m_SearchResult As SearchResultPublic Function GetAttribute(ByVal Attribute As String) As Object
Public Function GetAttribute(ByVal Attribute As String) As Object
Return m_SearchResult.GetDirectoryEntry().Properties(Attribute).ValueEnd Function
Public Sub EnumerateSearch(ByVal SearchParameter As String, ByVal SearchString As String)Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End Sub
Dim objDS As New DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")")m_SearchResult = objDS.FindOne()End Sub
m_SearchResult = objDS.FindOne()
End Sub
Public Function Get_sAMAccountName(ByVal strLogonName As String) As String
Return strLogonName.Substring(strLogonName.IndexOf("\") + 1)End FunctionEnd Class
But am a loss to how to publish or whatever the term of phrase is as the Visual Web Developer 2005 Express project is only currently on my hard drive. I am using the code on the web site within my Form but am unable to get the ?WSDL Infopath needs to run the service.
Can anyone help?
Adam
OK,
Have the web service running successfully on the local host after installing .NET 2.0 SDK and from the SDK Command Prompt running Disco.exe.
Question know is how to publsih the web service to an IIS server to roll out this service?
Here's hoping for some help :-)
Thanks Adam
You need to create either a virtual directory or web site in IIS and then follow the instructions in this link: http://msdn2.microsoft.com/en-us/library/s9w05e9b(vs.80).aspx
Reason I need to convert to C# is because of policy statements in the company I am contracting for. VB is fine for development but ONLY C# for Live Web Services.
I am sorry but I do not understand your point about vb.Net equalling Managed Code which in turn equals C#. The second code sample i posted was written in Visual Web Developer 2005 Express as a vb.Net web service, and works a treat.
The first bit of code is my attempt at working it in to C#. Could you clarify which bits of code you are talking about and how they could be the same?
Many thanks, sorry but I am very new to this programming gig and only doing under protest ?!?!?!
Cheers Adam
Sorry but I think I am a bit confused now. In the code you posted (by the way you have the same problems than I do, everything is duplicated) I can't see any C# code.
You can write managed on the .net platform with eiterh VB.NET or C#.NET. Could you please clarify one more time what code exactly you need to convert.
This the the successful VB code I need to convert into C#
Imports System.Xml<WebService(Namespace:="http://afdintranet/ADLookup")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<WebService(Namespace:="http://afdintranet/ADLookup")> _<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Function ADUserInfo() As DataSetDim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("LOGON_USER"))'Get information about the user.
Dim objADL As New AD_LookupDim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("LOGON_USER"))'Get information about the user.
Dim usrCurrent As String = objADL.Get_sAMAccountName(My.Request.ServerVariables("LOGON_USER"))'Get information about the user.
A first chance exception of type 'System.UriFormatException' occurred in System.dll
using System;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.UI;
using System.Xml;
using Microsoft.CSharp;[WebService(Namespace = "http://afdintranet/ADLookup")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[WebService(Namespace = "http://afdintranet/ADLookup")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service
{
System.Web.HttpRequest Request = new HttpRequest("filename", "url", "query");[WebMethod()]public void ADQuery(string SearchParameter, string SearchString, string Attribute){AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
[WebMethod()]public void ADQuery(string SearchParameter, string SearchString, string Attribute){AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
public void ADQuery(string SearchParameter, string SearchString, string Attribute){AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
AD_Lookup objADL = new AD_Lookup();objADL.EnumerateSearch(SearchParameter, SearchString);return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
objADL.EnumerateSearch(SearchParameter, SearchString);
return ;}[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
}
[WebMethod()]public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
public DataSet ADUserInfo(){AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
AD_Lookup objADL = new AD_Lookup();string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
string usrCurrent = objADL.Get_sAMAccountName(Request.ServerVariables["LOGON_USER"]);// Get information about the user.
// Get information about the user.
objADL.EnumerateSearch("sAMAccountName", usrCurrent);// Search AD using the Account name of the current user.
// Search AD using the Account name of the current user.
string strGivenName = Convert.ToString(objADL.GetAttribute("givenName"));string strSN = Convert.ToString(objADL.GetAttribute("sn"));string strTitle = Convert.ToString(objADL.GetAttribute("title"));string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
string strSN = Convert.ToString(objADL.GetAttribute("sn"));string strTitle = Convert.ToString(objADL.GetAttribute("title"));string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
string strTitle = Convert.ToString(objADL.GetAttribute("title"));string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
string strMail = Convert.ToString(objADL.GetAttribute("mail"));string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
string strDepartment = Convert.ToString(objADL.GetAttribute("department"));DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
DataSet dsUser = new DataSet("AD_Info");DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
DataTable dtUserInfo = new DataTable("User_Info");DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
DataRow drAttrib = dtUserInfo.NewRow();dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("givenName");dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("sn");dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("title");dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("mail");dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("manager");dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("department");dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("description");dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Columns.Add("distinguishedName");drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
drAttrib["givenName"] = strGivenName;drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
drAttrib["sn"] = strSN;drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
drAttrib["title"] = strTitle;drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
drAttrib["mail"] = strMail;drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
drAttrib["department"] = strDepartment;dtUserInfo.Rows.Add(drAttrib);dsUser.Tables.Add(dtUserInfo);return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
dtUserInfo.Rows.Add(drAttrib);
dsUser.Tables.Add(dtUserInfo);
return dsUser;}}using System.DirectoryServices; System.DirectoryServices;using System.Data; System.Data;public class AD_Lookup class AD_Lookup{private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
using System.DirectoryServices;
public class AD_Lookup
private SearchResult m_SearchResult;public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
public object GetAttribute(string Attribute){return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
return m_SearchResult.GetDirectoryEntry().Properties.Values;}public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
public void EnumerateSearch(string SearchParameter, string SearchString){DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
DirectorySearcher objDS = new DirectorySearcher("(" + SearchParameter + "=" + SearchString + ")");m_SearchResult = objDS.FindOne();}public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
m_SearchResult = objDS.FindOne();
public string Get_sAMAccountName(string strLogonName){return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
return strLogonName.Substring(strLogonName.IndexOf("\\") + 1);}}
If you want to see the unduplicated C# code that i am having trouble with then a link to another forum that doesn't have this problem is below
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1816186&SiteID=1
no problem in debugging it compiles perfectly. It is just it exceptions out when invoking HTTP Post in IE it 404's but the output from Visual Studio says system.nullreferenceexception
don't know where to go know, ah well