Re: reading the Network Interface Card(NIC) name

2007-08-27 Thread Foo JH
If you're doing this via Windows, you can go via WMI.

Google: wmi win32_networkadapter

Ankit Mehrotra wrote:

 Hi all,

 I want to read the names of the NIC's of a  blade server. Is there any 
 ready made package through which I can read them ?

 Thanks
 Ankit
 =-=-=
 Notice: The information contained in this e-mail
 message and/or attachments to it may contain 
 confidential or privileged information. If you are 
 not the intended recipient, any dissemination, use, 
 review, distribution, printing or copying of the 
 information contained in this e-mail message 
 and/or attachments to it are strictly prohibited. If 
 you have received this communication in error, 
 please notify us by reply e-mail or telephone and 
 immediately and permanently delete the message 
 and any attachments. Thank you


   
 

 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
   

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: reading the Network Interface Card(NIC) name

2007-08-27 Thread Ankit Mehrotra
I am not very well versed in wmi. Is there some other means of doing it 
preferably using perl !!

Ankit 



Foo JH [EMAIL PROTECTED] 
08/27/2007 12:37 PM

To
Ankit Mehrotra [EMAIL PROTECTED]
cc
perl-win32-users@listserv.ActiveState.com, 
[EMAIL PROTECTED]
Subject
Re: reading the Network Interface Card(NIC) name






If you're doing this via Windows, you can go via WMI.

Google: wmi win32_networkadapter

Ankit Mehrotra wrote:

 Hi all,

 I want to read the names of the NIC's of a  blade server. Is there any 
 ready made package through which I can read them ?

 Thanks
 Ankit
 =-=-=
 Notice: The information contained in this e-mail
 message and/or attachments to it may contain 
 confidential or privileged information. If you are 
 not the intended recipient, any dissemination, use, 
 review, distribution, printing or copying of the 
 information contained in this e-mail message 
 and/or attachments to it are strictly prohibited. If 
 you have received this communication in error, 
 please notify us by reply e-mail or telephone and 
 immediately and permanently delete the message 
 and any attachments. Thank you


 
 

 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

ForwardSourceID:NT00013B6E 
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: reading the Network Interface Card(NIC) name

2007-08-27 Thread Steve Howard (PFE)
You can access WMI via Perl pretty much the same way you would any other 
automation object. I haven't used it to enumerate the NICs the way you want to 
do, but a quick and dirty example of using WMI in Perl is one I wrote to 
enumerate drives. You can probably use the windows scripting help to find the 
objects for the NICs.

An example of using Perl with WMI:

#!perl

use Win32;
use Win32::OLE qw( in );
*error = *Win32::OLE::LastError;

my $wmi = Win32::OLE-GetObject(Winmgmts:);
die error() if error();

our $drives = $wmi-ExecQuery(Select * from Win32_LogicalDisk);
die error() if error();

foreach my $drive (in( $drives ))
{
   print drive name: $drive-{Name}\n;
   print filesystem: $drive-{FileSystem}\n;
   print Drive size: $drive-{Size}\n;
   print Drive freespace: $drive-{FreeSpace}\n;
   print Drive type: $drive-{DriveType}\n;
   print \n\n;
}


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ankit Mehrotra
Sent: Monday, August 27, 2007 2:48 AM
To: Foo JH
Cc: perl-win32-users@listserv.ActiveState.com; [EMAIL PROTECTED]
Subject: Re: reading the Network Interface Card(NIC) name


I am not very well versed in wmi. Is there some other means of doing it 
preferably using perl !!

Ankit

Foo JH [EMAIL PROTECTED]

08/27/2007 12:37 PM

To

Ankit Mehrotra [EMAIL PROTECTED]

cc

perl-win32-users@listserv.ActiveState.com, [EMAIL PROTECTED]

Subject

Re: reading the Network Interface Card(NIC) name







If you're doing this via Windows, you can go via WMI.

Google: wmi win32_networkadapter

