Monitor Script Powershell parameter

Hi,
I’m trying to paste a parameter from the target but I can’t get it to work. I try to past and use the link in my script:
$Target/Property[Type=“SystemLibrary7585010!System.Entity”]/DisplayName$$Target/Property[Type=“SystemLibrary7585010!System.Entity”]/DisplayName$

Best Regards

Robert

without knowing much of the story of what you try to achieve…
When I create a powershell based discovery or something like that. I have the parameters section in XML where you assign a parameter alias to those things you posted there. And next in the script body I start with:

param($sourceId,$managedEntityId,$computerName)

Which are the 3 aliasses in my case I put in the parameters section.
I can try and paste something like that as well, this would be parameters section below the scriptbody xml tag.

        <Parameter>

          <Name>sourceId</Name>

          <Value>$MPElement$</Value>

        </Parameter>

        <Parameter>

          <Name>managedEntityId</Name>

          <Value>$Target/Id$</Value>

        </Parameter>

        <Parameter>

          <Name>computerName</Name>

          <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>

        </Parameter>

      </Parameters>

I think this would get you what you need. Well depending on your circumstances. Mind you im not a great developer :slight_smile:

1 Like

Thanks for your reply, now its working :slightly_smiling_face:

Regards

Robert