Get-SCOMClassInstance error

in my script I am attempting to get the scomclassinstance using this (personal information removed)

$Instance=Get-SCOMClassInstance-Name"servername.domainname.com"

this statement succeeds if I am using RDP to the scom management server, but if I execute this from my desktop I get the following:

Get-SCOMClassInstance : The Data Access service is either not running or not yet initialized. Check the event log for more information.
At scom-maintenance1.ps1:2 char:13
+ $Instance = Get-SCOMClassInstance -Name "servername.domainname.com"
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Syste...InstanceCommand:GetSCClassInstanceCommand) [Get-SCOMClassInstance], ServiceNotRunningException
    + FullyQualifiedErrorId : ExecutionError,Microsoft.SystemCenter.OperationsManagerV10.Commands.GetSCClassInstanceCommand

I am assuming that some service needs to be operating on the computer that executes the script or I need to find some way to point my script at the host running the service.  I have consulted TechNet library, and cannot seem to find what I am looking for.  Has anyone run into this problem yet?  I don't wish to run this on the server hosting systemcenter I wish to execute this script remotely from the agent managed node.

thanks,

-d

August 26th, 2015 10:23am

:Add the following to the start of your code

Import-Module OperationsManager

New-SCOMManagementGroupConnection -ComputerName "Management Server Name"

** You'll need the SCOM Console installed **

Disclaimer:
All information is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk.

The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 10:41am

Thank you this solved my problem!
August 26th, 2015 10:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics