10 messaggi dal 12 luglio 2002
E' possibile sapere la versione di Windows installata sul surver?
68 messaggi dal 23 marzo 2004
Ho trovato la soluzione su usenet, era stata postata da Daniele Bochicchio:

****************************************************************************************************
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colSettings
response.write "Sistema Operativo: " & objOperatingSystem.Name
response.write "Versione: " & objOperatingSystem.Version
response.write "Service Pack: " & objOperatingSystem.ServicePackMajorVersion & "." & objOperatingSystem.ServicePackMinorVersion
response.write "Fornitore: " & objOperatingSystem.Manufacturer
response.write "Directory di Windows: " & objOperatingSystem.WindowsDirectory
response.write "--------------------------"
response.write "Memoria Fisica disponibile: " & objOperatingSystem.FreePhysicalMemory
response.write "Memoria Virtuale Totale: " & objOperatingSystem.TotalVirtualMemorySize
response.write "Memoria Virtuale Disponibile: " & objOperatingSystem.FreeVirtualMemory
response.write "--------------------------"
Next

Set colSettings = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")

For Each objComputer in colSettings
response.write "Nome Computer: " & objComputer.Name
response.write "Fornitore Computer: " & objComputer.Manufacturer
response.write "Modello Computer: " & objComputer.Model
response.write "Memoria Fisica Totale: " & objComputer.TotalPhysicalMemory
response.write "-------------------------"
Next

Set colSettings = objWMIService.ExecQuery ("Select * from Win32_Processor")

For Each objProcessor in colSettings
response.write "Tipo di Computer: " & objProcessor.Architecture
response.write "Processore: " & objProcessor.Description
response.write "---------------------"
Next

Set colSettings = objWMIService.ExecQuery ("Select * from Win32_BIOS")

For Each objBIOS in colSettings
response.write "Versione BIOS: " & objBIOS.Version
Next
****************************************************************************************************

Nota: se ti esce l'errore : 0x80041003

E' perchè non hai i giusti privilegi sull'oggetto WMI.

La soluzione è questa:

Using System.Management and WMI
Windows Management Instrumentation (WMI) is a powerful, administrative functionality that you can use to manage and to monitor Windows-based computers. However, when ASP.NET applications run under the ASPNET account, this account only has the same default access permissions as Everyone. These permissions include reading WMI data, writing provider data, and executing methods for providers on the local computer. More information about the WMI security mechanisms can be found in the WMI Platform SDK documentation or on MSDN.

NOTE: On Windows 2000 without service pack 3 (SP3) or later, or on Windows XP without service pack 1 (SP1) or later, ASP.NET Web applications that run under the ASPNET account may not work, and you may receive an "Access Denied (0x80041003)" error message. This occurs because the account does not have enough privileges to access certain WMI namespaces. To resolve the issue, install Windows XP SP1 or later, or Windows 2000 SP3 or later. To work around the issue, follow these steps:
Open the Computer Management Microsoft Management Console (MMC) snap-in.
Expand Services and Applications, and then select WMI Control.
Right-click WMI Control, and then click Properties.
In the WMI Control Properties dialog box, click the Security tab.
Expand Root, select CIMV2, and then click Security.
In the Security dialog box, click Advanced.
In the Access Control Settings dialog box, click Add. Select localMachineName\ASPNET, and then click OK.
In the Permission Entry dialog box, make sure that Apply Onto is set to This namespace and subnamespaces.
Make sure that the Allow 'Enable Account' and Allow 'Remote Enable' check boxes are selected.
Click OK in each dialog box until you return to the WMI Control Properties dialog box.
Repeat steps 5 through 10 for other WMI namespaces that your application will access.
Restart IIS. To do this, run IISRESET from the command line.
By default, ASP.NET generates a cryptographically strong password for the ASPNET account. Therefore, this workaround is safe provided that the ASPNET account password is not shared between computers or reset to a value other than the default.

(Presa da: http://support.microsoft.com/default.aspx?scid=kb;en-us;317012)

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.