hi, does any one know how to get harddisk serial number (not volume serial but teh serial on the hardisk sticker). I need to do it remotely. is there a command or app that does that???
thanks in advance.
hi, does any one know how to get harddisk serial number (not volume serial but teh serial on the hardisk sticker). I need to do it remotely. is there a command or app that does that???
thanks in advance.
Which OS?
Which hard disk model/brand?
Under a recent windows NT system that would bewmic diskdrive get serialnumber
but be aware of this
http//
AND of this
http//
Under linux, you may want to look at the output of hdparm with the -I switch.
jaclaz
You could check the SusClientIDValidation registry entry found in the Software\Microsoft\Windows\CurrentVersion\WindowsUpdate registry. The hard drive number is stored in Hex and will need to be converted.
SusClientIdValidation (Hex) 06 02 28 01 1a 2a 20 00 20 00 20 00 20 00 20 00 57 00 44 00 2d 00 57 00 43 00 41 00 4d 00 39 00 45 00 32 00 38 00 31 00 35 00 37 00 34 00 06 00 13 d4 ca 26 78 4d 00 42 00 2d 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 38 00 39 00 30 00 43 00 68 00 61 00 73 00 73 00 69 00 73 00 20 00 53 00 65 00 72 00 69 00 61 00 6c 00 20 00 4e 00 75 00 6d 00 62 00 65 00 72 00
SusClientIdValidation ..(..* . . . . .W.D.-.W.C.A.M.9.E.2.8.1.5.7.4….??&xM.B.-.1.2.3.4.5.6.7.8.9.0.C.h.a.s.s.i.s. .S.e.r.i.a.l. .N.u.m.b.e.r.
The following code fragment might give you an idea - largely based on Microsoft example
stat = DeviceIoControl(hDrive.dHandle,
IOCTL_STORAGE_QUERY_PROPERTY,
&propq,
sizeof(propq),
outputbuff,
1024,
&dwRead,
NULL);
if (stat==0){
stat = GetLastError();
// AfxMessageBox("Error on IOCTL_STORAGE_QUERY_PROPTERY");
}
STORAGE_DEVICE_DESCRIPTOR *sdd;
sdd = (STORAGE_DEVICE_DESCRIPTOR *)outputbuff;
if (sdd->SerialNumberOffset){
// remove any leading spaces
for(k=0; k<0x20; k++){
if (outputbuff[sdd->SerialNumberOffset+k] !=' '){
break;
}
}
movmem(outputbuff+sdd->SerialNumberOffset+k,
di[drive].drive_serial_number, 0x20);
}