Ankit Mehrotra wrote:

 Hi all,

 I want to read the names of the NIC's of a  blade server. Is there any
 ready made package through which I can read them ?

 Thanks
 Ankit
 =-=-=
 Notice: The information contained in this e-mail
 message and/or attachments to it may contain
 confidential or privileged information. If you are
 not the intended recipient, any dissemination, use,
 review, distribution, printing or copying of the
 information contained in this e-mail message
 and/or attachments to it are strictly prohibited. If
 you have received this communication in error,
 please notify us by reply e-mail or telephone and
 immediately and permanently delete the message
 and any attachments. Thank you



 

 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


ForwardSourceID:NT00013B6E

=-=-=

Notice: The information contained in this e-mail

message and/or attachments to it may contain

confidential or privileged information. If you are

not the intended recipient, any dissemination, use,

review, distribution, printing or copying of the

information contained in this e-mail message

and/or attachments to it are strictly prohibited. If

you have received this communication in error,

please notify us by reply e-mail or telephone and

immediately and permanently delete the message

and any attachments. Thank you




___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: reading the Network Interface Card(NIC) name

2007-08-27 Thread William . Hoopes
Google:  scriptomatic

 

Microsoft provides this tool to demonstrate how to utilize WMI.

One of the features is to output code in various languages, PERL being
one.

 

 

 

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Steve Howard (PFE)
Sent: Monday, August 27, 2007 11:53 AM
To: Ankit Mehrotra; Foo JH
Cc: perl-win32-users@listserv.ActiveState.com;
[EMAIL PROTECTED]
Subject: RE: reading the Network Interface Card(NIC) name

 

You can access WMI via Perl pretty much the same way you would any other
automation object. I haven't used it to enumerate the NICs the way you
want to do, but a quick and dirty example of using WMI in Perl is one I
wrote to enumerate drives. You can probably use the windows scripting
help to find the objects for the NICs.

 

An example of using Perl with WMI:

 

#!perl

 

use Win32;

use Win32::OLE qw( in );

*error = *Win32::OLE::LastError;

 

my $wmi = Win32::OLE-GetObject(Winmgmts:);

die error() if error();

 

our $drives = $wmi-ExecQuery(Select * from Win32_LogicalDisk);

die error() if error();

 

foreach my $drive (in( $drives ))

{

   print drive name: $drive-{Name}\n;

   print filesystem: $drive-{FileSystem}\n;

   print Drive size: $drive-{Size}\n;

   print Drive freespace: $drive-{FreeSpace}\n;

   print Drive type: $drive-{DriveType}\n;

   print \n\n;

}

 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Ankit Mehrotra
Sent: Monday, August 27, 2007 2:48 AM
To: Foo JH
Cc: perl-win32-users@listserv.ActiveState.com;
[EMAIL PROTECTED]
Subject: Re: reading the Network Interface Card(NIC) name

 


I am not very well versed in wmi. Is there some other means of doing it
preferably using perl !! 

Ankit 

Foo JH [EMAIL PROTECTED] 

08/27/2007 12:37 PM 

To

Ankit Mehrotra [EMAIL PROTECTED] 

cc

perl-win32-users@listserv.ActiveState.com,
[EMAIL PROTECTED] 

Subject

Re: reading the Network Interface Card(NIC) name

 

 

 




If you're doing this via Windows, you can go via WMI.

Google: wmi win32_networkadapter

Ankit Mehrotra wrote:

 Hi all,

 I want to read the names of the NIC's of a  blade server. Is there any

 ready made package through which I can read them ?

 Thanks
 Ankit
 =-=-=
 Notice: The information contained in this e-mail
 message and/or attachments to it may contain 
 confidential or privileged information. If you are 
 not the intended recipient, any dissemination, use, 
 review, distribution, printing or copying of the 
 information contained in this e-mail message 
 and/or attachments to it are strictly prohibited. If 
 you have received this communication in error, 
 please notify us by reply e-mail or telephone and 
 immediately and permanently delete the message 
 and any attachments. Thank you


   



 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
   

