Command Shell Examples
Useful SQL Queries
Enable Agent Proxying, by Health Service Id - Jonathan Almquist on Operations Manager - Site Home - TechNet Blogs

Enable Agent Proxying, by Health Service Id

Enable Agent Proxying, by Health Service Id

  • Comments 2
  • Likes

Enable Agent Proxying, by Health Service Id

$a=get-agent | where {$_.hostedHealthService.id -eq "guid"};$a.set_proxyingEnabled($true);$a.applyChanges()

main menu

I do not moderate this blog anymore. If you have a question regarding this post, send me a message.

Comments
  • UPDATED PAGE ON 03-19-2009 If you have visited my Command Shell blog page before, I have posted notice

  • I had issues with this script:

    >$a=get-agent | where {$_.hostedHealthService.id -eq "f741b401-0000-0000-0000-000000000000"};$a.set_proxyingEnabled($true);$a.applyChanges()

    You cannot call a method on a null-valued expression.

    At line:1 char:115

    + $a=get-agent | where {$_.hostedHealthService.id -eq "f741b401-0000-0000-0000-000000000000"};$a.set_proxyingEnabled <<<< ($true);$a.applyC

    hanges()

       + CategoryInfo          : InvalidOperation: (set_proxyingEnabled:String) [], RuntimeException

       + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.

    At line:1 char:138

    + $a=get-agent | where {$_.hostedHealthService.id -eq "f741b401-0000-0000-0000-000000000000"};$a.set_proxyingEnabled($true);$a.applyChanges

    <<<< ()

       + CategoryInfo          : InvalidOperation: (applyChanges:String) [], RuntimeException

       + FullyQualifiedErrorId : InvokeMethodOnNull