PDA

View Full Version : Wmi



Baeza
02-27-2006, 07:56 PM
hi I have a page where i need to identify the client's computer in order to allow the access.

so I developed an activex that uses wmi to grab the HD id and then checks it with the db and give access. could you give and example on how to do this using javascripts

regards

Twey
02-27-2006, 09:10 PM
That's awful. That'll lock out anyone not running Internet Explorer on Windows. Never, ever, ever do this!

There are two "reliable" ways of doing it: 1) check the IP address, and 2) check the MAC address. The latter is more reliable than the former, but also more easily circumvented. And of course, a proxy will blow the whole thing. What you want can't be done effectively. You could possibly try doing something similar using Java and not WMI (check the hostname, network info and so on, as many as possible) but it's still not recommended.

Perhaps if you say why you need this, we could suggest a workable alternative?

Baeza
02-27-2006, 11:04 PM
That's awful. That'll lock out anyone not running Internet Explorer on Windows. Never, ever, ever do this!

There are two "reliable" ways of doing it: 1) check the IP address, and 2) check the MAC address. The latter is more reliable than the former, but also more easily circumvented. And of course, a proxy will blow the whole thing. What you want can't be done effectively. You could possibly try doing something similar using Java and not WMI (check the hostname, network info and so on, as many as possible) but it's still not recommended.

Perhaps if you say why you need this, we could suggest a workable alternative?Hi thanks for the reply, well i heard so, that i shouldn't use wmi but the the thing is that we sell computers and we will only give support to those computers that people buy from us (i know they can change the HD to any other computer but that's not very common). so far it's working but we have to deal with ie not allowing to use activex

I think the way to go is what you said about using java instead, but haven't used java

regards

Twey
02-28-2006, 04:03 PM
Have you thought about just assigning a serial number to each computer you sell? That's the only real way to do this. Java is possible, but not everyone has Java installed.
so far it's working but we have to deal with ie not allowing to use activexNo, it isn't. Consider this: I am a customer of yours. I have installed Linux on the PC I bought from you. However, I have a problem (with my hardware, obviously, as the software wasn't provided by you). So, I enter your site, looking for some support, but... oh. I need to download Internet Explorer. Well, that irritates me for a start -- I shouldn't need to run proprietary software just to get a bit of support. So anyway, being a patient and technically-savvy person (which a lot of your customers won't be), I boot up qemu, install Windows onto a small file on my hard drive, and try to use ActiveX on IE there to access the support.
Oh dear. The qemu-emulated hard drive doesn't have the same signature as my real HD. Now what do I do?

Personally, I'd have returned the PC and gone to another company at the first setback. Using Java is considerably better than using ActiveX and WMI (as it at least makes some sort of attempt at cross-browser and -platform compatibility) but is still not an ideal solution. While the applet will be platform-independent, you'd still have to use platform-dependent code to check whatever you use to judge the machine by, which is a very bad situation to find one's self in, as it's impossible to anticipate every possible environment. And, of course, there are always those who don't have Java.
i know they can change the HD to any other computer but that's not very commonYou're right; probably not too many people will move their hard drive to another machine just so they can request support using a machine that isn't their own. Hard drive upgrades, however, are very common indeed.
Also, had you considered what the poor customer would do if the malfunctioning PC wouldn't boot?

Baeza
02-28-2006, 05:31 PM
Have you thought about just assigning a serial number to each computer you sell? That's the only real way to do this. Java is possible, but not everyone has Java installed.No, it isn't. Consider this: I am a customer of yours. I have installed Linux on the PC I bought from you. However, I have a problem (with my hardware, obviously, as the software wasn't provided by you). So, I enter your site, looking for some support, but... oh. I need to download Internet Explorer. Well, that irritates me for a start -- I shouldn't need to run proprietary software just to get a bit of support. So anyway, being a patient and technically-savvy person (which a lot of your customers won't be), I boot up qemu, install Windows onto a small file on my hard drive, and try to use ActiveX on IE there to access the support.
Oh dear. The qemu-emulated hard drive doesn't have the same signature as my real HD. Now what do I do?

Personally, I'd have returned the PC and gone to another company at the first setback. Using Java is considerably better than using ActiveX and WMI (as it at least makes some sort of attempt at cross-browser and -platform compatibility) but is still not an ideal solution. While the applet will be platform-independent, you'd still have to use platform-dependent code to check whatever you use to judge the machine by, which is a very bad situation to find one's self in, as it's impossible to anticipate every possible environment. And, of course, there are always those who don't have Java.You're right; probably not too many people will move their hard drive to another machine just so they can request support using a machine that isn't their own. Hard drive upgrades, however, are very common indeed.
Also, had you considered what the poor customer would do if the malfunctioning PC wouldn't boot?

well honestly everything you say at this point might be true that's why i came here. but let me tell you that I consider our clients are pretty happy with us cause we solve several issues regarding simple hardware problems, spyware, virus, driver problems, os updates, installing licenced sw, games not working properly and so on.

gonna have to study java like back in school since I'm a visual studio .net programmer

regards,

Twey
02-28-2006, 05:46 PM
Did you consider my first suggestion? It's the simplest and most effective and reliable way of solving your problem.

Baeza
02-28-2006, 06:29 PM
Did you consider my first suggestion? It's the simplest and most effective and reliable way of solving your problem.
do you mean like having a serial number as a login and password? well, if that's the case we will have to check once we enter the computer for the hd number but we don't want to bother our customers entering their computers and then go check with our database if it applies or not.

Twey
02-28-2006, 07:20 PM
do you mean like having a serial number as a login and password? well, if that's the case we will have to check once we enter the computer for the hd numberYou're completely missing my point :) Checking for the hard drive ID is about the worst way you could possibly have come up with to do this. Inconvenience or no, you do not want to be doing it.