Author |
Message
|
gdrucker |
Posted: Wed Feb 26, 2014 12:29 pm Post subject: Powershell - Support Pac MO74 |
|
|
Apprentice
Joined: 17 Jun 2005 Posts: 36 Location: New York
|
I have installed support pac MO74 Powershell for MQ. Running on Win2003 SP2, powershell V2.0, MQ V7.5.0
I added the MQ snap-in library using the install util.
The problem is that from powershell, I can run the cmdlets but it seems to not have access to any MQ objects. See examples below -
It really is registered -
PS C:\WINDOWS> get-PSsnapin -registered
Name :IBM.PowerShell.WebSphereMQ
PSVersion : 2.0
Description : This Windows PowerShell snap-in contains cmdlets to manage IBM WebSphere MQ resources.
No errors but no output either -
PS C:\WINDOWS> get-WMQQueueManager -Name *
??????
PS C:\WINDOWS> Stop-WMQChannel -Channel QM_IDEAL.USE5
Stop-WMQChannel : Cannot bind parameter 'Channel'. Cannot convert the "QM_IDEAL
.USE5" value of type "System.String" to type "WebSphereMQ.MQChannel".
At line:1 char:25
+ Stop-WMQChannel -Channel <<<< QM_IDEAL.USE5
+ CategoryInfo : InvalidArgument: ( [Stop-WMQChannel], Paramete
rBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,WebSphereMQ.StopW
MQChannel |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Feb 26, 2014 2:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I thought you needed some kind of import statement or equivalent.
And first you'll need to attach to the qmgr.
Why would you try to manipulate a channel when you have no qmgr objet to manipulate?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gdrucker |
Posted: Wed Feb 26, 2014 2:55 pm Post subject: |
|
|
Apprentice
Joined: 17 Jun 2005 Posts: 36 Location: New York
|
Shouldn't this statement tell me what queue managers are up and running? I haven't been able to find documentation explaining an import or attach like procedure.
get-WMQQueueManager -Name * |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 26, 2014 5:52 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should also confirm that you are running this in a shell that has either a primary MQ installation or one in which you have executed setmqenv appropriately.
I strongly suspect, without having checked, that this supportPac has not been updated to support multiple installations. |
|
Back to top |
|
 |
gdrucker |
Posted: Thu Feb 27, 2014 10:08 am Post subject: |
|
|
Apprentice
Joined: 17 Jun 2005 Posts: 36 Location: New York
|
This server only has one MQ installation. MQ Version 7.5 which was upgraded last year from V6. If I run the SETMQENV command and specify the primary queue manager, could it do any harm? |
|
Back to top |
|
 |
adm1122 |
Posted: Thu Feb 27, 2014 3:09 pm Post subject: |
|
|
Newbie
Joined: 27 Feb 2014 Posts: 4
|
Hi, I have the same problem:
Get-WMQQueueManager -name *
returns nothing even thought there are two queue managers on the machine? |
|
Back to top |
|
 |
gdrucker |
Posted: Thu Feb 27, 2014 3:19 pm Post subject: |
|
|
Apprentice
Joined: 17 Jun 2005 Posts: 36 Location: New York
|
Cool. Misery loves company Trying some things, will let you know if I have any luck. I am surprised to see that there are not many posts on the subject. If we can get this working, the possibilities for powerful windows based scripts seem endless. |
|
Back to top |
|
 |
adm1122 |
Posted: Thu Feb 27, 2014 3:27 pm Post subject: |
|
|
Newbie
Joined: 27 Feb 2014 Posts: 4
|
gdrucker wrote: |
Cool. Misery loves company Trying some things, will let you know if I have any luck. I am surprised to see that there are not many posts on the subject. If we can get this working, the possibilities for powerful windows based scripts seem endless. |
Thanks mate! |
|
Back to top |
|
 |
adm1122 |
Posted: Thu Feb 27, 2014 3:55 pm Post subject: |
|
|
Newbie
Joined: 27 Feb 2014 Posts: 4
|
I tried this and it tells me it cannot find any local queue managers:
PS C:\Users\adm1122_a> Get-WMQQueueManager -Debug
DEBUG: Opened WMQ queue managers registry key
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): a
DEBUG: No local queue managers. If WMQ client only on this machine, this is not an error.
DEBUG: Object reference not set to an instance of an object.
DEBUG: 1 queue manager names to look for
DEBUG: Looking for qmgr: *
DEBUG: Found 0 matching local queue managers
Yet the queue managers are there:
PS C:\Users\adm1122_a> dspmq
QMNAME(ESBL1APP1) STATUS(Running)
QMNAME(ESBZ1APP1) STATUS(Status not available)
QMNAME(HUBL1CLS1) STATUS(Running)
QMNAME(HUBZ1CLS1) STATUS(Status not available)
 |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Feb 28, 2014 5:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
