PowerShell remoting broken

This topic contains 12 replies, has 6 voices, and was last updated by  Aaron Ticehurst 1 year, 7 months ago.

  • Author
    Posts
  • #31400

    Aaron Ticehurst
    Participant

    Hi,

    Installed WMF 5 production preview on Windows 2012 server and now I cannot reach the server using remoting (was working prior to the upgrade):

    Enter-PSSession -Computername The_Server
    Enter-PSSession : The term 'Measure-Object' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + Enter-PSSession -Computername The_Server
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Measure-Object:String) [Enter-PSSession], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    Invoke-Command {gwmi win32_bios} -cn The_Server
    The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
    try again.
    + CategoryInfo : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    + PSComputerName : The_Server

    Prior to the upgrade to WMF 5 I was unable to create workflow sessions (getting access denied), was hoping this might resolve that but it's just caused more problems :).

    Have been searching the event logs and not found anything useful as yet, have checked out about_Remote_Troubleshooting, restarted server, disabled and re-enabled remoting, no obvious difference between the setup between a working server wsman config and this broken one.

    Wondering if there is a way to rebuild the PS session configuration or something.

    Thanks.

  • #31515

    Mark Prior
    Participant

    HI Aaron

    I had very similar issues to this previously, if remoting is enabled (few links below that should help / confirm)

    http://ss64.com/ps/enable-wsmancredssp.html
    https://technet.microsoft.com/en-gb/library/hh849694.aspx?f=255&MSPPError=-2147217396
    https://technet.microsoft.com/en-us/library/jj614529.aspx

    i had enabled all of the above and still found an issue, after many hours the problem was i was not using FQDN for the server –

    Not working: Invoke-command -servername Server1 (access denied errors)
    Working: Invoke-command -servername Server1.domainname.com

    also you could try loading the module you are trying to run within the session, if the problem isnt the remoting

    Hope it helps

  • #31556

    Bob McCoy
    Participant

    PSRemoting works across my entire domain except for one machine, our MS Dynamics CRM server. For reasons I have yet to determine I can remote into that machine by IP address, but not by any variations on name. So you may want to give that a try.

  • #31585

    Aaron Ticehurst
    Participant

    Hi,

    Unfortunately it hasn't worked for both suggestions, thanks though!

  • #31590

    Peter Jurgens
    Participant

    This feels like a constrained language mode to me... Can run this against the server and let us know the result?

    Invoke-Command The_server {$ExecutionContext.SessionState.LanguageMode}

  • #31608

    Aaron Ticehurst
    Participant

    I agree, it sounded like a constrained language to me as well, however the command came back as:

    Invoke-Command The_server {$ExecutionContext.SessionState.LanguageMode}

    PSComputerName RunspaceId Value
    ————– ———- —–
    The_server 34ceaf0e-8c04-49b8-8a1f-5c7eadcce94c FullLanguage

    Interesting though that the command even ran as all over commands in the script block have failed for me before.

  • #31609

    Peter Jurgens
    Participant

    And what about running

    Invoke-Command The_server {Get-Command}

  • #31612

    Aaron Ticehurst
    Participant

    Invoke-Command The_Server {Get-Command}
    Access is denied
    + CategoryInfo : NotSpecified: (:) [Get-Command], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetCommandCommand
    + PSComputerName : The_Server

    I realise that Access is denied could mean a whole bunch of things but to check the permissions:

    PS C:\Windows\system32> Get-PSSessionConfiguration

    Name : microsoft.powershell
    PSVersion : 5.0
    StartupScript :
    RunAsUser :
    Permission : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote
    Management Users AccessAllowed

    Name : microsoft.powershell.workflow
    PSVersion : 5.0
    StartupScript :
    RunAsUser :
    Permission : BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management Users AccessAllowed

    Name : microsoft.powershell32
    PSVersion : 5.0
    StartupScript :
    RunAsUser :
    Permission : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote
    Management Users AccessAllowed

    Name : microsoft.windows.servermanagerworkflows
    PSVersion : 3.0
    StartupScript :
    RunAsUser :
    Permission : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed

  • #31710

    John
    Participant

    I have this same issue, and get the same error returns
    that Aaron received. The one thing I wanted to add
    to help is that I can remote to Windows 7 Pro, and Windows 8.1 Pro machines just fine, it is only when I try to remote to Windows 10 Enterprise machines that this error happens.

  • #37594

    GS
    Participant

    Had the same issue. Fixed it by checking what PSModulePath is set to on Machine Level. It has UNC path specified which is known to break bunch of stuff. Removed it and it works fine now.

  • #38913

    Aaron Ticehurst
    Participant

    Nice find!, Koala stamp for you GS!

    I updated another 2012 server to PS5 and grumbled as had same issue and came searching for a fix again.
    I've got an smb powershell repository (aka file shares) that works great. I put in the UNC paths in the machine environmentals to make it easier for colleagues to get access.

    Kinda sucks cause its very useful, wonder if it's worth lodging as a bug or if its by design for some kind of security reasons.

  • #38923

    GS
    Participant
  • #38975

    Aaron Ticehurst
    Participant

    Cool, voted.
    Thanks.

You must be logged in to reply to this topic.