private bool IsAuthenticated(String server, String path, String username, String pwd) // String port,
        {
            String domainAndUsername = username;
            DirectoryEntry entry;
            //if (port != String.Empty)
            //{
                entry = new DirectoryEntry("LDAP://" + server + "/" + path, "ITSC\\" + domainAndUsername, pwd);
            //}
            //else
            //{
            //    entry = new DirectoryEntry("LDAP://" + server + ":" + port + "/" + path, domainAndUsername, pwd);
            //}
            try
            {
                Object obj = entry.NativeObject;
                DirectorySearcher search = new DirectorySearcher(entry);
                search.Filter = "(SAMAccountName=" + username + ")";
                search.PropertiesToLoad.Add("cn");
                SearchResult result = search.FindOne();
                if (result == null)
                {
                    return false;
                }
                //_path = result.Path;
                //_filterAttribute = (String)result.Properties["cn"][0];
                return true;
            }
            catch
            {
                return false;
            }
        }