ForwardSourceID:NT00013B6E 

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you
 
 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl58.dll: Perl_sv_2iv_flags (undefined reference)

2007-08-27 Thread Jan Dubois
On Fri, 24 Aug 2007, Suresh Govindachar wrote:
   Sisyphus suggested linking with C:/opt/perl/lib/CORE/perl58.lib
   (which does have the symbols in it) in the command that creates
   if_perl.o and/or in the command that builds gvim.exe (which is also
   the command that reports the missing references).

   But the build is supposed to use the library dynamically, rather
   than be statically linked. So perl58.dll must tell the linker that
   it will resolve the missing references at run time.

   Perhaps although ActiveState added code for the references, they are
   not exposing them to the linker for dynamic use via perl58.dll? Or
   is everything in a dll automatically visible?

Perl_sv_2iv_flags is exported from perl58.dll.  This symbols is being used
by virtually every Perl module containing XS code because the SvIV() macro
will expand into a call to it:

  [in sv.h]
  #define SvIV(sv) (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv))
  ...
  #define sv_2iv(sv) sv_2iv_flags(sv, SV_GMAGIC)

Cheers,
-Jan

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl58.dll: Perl_sv_2iv_flags (undefined reference)

2007-08-27 Thread Suresh Govindachar

  Sisyphus wrote:

   I would try adding -lperl58 to either this command (the command
   that builds if_perl.o):
  
gcc -c -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 
   -DHAVE_PATHDEF  -DFEAT_HUGE -DHAVE_GETTEXT -DHAVE_LOCALE_H 
   -DDYNAMIC_GETTEXT -DFEAT_OLE -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG 
   -DFEAT_GUI_W32  -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME 
   -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall 
   -IC:\opt\perl/lib/Core  -DFEAT_PERL -LC:\opt\perl/lib/Core 
   -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\perl58.dll\ -O3 
   -fomit-frame-pointer -freg-struct-return  -s if_perl.c -o 
   gobj/if_perl.o
  
   or to this command (the command that builds gvim.exe) :
  
gcc -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 
   -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_GETTEXT -DHAVE_LOCALE_H 
   -DDYNAMIC_GETTEXT -DFEAT_OLE -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG 
   -DFEAT_GUI_W32  -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME 
   -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall 
   -IC:\opt\perl/lib/Core  -DFEAT_PERL -LC:\opt\perl/lib/Core 
   -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\perl58.dll\ -O3 
   -fomit-frame-pointer -freg-struct-return  -s -mwindows -o gvim.exe 
   gobj/buffer.o gobj/charset.o gobj/diff.o gobj/digraph.o gobj/edit.o 
   gobj/eval.o gobj/ex_cmds.o gobj/ex_cmds2.o gobj/ex_docmd.o 
   gobj/ex_eval.o gobj/ex_getln.o gobj/fileio.o gobj/fold.o 
   gobj/getchar.o gobj/hardcopy.o gobj/hashtab.o gobj/main.o gobj/mark.o 
   gobj/memfile.o gobj/memline.o gobj/menu.o gobj/message.o gobj/misc1.o 
   gobj/misc2.o gobj/move.o gobj/mbyte.o gobj/normal.o gobj/ops.o 
   gobj/option.o gobj/os_win32.o gobj/os_mswin.o gobj/pathdef.o 
   gobj/popupmnu.o gobj/quickfix.o gobj/regexp.o gobj/screen.o 
   gobj/search.o gobj/spell.o gobj/syntax.o gobj/tag.o gobj/term.o 
   gobj/ui.o gobj/undo.o gobj/version.o gobj/vimrc.o gobj/window.o 
   gobj/if_perl.o gobj/if_cscope.o gobj/netbeans.o gobj/gui.o 
   gobj/gui_w32.o gobj/gui_beval.o gobj/os_w32exe.o gobj/if_ole.o 
   -lkernel32 -luser32 -lgdi32 -ladvapi32
   -lcomdlg32 -lcomctl32 -lversion -lwsock32 -loleaut32 -lstdc++ -lole32 
   -luuid
  
   Or try addding it to *both* of those commands.
   
   Your C:/opt/perl/lib/CORE/libperl58.lib should be capable of
   defining those references - it's surely just a matter of linking
   to that file.
   
   Not sure if '-lperl58' will find libperl58.lib. If it doesn't,
   then create a copy of C:/opt/perl/lib/CORE/libperl58.lib named
   C:/opt/perl/lib/CORE/libperl58.a .
  
  Added -lperl58 to both.  The first command reported:
  
