<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Powershell help]]></title><description><![CDATA[<p dir="auto">Hello @all,</p>
<p dir="auto">i have following code in a template:</p>
<pre><code>&lt;config&gt;
	&lt;core&gt;
		&lt;ExternalMetric&gt;WindowsADUserGroup.Count(*):powershell -NoProfile -NonInteractive -Command "Write-Host ((Get-ADGroupMember -Identity '$1' -Recursive | Where-Object { $_.objectClass -eq 'user' }).count)"&lt;/ExternalMetric&gt;
	&lt;/core&gt;
&lt;/config&gt;
</code></pre>
<p dir="auto">If i run the code directly on a server, there are no errors..</p>
<p dir="auto">If i run the script via NetXMS DC, i getting the error that "_.objectClass" is not found...</p>
<p dir="auto">Where is my fault? I didn't get a solution for that... Many thanks for any help...</p>
<p dir="auto">Greetings<br />
Marco</p>
]]></description><link>https://forum.netxms.org/topic/8391/powershell-help</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 08:41:13 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/8391.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 May 2026 09:52:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Powershell help on Wed, 20 May 2026 12:47:48 GMT]]></title><description><![CDATA[<p dir="auto">Try escaping $ in the query</p>
]]></description><link>https://forum.netxms.org/post/35469</link><guid isPermaLink="true">https://forum.netxms.org/post/35469</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Wed, 20 May 2026 12:47:48 GMT</pubDate></item></channel></rss>