May 23, 2012 at 10:18 am
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: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Thank you,
Kim
May 23, 2012 at 12:46 pm
Turns out WMI was hosed so it wasn't just that class that was missing 🙂 I repaired SQL Server and my script started working again.
Thanks,
Kim
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply