Migrated website from Windows 2000 IIS 5.0
to Windows 2003 IIS 6.0
Used to get the Computer name resolved via shell, but that won't work anymore.
Found the following to work if I step though the logic in VB 6.0:
But when I plug that into the ASP page, I get the following error:
When I try:
I get:
I'm getting the impression there is no way to get the computer name info via ASP code due to security issues set forth with IIS 6.0. But I am unable to confirm that.
Any help is very much appreciated. Thanks!
to Windows 2003 IIS 6.0
Used to get the Computer name resolved via shell, but that won't work anymore.
Found the following to work if I step though the logic in VB 6.0:
Set objWMIService = GetObject("winm gmts:{impersona tionLevel=imper sonate}!\\" & (IP ADDRESS OF COMPUTER) & "\root\cimv 2")
Set colComputer = objWMIService.E xecQuery ("Select * from Win32_ComputerS ystem")
For Each objComputer In colComputer
strComputerName = objComputer.Nam e ' NETBIOS name
Next
Set colComputer = objWMIService.E xecQuery ("Select * from Win32_ComputerS ystem")
For Each objComputer In colComputer
strComputerName = objComputer.Nam e ' NETBIOS name
Next
But when I plug that into the ASP page, I get the following error:
Microsoft VBScript runtime error '800a0046'
Permission denied: 'GetObject'
Permission denied: 'GetObject'
When I try:
DIM ObjShell
SET objShell=Create Object("WScript .Shell")
DIM objExec, strResult
SET objExec = objShell.Exec(" cmd /c ping -a -n 1 " & Request.ServerV ariables("Remot e_Addr"))
strResult = objExec.StdOut. ReadAll
strResult = mid(strResult,1 2,15)
SET objShell=Create Object("WScript .Shell")
DIM objExec, strResult
SET objExec = objShell.Exec(" cmd /c ping -a -n 1 " & Request.ServerV ariables("Remot e_Addr"))
strResult = objExec.StdOut. ReadAll
strResult = mid(strResult,1 2,15)
I get:
WshShell.Exec error '80070005'
Access is denied.
Access is denied.
I'm getting the impression there is no way to get the computer name info via ASP code due to security issues set forth with IIS 6.0. But I am unable to confirm that.
Any help is very much appreciated. Thanks!