« Previous Next »

Thread: Cannot remotely connect

Last post 10-19-2009 9:30 AM by msufreeman. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-16-2009, 11:17 AM

    Cannot remotely connect

    Hello all, new PowerShell user here.  I know this site is mainly about IIS, but the description for this particular section says, "Use this forum to ask PowerShell questions, discuss issues, request features and yell at IIS team members." So, here I go :)

    I'm trying to remotely run WMI commands on other computers via PowerShell.  It's not the commands I'm having problems with, it's the actual connecting that I'm confused about.

    I'm testing with my desktop and my laptop, both of which I'm a local admin on, so I figure that I should be able to remotely run WMI commands between them via PowerShell.

    First test, I run gwmi -namespace "root\cimv2" -list -computer computerName and get:

    Get-WmiObject : The RPC server is unavailable. (Exception fro
    At line:1 char:5
    + gwmi  <<<< -namespace "root\cimv2" -list -computer computerName

    I found an article that point out a few reasons that PowerShell would throws this error and the only one that applied was the Firewall.  So, I turned off Firewall and the command worked.

    Then I tried to run the above code, but modified to use another account that should have permission by adding "-credential domain\accountName" to the command and I get this error:

    Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    At line:1 char:5
    + gwmi  <<<< -namespace "root\cimv2" -list -computer computerNAme -credential domain\accountName

    Now, I understand that this is simply telling me that the account doesn't have permission, however it really should.

    We have tons of other scripts that use the particular account I'm testing with.  The account is in fact set up for just that purpose.  Many of these scripts remotely access other machines in our domain and again use these credentials.

    So, after all of the rambling above, my question boils down to this.  Why would PowerShell tell me that this account doesn't have permission? Are there some other kinds of permission issues that I'm not aware of for PowerShell?  Also, the other scripts work on remote systems with the Firewall on, so why is PowerShell not working even for me as a local admin unless the Firewall is off?

    I realize that this could also be a WMI issue, but the script I'm working on is a rewrite from a vbScript that makes WMI calls and they work on there.

    Sorry about all of the text, but I like to explain my problem as much as I can.  Thanks for any help.

  • 10-19-2009, 9:03 AM In reply to

    Re: Cannot remotely connect

    msufreeman:
    Use this forum to ask PowerShell questions...

    That would be PowerShell questions related to IIS.  :)

    The best community I've found for general PowerShell is http://powershellcommunity.org/Forums/tabid/54/Default.aspx.  The Scripting Forums at Microsoft might also help.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 10-19-2009, 9:30 AM In reply to

    Re: Cannot remotely connect

    Okay Jeff.  Thanks for the recommendation.

Page 1 of 1 (3 items)
Microsoft Communities