Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
#!perl # # As long as you have the module, you should not have to change a thin +g! # use Win32::NetAdmin; my $PDC; my $domain = Win32::DomainName or die "Unable to obtain the domain nam +e\n"; Win32::NetAdmin::GetDomainController("","",$PDC); Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_DOMAIN_CTRL, \@pdc) +; Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_DOMAIN_BAKCTRL, \@b +dc); Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_SERVER_NT, \@nt); Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_SERVER_UNIX, \@nix) +; Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_SQLSERVER, \@mssql) +; Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_WORKSTATION, \@ntwk +s); Win32::NetAdmin::GetServers($PDC, $domain, SV_TYPE_WFW, \@wfw); my @dc = (@pdc, @bdc); my %nixem; my %nowks; foreach $dc (@dc) { $nowks{$dc} = "nowks"; } foreach $wfw (@wfw) { $nowks{$wfw} = "nowks"; } foreach $nix (@nix) { $nixem{$nix} = "unix"; $nowks{$nix} = "nowks"; } foreach $nt (@nt) { $nowks{$nt} = "nowks"; } print "\nNT/2000/2003 servers in the $domain domain:\n"; foreach $dc (@dc) { if ($pdc[0] eq $dc) { print "$dc (pdc)\n"; } else { print "$dc (bd +c)\n"; } } foreach $nt (@nt) { unless ($nixem{$nt} eq unix) { print "$nt\n"; } } print "\nMSSQL servers in the $domain domain:\n"; foreach $mssql (@mssql) { print "$mssql\n"; } print "\nUnix servers in the $domain domain:\n"; foreach $nix (@nix) { print "$nix\n"; } print "\nWindows NT/2000/XP workstations in the $domain domain:\n"; foreach $ntwks (@ntwks) { unless ($nowks{$ntwks} eq nowks) { print "$n +twks\n"; } } print "\nWindows 95/98 workstations in the $domain domain:\n"; foreach $wfw (@wfw) { print "$wfw\n"; }

In reply to Get Domain Members by BravoTwoZero

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-18 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found