Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!
C# code: this.AD = new DirectoryEntry(loginPath, loginUsername, loginPassword); var filter = "(&(objectCategory=Person) (sAMAccountName=" + username + "))"; var diretorySearcher = new DirectorySearcher(this.AD); SearchResult searchResult = null; diretorySearcher.SearchRoot = this.AD; diretorySearcher.SearchScope = SearchScope.Subtree; diretorySearcher.Filter = filter; searchResult = diretorySearcher.FindOne(); DirectoryEntry user = searchResult.GetDirectoryEntry(); VB.Net code: Me.AD = New DirectoryEntry(loginPath, loginUsername, loginPassword) String filter = "(&(objectCategory=Person) (sAMAccountName=" & username & "))" DirectorySearcher diretorySearcher = New DirectorySearcher(Me.AD) SearchResult searchResult = Nothing diretorySearcher.SearchRoot = Me.AD diretorySearcher.SearchScope = SearchScope.Subtree diretorySearcher.Filter = filter searchResult = diretorySearcher.FindOne() DirectoryEntry user = searchResult.GetDirectoryEntry()
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.