<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to error check existing user in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/how-to-error-check-existing-user/m-p/15380#M815</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to write a script to add local groups, roles, users to multiple filers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When invoking new-nauser, the script terminates if the user already exists. Is there a way to check if the user exists prior to executing new-nauser?&lt;/P&gt;&lt;P&gt;What would the syntax be for using Get-NaUser to check if the user already exists without the script bombing out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 06:21:16 GMT</pubDate>
    <dc:creator>stephen2</dc:creator>
    <dc:date>2025-06-05T06:21:16Z</dc:date>
    <item>
      <title>how to error check existing user</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/how-to-error-check-existing-user/m-p/15380#M815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to write a script to add local groups, roles, users to multiple filers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When invoking new-nauser, the script terminates if the user already exists. Is there a way to check if the user exists prior to executing new-nauser?&lt;/P&gt;&lt;P&gt;What would the syntax be for using Get-NaUser to check if the user already exists without the script bombing out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:21:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/how-to-error-check-existing-user/m-p/15380#M815</guid>
      <dc:creator>stephen2</dc:creator>
      <dc:date>2025-06-05T06:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to error check existing user</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/how-to-error-check-existing-user/m-p/15385#M817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's pretty straightforward:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if (!(Get-NaUser eric -ErrorAction SilentlyContinue)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; New-NaUser eric -group users -password toolkit1!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;} &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;else &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{ &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Warning "User eric already exists"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you are confident your command won't fail for other reasons (e.g. bad group/password):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;New-NaUser eric -group users -password toolkit1! -ErrorAction SilentlyContinue &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 23:30:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/how-to-error-check-existing-user/m-p/15385#M817</guid>
      <dc:creator>timothyn</dc:creator>
      <dc:date>2012-08-09T23:30:03Z</dc:date>
    </item>
  </channel>
</rss>