gcc: -lperl58: linker input file unused because linking not done 

  The second command resulted in the same undefined reference error.

  Just to be sure, I added -lblah to the second command, and got the
  new error message:

 c:\opt\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: 
cannot find -lblah

  --Suresh

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl58.dll: Perl_sv_2iv_flags (undefined reference)

2007-08-27 Thread Suresh Govindachar


  Solved with help from Brian Dessent on the MinGW mailing list.

  Add -lperl58 at the very end (location matters) of the last command.

--Suresh

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl58.dll: Perl_sv_2iv_flags (undefined reference)

2007-08-27 Thread Suresh Govindachar
 
When mingw is used to build gvim with dynamic support for perl:

  1) For older versions of ActivePerl, there is no
 need to add -lperl58

 The linker somehow knows that perl58 related 
 symbols that it cannot resolve will be resolved
 at runtime via perl58.dll

  2) For the latest ActivePerl, when build is done
 without adding -lperl58 

 The linker somehow knows -- for almost all -- the 
 perl58 related symbols that it cannot resolve, they
 will be resolved at runtime via perl58.dll

 For some reason, the linker demands that two   
 particular symbols Perl_sv_2iv_flags and 
 Perl_newXS_flags be resolved at link time via 
 an explicit addition of -lperl58

  So ActiveState is exporting Perl_sv_2iv_flags and 
  Perl_newXS_flags in a way that is different from the
  way they export other symbols.

  --Suresh

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl58.dll: Perl_sv_2iv_flags (undefined reference)

2007-08-27 Thread Jan Dubois
On Mon, 27 Aug 2007, Suresh Govindachar wrote:
 
   So ActiveState is exporting Perl_sv_2iv_flags and
   Perl_newXS_flags in a way that is different from the
   way they export other symbols.

Nope, this is all incorrect.  I've now downloaded the vim sources to
see what is really going on:

The src/if_perl.xs file contains code to redefine all Perl functions it
assumes it uses to wrapper names, and then looks up the real functions
at runtime.  That means that this file is specific to the Perl version
used to compile it and will need to be updated for Perl 5.8.9.  See for
example:

# if (PERL_REVISION == 5)  (PERL_VERSION = 8)
#  define Perl_sv_2pv_flags dll_Perl_sv_2pv_flags
#  define Perl_sv_2pv_nolen dll_Perl_sv_2pv_nolen
# else
#  define Perl_sv_2pv dll_Perl_sv_2pv
# endif
...
#if (PERL_REVISION == 5)  (PERL_VERSION = 8)
static char* (*Perl_sv_2pv_flags)(pTHX_ SV*, STRLEN*, I32);
static char* (*Perl_sv_2pv_nolen)(pTHX_ SV*);
#else
static char* (*Perl_sv_2pv)(pTHX_ SV*, STRLEN*);
#endif
...
#if (PERL_REVISION == 5)  (PERL_VERSION = 8)
{Perl_sv_2pv_flags, (PERL_PROC*)Perl_sv_2pv_flags},
{Perl_sv_2pv_nolen, (PERL_PROC*)Perl_sv_2pv_nolen},
#else
{Perl_sv_2pv, (PERL_PROC*)Perl_sv_2pv},
#endif

Similar code will be needed for sv_2iv_flags() and any other new symbol.
It is a bit awkward to do this for ActivePerl 822, as it identifies itself
as 5.8.8 because 5.8.9 has not been released yet, so we don't know which
additional features will still be added.  But internally AP822 is probably
closer to what will be 5.8.9 than to 5.8.8.

