SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Get-WmiObject : Invalid class for SQLServiceAdvancedProperty


Get-WmiObject : Invalid class for SQLServiceAdvancedProperty

Author
Message
kstjacques
kstjacques
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 376
Greetings! I have a command(below) in a powershell script that has been working for well over a year, but started failing about 4 days ago. I'm at a beginner level with powershell so it's not clear to me what's wrong. I've done some searching on the web to find out if anyone else has had issues with the SqlServiceAdvancedProperty being invalid, but I didn't find anything.

Two different things happened the day this started happening. 1) I installed SQL PSX 2.3.2.1 . I installed the same powershell mod on another server and the command below works just fine on the other server so I'm not convinced the mod caused the issue. 2) there were windows updates applied to the server. The server was rebooted after the updates.

If anyone has any suggestions on what my next steps should be for troubleshooting this issue, I would greatly appreciate it.

The command:

Get-WmiObject -Class "SqlServiceAdvancedProperty" -Namespace "root/Microsoft/SqlServer/ComputerManagement10" |? { $_.SqlServiceType -eq 1 } |% { $_.ServiceName } | Sort -Unique

the error:

Get-WmiObject : Invalid class
At line:1 char:14 + Get-WmiObject <<<< -Class "SqlServiceAdvancedProperty" -Namespace "root/Microsoft/SqlServer/ComputerManagement10" |?
{ $_.SqlServiceType -eq 1 } |% { $_.ServiceName } | Sort -Unique
+ CategoryInfo : InvalidOperation: (Smile [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand


Thank you,
Kim
kstjacques
kstjacques
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 376
Turns out WMI was hosed so it wasn't just that class that was missing Smile I repaired SQL Server and my script started working again.

Thanks,
Kim
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search