PHP & WMI

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Slowfib
Forum Newbie
Posts: 5
Joined: Tue Oct 31, 2006 11:23 am

PHP & WMI

Post 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!
Slowfib
Forum Newbie
Posts: 5
Joined: Tue Oct 31, 2006 11:23 am

Post by Slowfib »

Anyone?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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).
Slowfib
Forum Newbie
Posts: 5
Joined: Tue Oct 31, 2006 11:23 am

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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).
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...
Slowfib
Forum Newbie
Posts: 5
Joined: Tue Oct 31, 2006 11:23 am

Post 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!
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Post 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.

Post Reply