How can i retrive operatingSystem from a specific computer/server.
Please see my code below.
Dim StrComputer as string
StrComputer = "SQLserver01"
adoCommand.CommandText = "SELECT Name, operatingSystem FROM " _
& "'LDAP://DC=DOMAIN,DC=COM' WHERE objectClass='computer' " _
& "and Name = " & StrComputer & ""
adoRecordset = adoCommand.Execute
Dim strOperatingSystem As String
strOperatingSystem = adoRecordset.Fields("operatingSystem").Value
It fails when running the execute command.
Hopefully you can me in the right direction.
Thanks;
/Jesper
Ok, I found the solution. It was a syntax error
adoCommand.CommandText = "Select Name, operatingSystem From " & _
LDAP://DC=Domain,DC=Com' Where objectClass='computer'" & _
" and Name = '" & StrComputer & "'"
/Jesper
Your updated code still has syntax problems - you've got unmatched
single/double quotes.