Page 1 of 1

PHP & WMI

Posted: Tue Oct 31, 2006 11:40 am
by Slowfib
I have a Linux box that runs PHP/Apache, and I'd like to be able to query computers in my network with WMI, then display the results on a PHP page. I'm interested in retrieving small things, like a process list.
How should I go about doing this? Security isn't a huge concern, but I'd like to keep at as tight as possible.
From what I've read on Google, some people suggest writing a separate application all together, as they think WMI isn't secure.

Any direction would be appreciated. Thanks!

Posted: Thu Nov 02, 2006 1:38 am
by Slowfib
Anyone?

Posted: Thu Nov 02, 2006 12:46 pm
by RobertGonzalez
Do you have any links to WMI (so as a person who doesn't know what it is can find out more information).

Posted: Thu Nov 02, 2006 3:50 pm
by Slowfib
Sure!
Windows Management Instrumentation (WMI) is a set of extensions to the Windows Driver Model that provides an operating system interface through which instrumented components can provide information and notification. WMI is Microsoft's implementation of the Web-Based Enterprise Management (WBEM) Standard from the Distributed Management Task Force (DMTF).

WMI allows scripting languages like VBScript to manage Microsoft Windows personal computers and servers, both locally and remotely. WMI is preinstalled in Windows Server 2003, Windows XP, Windows Me, and Windows 2000.
Wikipedia: http://en.wikipedia.org/wiki/Windows_Ma ... umentation
Microsoft's Site: http://www.microsoft.com/whdc/system/pn ... fault.mspx

Posted: Thu Nov 02, 2006 4:09 pm
by RobertGonzalez
That wiki page offers a lot of good information. It appears that you have to build an interface to it (unless I am reading it wrong).

Posted: Thu Nov 02, 2006 4:12 pm
by timvw
I haven't tried, but i would probably use the .net api for wmi.. and then use the .net extension to activate it from php...

Posted: Fri Nov 03, 2006 2:48 pm
by Slowfib
timvw wrote:I haven't tried, but i would probably use the .net api for wmi.. and then use the .net extension to activate it from php...
Could you be more specific about this? I'm not even sure where to start.
Tutorial? Documentation?

Thanks for the comments guys!

Posted: Fri Nov 03, 2006 2:51 pm
by kingconnections
Like this:

Code: Select all

print passthru('wmic bios get serialnumber');

Just use the command line version. But it has to be hosted on a windows machine.