GetObject not working after migrating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Trezore
    New Member
    • Nov 2009
    • 1

    GetObject not working after migrating

    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:
    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

    But when I plug that into the ASP page, I get the following error:
    Microsoft VBScript runtime error '800a0046'

    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)

    I get:
    WshShell.Exec error '80070005'

    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!
Working...