That does sound kind of like the supportPac can't find the mqm dll's to bind against.
Which, again, suggests that the primary installation is not the default installation.
Running setmqenv doesn't hurt. It's a quick easy thing to test, too.
So just <path to MQ install>/bin/setmqenv -s from the powershell window and give it another try.
If that doesn't work, you can send a note to the owner/maintainer of the supportPac... |
|
Back to top |
|
 |
gdrucker |
Posted: Fri Feb 28, 2014 7:26 am Post subject: |
|
|
Apprentice
Joined: 17 Jun 2005 Posts: 36 Location: New York
|
I do have the same situation as adm1122. I tried the setmqenv command but no luck. See below.
PS D:\Program Files\ibm\WebSphere MQ\bin> setmqenv -s
PS D:\Program Files\ibm\WebSphere MQ\bin>
PS D:\Program Files\ibm\WebSphere MQ\bin>
PS D:\Program Files\ibm\WebSphere MQ\bin> Get-WMQQueueManager
PS D:\Program Files\ibm\WebSphere MQ\bin>
PS D:\Program Files\ibm\WebSphere MQ\bin> Get-WMQQueueManager -debug
DEBUG: Opened WMQ queue managers registry key
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help
(default is "Y"):
DEBUG: No local queue managers. If WMQ client only on this machine, this is not
an error.
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help
(default is "Y"):A
DEBUG: Object reference not set to an instance of an object.
DEBUG: 1 queue manager names to look for
DEBUG: Looking for qmgr: *
DEBUG: Found 0 matching local queue managers
PS D:\Program Files\ibm\WebSphere MQ\bin> |
|
Back to top |
|
 |
markt |
Posted: Fri Feb 28, 2014 11:04 am Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
Probably looking for things that were once in the registry and are now in ini files, or have moved in the registry as part of the multi-version support. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Feb 28, 2014 11:37 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
After spending the best part of the day struggling with Powershell (Server 2008R2) I have to say that it is IMHO just about the worst thing/bit of software ever to some out of Redmond and that is saying something after all I have been writing Software for close on 42 years and in that time I have seen some lemons.
Take a simple script that will bring some Queue Manager and Broker resources online in an MSCS Cluster online. It works right away in a PowerShell command window.
Then try running it via remote shell and frankly you can forget it. Modules that are there in the PS windows suddenly are nowhere to be found when invoking it from a standard command shell.
None of the remedies that google brings up works.
It might be fixed in Server 2012 but at the moment, IMHO and on Server 2008 R2 it is a pile of steaming dog-poo on a very hot day.
Don't even get me started on having to sign everything (unless you deliberately override it). Don't MS developers ever think about 'Ease of Use'. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
gdrucker |
Posted: Fri Feb 28, 2014 11:53 am Post subject: |
|
|
Apprentice
Joined: 17 Jun 2005 Posts: 36 Location: New York
|
"Probably looking for things that were once in the registry and are now in ini files, or have moved in the registry as part of the multi-version support."
So if that statement is correct, you are saying that the powershell cmdlets just won't work with MQ V7.5 where I believe some registry entries have been moved to .ini files? |
|
Back to top |
|
 |
markt |
Posted: Fri Feb 28, 2014 12:39 pm Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
The other possibility is 32/64-bit issues - I can see that MO74 tries to do:
Registry.LocalMachine.OpenSubKey("SOFTWARE\\IBM\\MQSeries\\CurrentVersion\\Configuration\\QueueManager") to find the list of qmgrs.
But on a 64-bit OS, that's really something like Software\\wow6432node\\...
I remember having to explicitly switch between those in some code I wrote querying the registry; don't know if the powershell environment makes it transparent or if you can affect how it searches.
In any case, if MO74 is looking for things that have moved or are no longer there, then it's not going to work. Even if you get the list of qmgrs you might find some issue at the next phase.
You can try contacting the author, but I don't know if he's doing anything with it now. |
|
Back to top |
|
 |
|