NIC info via script!!!

pts.
Tags:
DataCenter
Development
Hardware
Management
Microsoft Windows
Networking
OS
Security
Servers
SQL Server
Hiya all, I have made a script (Copy and paste from microsoft, then tweak!!!!) to give me certain PC specs, and want to know how to add the NIC information to it, the script gvies me PC name, manufacturer, CPU make, model, speed, RAM, VGA adapter, and i just wanna add the NIC to it. If i can do this, my new Audit will then take me 1 days as opposed to 1 week!!! Any help'd be great, if you need the script, just ask me, it's a compilation, and not domain specific so i can post it if needed. Cheers, Carl.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Could you please post the script?

<a href=”http://itknowledgeexchange.techtarget.com/profile/Alessandro.panzetta”>Alessandro Panzetta</a>
Here is the solution:
<pre>Set objWMIService = GetObject(“winmgmts:\\.\root\cimv2″)
Set IPConfigSet = objWMIService.ExecQuery(“Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE”)
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
WScript.Echo IPConfig.Description(i)
Next
End If
Next
</pre>

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Carl0s81
    cheers for that, just checked and works!!! Will tweak it to loose some info thats not needed. Thats all i wanted, but a mate is doing the same thing but needs HDD size, is that possible? Hate to sound cheecky, but if anyone knows???? Cheers, Carl.
    0 pointsBadges:
    report
  • Carl0s81
    Excellent!!! Thanks for all the help so far!! All i did was copy and paste then worked out the rest (what i could cut!!) and i got people asking me for copys galore!!!! Thanks to all for the help so far. I'll post a easier to read copy up when i've done tweaking it, and i'll check out the MSDN myself see what else i can find!! Thanks again, Carl.
    0 pointsBadges:
    report
  • Carl0s81
    Excellent!!! Thanks for all the help so far!! All i did was copy and paste then worked out the rest (what i could cut!!) and i got people asking me for copys galore!!!! Thanks to all for the help so far. I'll post a easier to read copy up when i've done tweaking it, and i'll check out the MSDN myself see what else i can find!! Thanks again, Carl.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following