Script only shows command completion message

2 posts · Closed

rmpf2 Guest
12 May 2025

I'm doing some tests trying to find the logon server of remote machines with the following script:

'This script is simply to display the logon server for remote computer

Set proc = Internal.CreateObject("process")
proc.execute("nltest /Server:" & Input.Current & "/dsgetdc:")

'Check exit code
If proc.ExitCode = 0 Then

    For Each line in proc.output
    Output.Write line
  Next
Else
  Output.Write "Exit code " & proc.ExitCode
End If

But I just saw the final part of the result, i.e. "The command completed successfully".

Example - The following shows the whole result, not just the last part:

L:\>nltest /Server:pc1 /dsgetdc:
           DC: \\psrv1.cattle.local
      Address: \\10.300.10.12
     Dom Guid: 14a46226-293b-4dd9-9832-6b45a4f67d4a
     Dom Name: cattle.local
  Forest Name: cattle.local
 Dc Site Name: Default-First-Site-Name
Our Site Name: Default-First-Site-Name
        Flags: PDC GC DS LDAP KDC TIMESERV GTIMESERV WRITABLE DNS_DC DNS_DOMAIN DNS_FOREST CLOSE_SITE FULL_SECRET WS DS_8 DS_9
The command completed successfully

Any idea of why it did not show the whole result? Or how to overcome that to find the logon server (DC:?)

Andrew SoftPerfect
13 May 2025

It looks like you have forgotten the space here:

proc.execute("nltest /Server:" & Input.Current & "[color=#FF0000]␣[/color]/dsgetdc:")

Without the space your comand was like this, which only prints "The command completed successfully":

C:\>nltest /server:someservername/dsgetdc:
The command completed successfully
This topic is closed. It has had no new posts for over a year, so the software versions it talks about may be out of date. Start a new topic in Network Scanner if you have a similar question.