Author Posts

October 27, 2015 at 11:52 pm

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.

October 29, 2015 at 11:59 pm

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

October 31, 2015 at 4:04 pm

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.

November 2, 2015 at 12:35 am

Hi,

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

November 2, 2015 at 5:01 am

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}

November 2, 2015 at 6:48 pm

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.

November 2, 2015 at 8:28 pm

And what about running

Invoke-Command The_server {Get-Command}

November 2, 2015 at 10:50 pm

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

November 5, 2015 at 6:38 am

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.

April 12, 2016 at 11:51 am

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.

May 11, 2016 at 1:15 am

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.

May 11, 2016 at 9:36 pm

Cool, voted.
Thanks.