次の方法で共有


Web Application Proxy PowerShell cmdlets are not available in x86

The Setup

Starting in Windows Server 2008 R2, the operating system no longer ships on the x86 platform (link). However, there are many backward compatibility features included in the x64 product to enable older 32 bit applications to run without issue on the x64 platform. One of the compatibility features is a x86 PowerShell executable. On the start screen, type Powershell, and you will see the x86 version of the prompt.

The Setup

Starting in Windows Server 2008 R2, the operating system no longer ships on the x86 platform (link). However, there are many backward compatibility features included in the x64 product to enable older 32 bit applications to run without issue on the x64 platform. One of the compatibility features is a x86 PowerShell executable. On the start screen, type Powershell, and you will see the x86 version of the prompt.

PS943ur

Here are the actual paths:

 Powershell
x64: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
x86: %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe

Powershell ISE

x64: %windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
x86: %windir%\syswow64\WindowsPowerShell\v1.0\PowerShell_ISE.exe

The Story

A customer and I were working on updating the Service Communications certificate for AD FS. We had a change document that we were following, based primarily on the information in this blog post.  During the  change implementation window, we hit a snag. The command to update the Web Application Proxy (WAP) SSL certificate was not working. (Set-WebApplicationProxySslCertificate -Thumbprint <thumbprint> )

This was the error:

PS943as

 Get-WebApplicationProxySslCertificate : The term 'Get-WebApplicationProxySslCertificate' 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
+ Get-WebApplicationProxySslCertificate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-WebApplicationProxySslCertificate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

However, we had tested this command in the validation environment previously without issues. Why was the command now failing?

The Hunt

It turns out that if we look for the Web Application Proxy commands in the x86 PowerShell prompt, we don't get any results.

Get-Command -Module WebApplicationProxy

PS943are

 

However, if we look for the commands at a x64 PowerShell prompt, we see the commands.

PS943asr

The Fix

As you may have surmised by this point, the fix was to run the commands at the x64 prompt.

PS943534

I don't know for certain why there isn't an x86 version of these commands, but I suspect it may be because the Web Application Proxy wasn't available until Windows Server 2012 R2, the third generation of the OS that doesn't ship for the x86 platform.

I wouldn't be surprised if there are other modules that don't have a corresponding  x86 module. In fact, I think it will become more common as x86 becomes increasingly antiquated.

Comments

  • Anonymous
    March 02, 2016
    I'm having the same issue with x86 and 64-bit versions of powershell on Server 2012 R2. Any ideas?
    • Anonymous
      March 02, 2016
      You mean you are getting the same error in both x86 and x64 PowerShell consoles? What command are you trying to run?
    • Anonymous
      January 05, 2017
      Did you ever get this to work? I am having same problem in Server 2012R2
      • Anonymous
        January 05, 2017
        Can you clarify that from the x64 PowerShell prompt you get the commands back when you run this command?Get-Command -Module WebApplicationProxyIf not, make sure that you have the Web Application Proxy Role installed:Get-WindowsFeature -Name Web-Application-Proxy