简体   繁体   中英

Powershell The term 'Get-MsmqQueue' is not recognized as the name of a cmdlet in Windows Server 2008 R2 SP1

I'm trying to use the command Get-MsmqQueue in Windows Server 2008 R2 SP1 (x64), but I'm getting the following error:

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

MSMQ is installed on machine, the Powershell version is 5, I already reinstall the MSMQ and nothing.

How could I solve this?

While you have installed PowerShell version 5 it will not include any of the new cmdlets. The reason for this is that the cmdlets are tied to the APIs available to the OS and 2008 R2 does not have the required APIs. You will not be able to use the cmdlet as it was first usable in server 2012.

You can work around the issue by using WMI to pull MSMQ data but I do not know the specifics on how to do so. This answer here shows an example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM