Passing "-ComputerName" to the Get-SCOMAgent cmdlet will not work. This
parameter tells the cmdlet which SCOM server to connect to.
What you will have to do is get all agents and filter on the ComputerName
property.
Get-SCOMAgent | ? {$_.ComputerName -eq "COMPUTERNAME" } | Do-WhatIAmGoingToDo
From: [email protected] [mailto:[email protected]] On
Behalf Of Orlebeck, Geoffrey
Sent: Thursday, July 30, 2015 4:15 PM
To: [email protected]
Subject: [msmom] RE: Discover Computer via PowerShell
Well, I found the "System Center Data Access" service (auto-connected to the
last host in 'services.msc', which wasn't the localhost/Management Server).
The service is running and using our designated SCOM DAS account.
Thanks,
Geoff
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of Orlebeck, Geoffrey
Sent: Thursday, July 30, 2015 2:13 PM
To: [email protected]<mailto:[email protected]>
Subject: [msmom] Discover Computer via PowerShell
Is there a straightforward way within the OperationsManager PowerShell module
to discover a host by its non-FQDN name?
Example that works with FQDN:
Get-SCOMAgent -DNSHostName hostname.domain.com
However, if I don't give the FQDN, the above command won't work. I see
"ComputerName", but when I tried it via "Get-SCOMAgent -ComputerName Hostname"
it fails stating the Data Access service is either not running or not yet
initialized. I'm running this on one of the Management Servers and do not see
any "Data Access" service by ServiceName or DisplayName.
My goal is for users to be able to input a hostname and perform some tasks, but
I don't want them to have to remember to enter the FQDN, if it's avoidable. I
would append our domain to their entries, but we actually have several domains
reporting to our environment, so hardcoding the appending text is not ideal
either.
Thoughts?
Geoffrey Orlebeck
Systems Administrator II
Health Information Technology
Community Hospital of the Monterey Peninsula
PO Box HH: Monterey, CA 93942
Ph: (831) 622-2623 │ Fax: (831) 622-2608
[email protected]<mailto:[email protected]>
Confidentiality Notice: This is a transmission from Community Hospital of the
Monterey Peninsula. This message and any attached documents may be confidential
and contain information protected by state and federal medical privacy
statutes. They are intended only for the use of the addressee. If you are not
the intended recipient, any disclosure, copying, or distribution of this
information is strictly prohibited. If you received this transmission in error,
please accept our apologies and notify the sender. Thank you.
Confidentiality Notice: This is a transmission from Community Hospital of the
Monterey Peninsula. This message and any attached documents may be confidential
and contain information protected by state and federal medical privacy
statutes. They are intended only for the use of the addressee. If you are not
the intended recipient, any disclosure, copying, or distribution of this
information is strictly prohibited. If you received this transmission in error,
please accept our apologies and notify the sender. Thank you.