Anyways, the problem is that if_perl.xs is coupled pretty tightly to the
Perl internals and needs updating whenever the internals change.

Cheers,
-Jan

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl58.dll: Perl_sv_2iv_flags (undefined reference)

2007-08-27 Thread Suresh Govindachar
 
  Jan Dubois wrote:
   On Mon, 27 Aug 2007, Suresh Govindachar wrote:
   
   So ActiveState is exporting Perl_sv_2iv_flags and
   Perl_newXS_flags in a way that is different from the
   way they export other symbols.
   
   Nope, this is all incorrect.  I've now downloaded the vim
   sources to see what is really going on:
   
   The src/if_perl.xs file contains code to redefine all Perl
   functions it assumes it uses to wrapper names, and then looks up
   the real functions at runtime.  That means that this file is
   specific to the Perl version used to compile it and will need to
   be updated for Perl 5.8.9.  See for example:
  
   # if (PERL_REVISION == 5)  (PERL_VERSION = 8)
   #  define Perl_sv_2pv_flags dll_Perl_sv_2pv_flags
   #  define Perl_sv_2pv_nolen dll_Perl_sv_2pv_nolen
   # else
   #  define Perl_sv_2pv dll_Perl_sv_2pv
   # endif
   ...
   #if (PERL_REVISION == 5)  (PERL_VERSION = 8)
   static char* (*Perl_sv_2pv_flags)(pTHX_ SV*, STRLEN*, I32);
   static char* (*Perl_sv_2pv_nolen)(pTHX_ SV*);
   #else
   static char* (*Perl_sv_2pv)(pTHX_ SV*, STRLEN*);
   #endif
  
   ...
  
   Similar code will be needed for sv_2iv_flags() and any other 
   new symbol.
  
   It is a bit awkward to do this for ActivePerl 822, as it
   identifies itself as 5.8.8 because 5.8.9 has not been released
   yet, so we don't know which additional features will still be
   added.  But internally AP822 is probably closer to what will be
   5.8.9 than to 5.8.8.
   
   Anyways, the problem is that if_perl.xs is coupled pretty
   tightly to the Perl internals and needs updating whenever the
   internals change.

  Thanks for looking into this.  I don't think the person who did
  the original work to embed perl in Vim is still activly interested
  in Vim.  I can't live without vim and perl.  Is there a better way
  to embed perl so as to be version independent? 

  --Suresh

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: perl58.dll: Perl_sv_2iv_flags (undefined reference)

2007-08-27 Thread Jan Dubois
On Mon, 27 Aug 2007, Suresh Govindachar wrote:
   Thanks for looking into this. I don't think the person who did the
   original work to embed perl in Vim is still activly interested in
   Vim. I can't live without vim and perl. Is there a better way to
   embed perl so as to be version independent?

There really is no way to do it totally version independently.  One reason
the vim code is so tightly coupled is that it doesn't have an explicit
reference to perl58.dll.  Instead it calls LoadLibrary() at runtime, and
then GetProcAddress() to locate all the imported symbols.  This allows the
same binary to be used when there is no perl58.dll to be loaded.  By
linking against perl58.lib your version will fail to load on a machine
that doesn't have Perl because you have now introduced a load time dependency
on perl58.dll.

At the binary level, all Perl 5.8.x releases are backward compatible in the
sense that you can load a module compiled with an earlier Perl version into
a later Perl release.  That means you can build vim against Perl 5.8.0 and then
use the vim binary with perl58.dll from 5.8.9 or any other 5.8.x version. All
new versions continue to export the old symbols to support this level of
compatibility.

Binary compatibility does not exist in the other direction: A module compiled
with Perl 5.8.8 may break under Perl 5.8.7.  The vim binary you built by linking
explicitly against perl58.lib from AP822 will not work with any earlier version
of ActivePerl or perl58.dll because they don't export the new symbols.

This is also the reason we have to build all modules in the ActivePerl
PPM repositories against 5.8.0 [*]. That way they can be used by any version
of ActivePerl 8xx.

