Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Win32API::Net::GetDCName returns error code 87 for remote servers

by dasgar (Priest)
on Apr 01, 2016 at 01:06 UTC ( [id://1159238]=note: print w/replies, xml ) Need Help??


in reply to Win32API::Net::GetDCName returns error code 87 for remote servers

Did a Google search for a line command utility to determine the domain controller for a system and the second answer at this link suggests using nltest. Although that documentation link on nltest indicates that it applies to Windows server OSes, I have found that command on Windows 7 and Windows 8.

Of course, if you wanted to use nltest as alternate solution, you will need to run this on the remote system. For that, you may want to check out psexec, which is part of the SysInternals set of tools. Basically psexec will let you run commands on remote Windows based systems.

  • Comment on Re: Win32API::Net::GetDCName returns error code 87 for remote servers

Replies are listed 'Best First'.
Re^2: Win32API::Net::GetDCName returns error code 87 for remote servers
by dt667 (Acolyte) on Apr 06, 2016 at 13:36 UTC

    The good news is nltest will work from the command line. The bad news is that it won't work from within perl. I've tried using

    @args = ("nltest", "\/server:BW2012R2", "\/dsgetdc:Testlab"); system(@args) == 0 or die "system @args failed: $?";

    Output:

    'nltest' is not recognized as an internal or external command, operabl +e program or batch file. system nltest /server:BW2012R2 /dsgetdc:Testlab failed: 256

    I've also tried to use IPC::Run and IPC::Cmd with similar results. How can I run the nltest cmd directly from the commandline, but not from within a perl script?

      use absolute path to nltest

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1159238]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found