extensionattribute15
Public Function funGetWorkstation(ByVal strWorkstationID As String) Dim dirEntry As New DirectoryEntry("LDAP://RootDSE") Dim strRoot As String = "LDAP://(My Network); dirEntry = New DirectoryEntry(strRoot) Dim mySearch As DirectorySearcher = New DirectorySearcher(dirEntry) mySearch.Filter = "(&(ObjectClass=computer)(CN=" & strWorkstationID & "))" Try For Each workstation As SearchResult In mySearch.FindAll() Dim strWSObject = workstation.GetDirectoryEntry Dim strOU = strWSObject.Parent.Parent.Name.ToString Dim strOffice = strWSObject.Parent.Parent.Parent.Name.ToString TextBox2.Text = Microsoft.VisualBasic.Mid(strOU, 4) TextBox4.Text = Microsoft.VisualBasic.Mid(strOffice, 4) Next Catch ex As Exception MsgBox("It didnt work") End Try Return True End Function
ExtensionAttributes
strWSObject
Dim ext1 = strWSObject.Properties("extensionattribute15").Value
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)