Cheers,
-Jan

[*] This is not strictly true anymore with AP819 and later using PPM4,
but we haven't yet managed to roll out the versioned repository stuff at
the server side.


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: reading the Network Interface Card(NIC) name

2007-08-27 Thread Steven Manross
The WMI class you'd probably want to talk to is
Win32_NetworkAdapterConfiguration

Change this line:

our $drives = $wmi-ExecQuery(Select * from Win32_LogicalDisk);

To read: 

our $drives = $wmi-ExecQuery(Select * from
Win32_NetworkAdapterConfiguration where IPEnabled = 1);

And then use this documentation (below) to get this script (in the
thread) pulling all of the correct properties..

http://msdn2.microsoft.com/en-us/library/aa394217.aspx

Or 

Download this script:

http://www.roth.net/perl/scripts/scripts.asp?wmi-Generic.pl

And run it like so...

perl wmi-generic.pl computername Win32_NetworkAdapterConfiguration

My script won't do the where ipenabled = 1 (in it's current
incantation).

But that would help you figure out all the properties that are exposed
and how they read in your specific environment.

I have a version that allows for where clauses (but I just haven't
uploaded it to Mr Roth's site).

Steven


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Steve Howard (PFE)
Sent: Monday, August 27, 2007 8:53 AM
To: Ankit Mehrotra; Foo JH
Cc: perl-win32-users@listserv.ActiveState.com;
[EMAIL PROTECTED]
Subject: RE: reading the Network Interface Card(NIC) name



You can access WMI via Perl pretty much the same way you would
any other automation object. I haven't used it to enumerate the NICs the
way you want to do, but a quick and dirty example of using WMI in Perl
is one I wrote to enumerate drives. You can probably use the windows
scripting help to find the objects for the NICs.

 

An example of using Perl with WMI:

 

#!perl

 

use Win32;

use Win32::OLE qw( in );

*error = *Win32::OLE::LastError;

 

my $wmi = Win32::OLE-GetObject(Winmgmts:);

die error() if error();

 

our $drives = $wmi-ExecQuery(Select * from
Win32_LogicalDisk);

die error() if error();

 

foreach my $drive (in( $drives ))

{

   print drive name: $drive-{Name}\n;

   print filesystem: $drive-{FileSystem}\n;

   print Drive size: $drive-{Size}\n;

   print Drive freespace: $drive-{FreeSpace}\n;

   print Drive type: $drive-{DriveType}\n;

   print \n\n;

}

 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Ankit Mehrotra
Sent: Monday, August 27, 2007 2:48 AM
To: Foo JH
Cc: perl-win32-users@listserv.ActiveState.com;
[EMAIL PROTECTED]
Subject: Re: reading the Network Interface Card(NIC) name

 


I am not very well versed in wmi. Is there some other means of
doing it preferably using perl !! 

Ankit 



Foo JH [EMAIL PROTECTED] 

08/27/2007 12:37 PM 

To

Ankit Mehrotra [EMAIL PROTECTED] 


cc

perl-win32-users@listserv.ActiveState.com,
[EMAIL PROTECTED] 


Subject

Re: reading the Network Interface Card(NIC) name



 






If you're doing this via Windows, you can go via WMI.

Google: wmi win32_networkadapter

Ankit Mehrotra wrote:

 Hi all,

 I want to read the names of the NIC's of a  blade server. Is
there any 
 ready made package through which I can read them ?

 Thanks
 Ankit
 =-=-=
 Notice: The information contained in this e-mail
 message and/or attachments to it may contain 
 confidential or privileged information. If you are 
 not the intended recipient, any dissemination, use, 
 review, distribution, printing or copying of the 
 information contained in this e-mail message 
 and/or attachments to it are strictly prohibited. If 
 you have received this communication in error, 
 please notify us by reply e-mail or telephone and 
 immediately and permanently delete the message 
 and any attachments. Thank you


   



 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
   

ForwardSourceID:NT00013B6E 

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged