get-wmiobject access denied RRS feed

  • Question

  • Hello,

     I am using a remote command tool. Which logs in on remote machine using administrative credentials and creates a windows service on it. Using this service i run some commands on it.

    This are absolutely fine when i run Simple DOS commands.

    But when i execute commandlets using a powershell script ( Which use WMI Object ) on Powershell using this tool.  Using these commands i want to get Hardware information of Host and VMs on perticular machine.

    $VmHost = Get-WmiObject -Namespace root\virtualization -ComputerName $fqdn -Query "Select * From  Msvm_ComputerSystem where caption='Hosting Computer System'"

    I get following Error
        ’ Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCES DENIED))’

    Although i execute same script on powershell directly, It executes smoothly.

    I have enabled distributed COM service on remote machine, also firewall is turnedoff.

    So what should be reson of these access errors i am getting, Thanks for your help in advance.....

    • Edited by Roshan VCPP Tuesday, February 17, 2009 8:50 AM
    Friday, February 13, 2009 6:08 PM


All replies