How can I modify this code for testing a wmi query without having the following error :
Get-WmiObject : Invalid namespace
At line:3 char:23
+ $cluster=get-wmiobject <<<< -class "MSCluster_Cluster" -namespace "root\mscluster" -computername "$mach_name" | select -ExpandProperty Name
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
This script can be execute on windows server 2008 R2 or 2003.
Same error with -namespace "root\cluster" .
Thanks
Regards
bibi
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Neil Russell
On a server that is part of a cluster can you run the following in powershell?
Already done, I want to test if the server is a clustered or not. If I execute the script and the server is not a cluster, the error occurs :
Get-WmiObject : Invalid namespace
At line:3 char:23
+ $cluster=get-wmiobject <<<< -class "MSCluster_Cluster" -namespace "root\mscluster" -computername "$mach_name" | select -ExpandProperty Name
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
-namespace "root\cluster"