Click here to Skip to main content
15,916,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionA Class Model with sort capabilities, Linq Sort, Array Sort instead of OrderBy Pin
jkirkerx17-Jan-19 8:45
professionaljkirkerx17-Jan-19 8:45 
AnswerRe: A Class Model with sort capabilities, Linq Sort, Array Sort instead of OrderBy Pin
Mycroft Holmes17-Jan-19 12:39
professionalMycroft Holmes17-Jan-19 12:39 
GeneralRe: A Class Model with sort capabilities, Linq Sort, Array Sort instead of OrderBy Pin
jkirkerx17-Jan-19 13:19
professionaljkirkerx17-Jan-19 13:19 
QuestionCode not taking pictures from webcam when form in system tray Pin
Frankie_M15-Jan-19 23:46
Frankie_M15-Jan-19 23:46 
AnswerRe: Code not taking pictures from webcam when form in system tray Pin
Eddy Vluggen20-Jan-19 1:57
professionalEddy Vluggen20-Jan-19 1:57 
GeneralRe: Code not taking pictures from webcam when form in system tray Pin
Frankie_M21-Jan-19 22:14
Frankie_M21-Jan-19 22:14 
QuestionLosing Link state with CHARFORMAT2 definition ;Closed Pin
mo149215-Jan-19 12:56
mo149215-Jan-19 12:56 
Questiontest compile mode versus production compile mode Pin
dcof7-Jan-19 5:10
dcof7-Jan-19 5:10 
AnswerRe: test compile mode versus production compile mode Pin
Richard MacCutchan7-Jan-19 5:33
mveRichard MacCutchan7-Jan-19 5:33 
GeneralRe: test compile mode versus production compile mode Pin
dcof7-Jan-19 9:42
dcof7-Jan-19 9:42 
GeneralRe: test compile mode versus production compile mode Pin
Richard MacCutchan7-Jan-19 9:50
mveRichard MacCutchan7-Jan-19 9:50 
GeneralRe: test compile mode versus production compile mode Pin
dcof8-Jan-19 6:17
dcof8-Jan-19 6:17 
Questioncall a Sub with a dynamic type parameter. Pin
desanti2-Jan-19 11:03
desanti2-Jan-19 11:03 
AnswerRe: call a Sub with a dynamic type parameter. Pin
Richard MacCutchan2-Jan-19 22:10
mveRichard MacCutchan2-Jan-19 22:10 
GeneralRe: call a Sub with a dynamic type parameter. Pin
desanti3-Jan-19 4:35
desanti3-Jan-19 4:35 
GeneralRe: call a Sub with a dynamic type parameter. Pin
Richard MacCutchan3-Jan-19 6:33
mveRichard MacCutchan3-Jan-19 6:33 
GeneralRe: call a Sub with a dynamic type parameter. Pin
Dave Kreskowiak3-Jan-19 6:36
mveDave Kreskowiak3-Jan-19 6:36 
AnswerRe: call a Sub with a dynamic type parameter. Pin
Eddy Vluggen2-Jan-19 22:14
professionalEddy Vluggen2-Jan-19 22:14 
GeneralRe: call a Sub with a dynamic type parameter. Pin
desanti3-Jan-19 4:35
desanti3-Jan-19 4:35 
GeneralRe: call a Sub with a dynamic type parameter. Pin
Ralf Meier17-Jan-19 0:34
mveRalf Meier17-Jan-19 0:34 
QuestionDirecotoryServices - Find all Windows 7 and Windows 10 Computers in Domain Pin
Member 1186689325-Dec-18 6:43
Member 1186689325-Dec-18 6:43 
I am creating a tool to delete user profiles by age on all windows 7 and windows 10 devices on our domains. I have it working using this filter ("(objectClass=computer)") but want to refine that to only get windows 7 and windows 10 devices because my department manages desktops/laptops not servers. In order to make the tool more efficient and not attempt to connect to devices I don't have admin access to.

So I tried this filter... mySearcher.Filter = "(&(objectClass=computer)(operatingSystemVersion=*server*))" my thought was to do something like this if OS IsNot Windows Server 2012 or Windows Server 2008 then do something.

I loaded the operatingSystem property but can't get it to display. I have tried it in the datagridview and when that didn't work I just tried to do a consolewriteline and that didn't work either. I want to test my concept before adding the code to use WMI to delete profiles by just displaying the hostname and OS version to make sure it is pulling the information from AD and not giving me servers. Can someone help? Here is the code(I am just working with the v06 domain at the moment):

Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry)
       mySearcher.PropertiesToLoad.Add("dNSHostName")
       mySearcher.PropertiesToLoad.Add("operatingSystem")
       mySearcher.PropertiesToLoad.Add("operatingSystemVersion")
       mySearcher.Filter = "(&(objectClass=computer)(operatingSystem=*server*))" '("(objectClass=computer)")

       Dim resEnt As SearchResult
       For Each resEnt In mySearcher.FindAll()
           Select Case dMain
               Case "v06"
                   Try

                       hostName = GetProperty(resEnt, "dNSHostName")
                       OSystem = GetProperty(resEnt, "operatingSystem")
                       Dim result1 As Net.NetworkInformation.PingReply = ping.Send(hostName, 1000)
                       If result1.Status = Net.NetworkInformation.IPStatus.Success Then
                           Dim row2 As String() = New String() {hostName, "N/A", OSystem}
                           dgvLocal.Rows.Add(row2)
                       Else
                           My.Computer.FileSystem.WriteAllText("C:\ExodusErrorLog.txt", hostName & " - Device is not pingable!" & vbCrLf & vbCrLf, True)
                       End If
                   Catch ex As Exception
                       My.Computer.FileSystem.WriteAllText("C:\ExodusErrorLog.txt", hostName & " - " & ex.Message & vbCrLf & vbCrLf, True)
                   End Try
               Case "v07.med.va.gov"
           End Select
       Next


modified 25-Dec-18 13:32pm.

AnswerRe: DirecotoryServices - Find all Windows 7 and Windows 10 Computers in Domain Pin
Eddy Vluggen2-Jan-19 23:02
professionalEddy Vluggen2-Jan-19 23:02 
QuestionThreading, Invoke, Delegate and MethodInvoker... Pin
Member 1111281423-Dec-18 3:03
Member 1111281423-Dec-18 3:03 
AnswerRe: Threading, Invoke, Delegate and MethodInvoker... Pin
Eddy Vluggen23-Dec-18 10:52
professionalEddy Vluggen23-Dec-18 10:52 
GeneralRe: Threading, Invoke, Delegate and MethodInvoker... Pin
Member 1111281423-Dec-18 11:09
Member 1111281423-Dec-18 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.