DNS Entries
Hi,
Is it possible to pull a report that will give me the DNS entries on all my comters?
Thx
Is it possible to pull a report that will give me the DNS entries on all my comters?
Thx
0 Comments
[ + ] Show comments
Answers (22)
Please log in to answer
Posted by:
scottlutz
12 years ago
Posted by:
GillySpy
12 years ago
Are you wanting the DNS servers that the PCs are pointing to?
This could also be done with a custom inventory rule. Something more refined like
http://www.kace.com/support/kb/index.php?action=artikel&cat=5&id=968&artlang=en or something quick and dirty like
Both could be reported on but the more refined it is the less work you have to do in a report to consume it. The unrefined approach is fine for a quick look at a specific machine.
This could also be done with a custom inventory rule. Something more refined like
http://www.kace.com/support/kb/index.php?action=artikel&cat=5&id=968&artlang=en or something quick and dirty like
ShellCommandTextReturn(ipconfig -all | find /I "DNS Server")
Both could be reported on but the more refined it is the less work you have to do in a report to consume it. The unrefined approach is fine for a quick look at a specific machine.
Posted by:
Mariusja
12 years ago
Posted by:
GillySpy
12 years ago
The data will be gathered when the machine does an inventory. Here is what I just did as a quick test:
Basically that query will use the current machine's IP address and get the DNS information from the scripts output for the matching adapter. It does some string manipulation to get it down to one line.
- Googled "ip config data vbscript" (that wasn't exactly my search but anyway)
- It brought me to this page: http://www.activexperts.com/network-monitor/windowsmanagement/scripts/networking/client/retrieving/#LipCD.htm
- I modified it on line 43-50 because i wanted the DNS servers listed on one line like so:
WScript.StdOut.Write " DNS servers in search order:"
If Not IsNull(objAdapter.DNSServerSearchOrder) Then
For i = 0 To UBound(objAdapter.DNSServerSearchOrder)
Wscript.StdOut.Write " " & objAdapter.DNSServerSearchOrder(i)
Next
End If
WScript.Echo
- Saved script as c:\scripts\ipconfig.vbs
- Then i created a custom software inventory item (targeted to windows) called "ipconfig" that have following rule:
ShellCommandTextReturn(cscript.exe c:\scripts\ipconfig.vbs)
- Then I forced an inventory (runkbot -s 4 0) for my 5.3 agent
- Then in inventory I had a bunch of data.
- The report I ran was:
select M.NAME,TRIM(SUBSTRING_INDEX(
SUBSTRING_INDEX(SUBSTRING_INDEX(STR_FIELD_VALUE,CONCAT(M.IP,'<br/>'),-1),'<br/> DNS domain: lan<br/>',1)
,'DNS servers in search order:',-1)) CURRENTDNSLIST
from MACHINE M JOIN MACHINE_SOFTWARE_JT MS ON MS.MACHINE_ID=M.ID
JOIN SOFTWARE S ON S.ID=MS.SOFTWARE_ID
JOIN MACHINE_CUSTOM_INVENTORY CI ON CI.ID=M.ID and CI.SOFTWARE_ID=S.ID
WHERE
S.DISPLAY_NAME ='ipconfig';
Basically that query will use the current machine's IP address and get the DNS information from the scripts output for the matching adapter. It does some string manipulation to get it down to one line.
- For other machines I plan to push out c:\scripts\ipconfig.vbs as a file synchronization for whichever machines I want to have it.
Posted by:
Mariusja
12 years ago
I created the vbs script and saved it under c:\scripts\ipconfig.vbs
I run this script from the command line like this c:\windows\system32\cscript.exe c:\scripts\ipconfig.vbs
I get the following error when running this "DNS servers in serch order:c:\scripts\ipconfig.vbs<3,2> Microsoft VBScript runtime error: Object required: "objAdapter"
I run this script from the command line like this c:\windows\system32\cscript.exe c:\scripts\ipconfig.vbs
I get the following error when running this "DNS servers in serch order:c:\scripts\ipconfig.vbs<3,2> Microsoft VBScript runtime error: Object required: "objAdapter"
Posted by:
GillySpy
12 years ago
Posted by:
Mariusja
12 years ago
Posted by:
GillySpy
12 years ago
Every step from this post http://itninja.com/question/outlook-profile473&mpage=1&key=&#
For the force inventory -- do not force inventory on all machines. For most machines simply wait for them to check in and the data will be there after that.
For the force inventory -- do not force inventory on all machines. For most machines simply wait for them to check in and the data will be there after that.
Posted by:
Mariusja
12 years ago
I did create the inventory rule.
I did create the .vbs script and executed it on a pc.
Forced inventory on this pc
Created the SQL report
When I go to my software tab on the kbox and I go to the inventory rule I can see the pc that I forced is there, but when I run the report it doesnt show me any details. It is blank.
I did create the .vbs script and executed it on a pc.
Forced inventory on this pc
Created the SQL report
When I go to my software tab on the kbox and I go to the inventory rule I can see the pc that I forced is there, but when I run the report it doesnt show me any details. It is blank.
Posted by:
Mariusja
12 years ago
Posted by:
GillySpy
12 years ago
Posted by:
Mariusja
12 years ago
This is what I get under the custom inventory section:
3) DNS Entries: Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Network Adapter 1
=================
Description: Broadcom 440x 10/100 Integrated Controller
Physical (MAC) address: 00:1A:A0:11:DB:E7
Host name: 5WKHYC1
IP address: 11.208.9.102
Subnet: 255.255.255.0
Default gateway: 11.208.9.253
DNS
---
DNS servers in search order:
11.2.10.56
11.1.1.11
DNS domain:
DNS suffix search list: jdg.co.za
DHCP
----
DHCP enabled: False
DHCP server:
DHCP lease obtained:
DHCP lease expires:
WINS
----
Primary WINS server:
Secondary WINS server:
[string]
It is on a XP machine and have client 5.3.47657
Our KBOC is on version 5.3.47927
3) DNS Entries: Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Network Adapter 1
=================
Description: Broadcom 440x 10/100 Integrated Controller
Physical (MAC) address: 00:1A:A0:11:DB:E7
Host name: 5WKHYC1
IP address: 11.208.9.102
Subnet: 255.255.255.0
Default gateway: 11.208.9.253
DNS
---
DNS servers in search order:
11.2.10.56
11.1.1.11
DNS domain:
DNS suffix search list: jdg.co.za
DHCP
----
DHCP enabled: False
DHCP server:
DHCP lease obtained:
DHCP lease expires:
WINS
----
Primary WINS server:
Secondary WINS server:
[string]
It is on a XP machine and have client 5.3.47657
Our KBOC is on version 5.3.47927
Posted by:
GillySpy
12 years ago
Posted by:
Mariusja
12 years ago
Posted by:
Mariusja
12 years ago
Ok I made the change and it looklike this :
DNS Entries: Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Network Adapter 1
=================
Description: Broadcom 440x 10/100 Integrated Controller
Physical (MAC) address: 00:1A:A0:11:DB:E7
Host name: 5WKHYC1
IP address: 11.208.9.102
Subnet: 255.255.255.0
Default gateway: 11.208.9.253
DNS
---
DNS servers in search order: 11.2.10.56 11.1.1.11
DNS domain:
DNS suffix search list: jdg.co.za
DHCP
----
DHCP enabled: False
DHCP server:
DHCP lease obtained:
DHCP lease expires:
WINS
----
Primary WINS server:
Secondary WINS server:
[string]
The report still is blank though?
DNS Entries: Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Network Adapter 1
=================
Description: Broadcom 440x 10/100 Integrated Controller
Physical (MAC) address: 00:1A:A0:11:DB:E7
Host name: 5WKHYC1
IP address: 11.208.9.102
Subnet: 255.255.255.0
Default gateway: 11.208.9.253
DNS
---
DNS servers in search order: 11.2.10.56 11.1.1.11
DNS domain:
DNS suffix search list: jdg.co.za
DHCP
----
DHCP enabled: False
DHCP server:
DHCP lease obtained:
DHCP lease expires:
WINS
----
Primary WINS server:
Secondary WINS server:
[string]
The report still is blank though?
Posted by:
GillySpy
12 years ago
Posted by:
Mariusja
12 years ago
THANKS it is working perfect. I really appreciate your efforts and patience with me.
Just another question on a different note:
If I have a directory with 400 different files in it will it be possible to create a report that will tell me which pc's have these 400 files installed and also what there modified dates are?
Just another question on a different note:
If I have a directory with 400 different files in it will it be possible to create a report that will tell me which pc's have these 400 files installed and also what there modified dates are?
Posted by:
GillySpy
12 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.