Powershell in SCOM syntax ... get-agent -managementserver?
Hello, I got the list of all SCOM Agents I have doesn't matter which Managerment Server they are connected to. get-agent | export-csv -notype c:\scomagents.csv Now I need to plit them per management server... I saw the switch -ManagementServer but when I try: get-agent | export-csv -managementServer opmgrms1 -notype c:\scomagentsopmgrms1.csv this is failing: SYNTAX Get-Agent [[-Path] [<String[]>]] [<CommonParameters>] Get-Agent [-ManagementServer] <ManagementServer> [<CommonParameters>] DESCRIPTION Gets the agents associated with the specified management server. >get-agent -ManagementServer opmgrdms1 Get-Agent : Cannot bind parameter 'ManagementServer'. Cannot convert the "opmgrdms1 " value of type "System.String" to type "Microsoft.EnterpriseManagement.Administrat ion.ManagementServer". At line:1 char:28 + get-agent -ManagementServer <<<< opmgrdms1 + CategoryInfo : InvalidArgument: (:) [Get-Agent], ParameterBindingEx ception + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.EnterpriseM anagement.OperationsManager.ClientShell.GetAgentManagedComputerCmdlet PS Monitoring:\OPMGRRMS1.ad.medctr.ucla.edu > Any comments? Thanks, DomSystem Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 Support
October 20th, 2010 7:23pm

Hi, This is because the -ManagementServer parameter cannot convert the string to a management server object. Try this instead: Get-ManagementServer | ? { $_.computername -eq "opsmgrms1" } | get-agent | export-csv -notype c:\scomagents.csv Matt Matt White ( http://systemcenterblog.hardac.co.uk/ )
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2010 7:36pm

Exactly what I needed thanks.. I have dupliacted in the csv file but not on the SCOM Console any swicth to add to be sure it is what is seen on the SCOM Console? Thanks, - DOm System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 Support
October 21st, 2010 3:38am

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

Other recent topics Other recent topics