The WMI scripting library provides the set of automation objects through which scripting languages, such as VBScript, JScript, and ActiveState ActivePerl access the WMI infrastructure. The WMI scripting library is implemented in a single automation component named wbemdisp.dll that physically resides in the systemroot\System32\Wbem directory. (description from microsoft.com) Read More >>
At the top of the WMI scripting library object model is the SWbemLocator object. SWbemLocator is used to establish an authenticated connection to a WMI namespace, much as the VBScript GetObject function and the WMI moniker "winmgmts:" are used to establish an authenticated connection to WMI. However, SWbemLocator is designed to address two specific scripting scenarios that cannot be performed using GetObject and the WMI moniker.(description from microsoft.com)
Read More >>
The whole script is given below, just copy this script and execute in IE only.
var s = obj.ConnectServer(".");
var properties = s.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration");
var e = new Enumerator (properties);
output='<table border="0" cellPadding="5px" cellSpacing="1px" bgColor="#CCCCCC">';
output=output + '<tr bgColor="#EAEAEA"><td>Caption</td><td>MACAddress</td></tr>';
var p = e.item();
output=output + '<tr bgColor="#FFFFFF">';
output=output + '<td>' + p.Caption; + '</td>';
output=output + '<td>' + p.MACAddress + '</td>';
output=output + '</tr>';
output=output + '</table>';
}</script></head><body><inputtype="button"value="Show MAC Address"onclick="showMacAddress()"/><divid="box"></div></body></html>
Using this search and replace technique, you can convert/replace short tags with normal php tags . Read More Convert PHP Short Tags
Script is very good and working fine.
But i would like to display one MAC Id, which is unique in any system.
How can i get?
Thanks and Regards
it is not working in ie8 the following error is comming
Microsoft JScript runtime error: Automation server can't create object
Has anyone been able to put all this data in form fileds and do a POST to a server ? I would like to save tihs data on the server side to make sure it is the same machinea accessing my system after purchasing a license.
Thanks in advance....i am getting an error like "Automation Server can't create object " plz help.....
Md Ali [20-May-2012]
When I run this code on my local machine, its working fine, but when I publish it to any hosting site, then it not working.