<?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 Powershell command/script to display lun name only (without full path)? (Get-NaLUN) in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Powershell-command-script-to-display-lun-name-only-without-full-path-Get-NaLUN/m-p/156567#M3049</link>
    <description>&lt;P&gt;Our customer (running Ontap 9.7) has a need to obtain output that displays LUN names only, however when using the host utilities kit&amp;nbsp; (v7.1)they see that the output won't show just the LUN name, but instead includes the entire path to the LUN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Linux, we have a workaround for the 'sanlun lun show' command by using the following command to extract the LUN names:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;sanlun lun show | grep vol | awk '{print $2}' | cut -d '/' -f 4 &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trying to figure out a similar workaround for them for Windows, possibly using the Netapp Powershell toolkit and the 'Get-NaLUN' command. Anyone out there have thoughts on how to script this to make it viable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 11:07:49 GMT</pubDate>
    <dc:creator>gaulden</dc:creator>
    <dc:date>2025-06-04T11:07:49Z</dc:date>
    <item>
      <title>Powershell command/script to display lun name only (without full path)? (Get-NaLUN)</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Powershell-command-script-to-display-lun-name-only-without-full-path-Get-NaLUN/m-p/156567#M3049</link>
      <description>&lt;P&gt;Our customer (running Ontap 9.7) has a need to obtain output that displays LUN names only, however when using the host utilities kit&amp;nbsp; (v7.1)they see that the output won't show just the LUN name, but instead includes the entire path to the LUN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Linux, we have a workaround for the 'sanlun lun show' command by using the following command to extract the LUN names:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;sanlun lun show | grep vol | awk '{print $2}' | cut -d '/' -f 4 &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trying to figure out a similar workaround for them for Windows, possibly using the Netapp Powershell toolkit and the 'Get-NaLUN' command. Anyone out there have thoughts on how to script this to make it viable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:07:49 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Powershell-command-script-to-display-lun-name-only-without-full-path-Get-NaLUN/m-p/156567#M3049</guid>
      <dc:creator>gaulden</dc:creator>
      <dc:date>2025-06-04T11:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell command/script to display lun name only (without full path)? (Get-NaLUN)</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Powershell-command-script-to-display-lun-name-only-without-full-path-Get-NaLUN/m-p/156596#M3050</link>
      <description>&lt;P&gt;Using the NetApp PowerShell Toolkit...hope this helps...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI - ONTAP 9.7 would use the "-Nc*" cmdlets - not the "-Na*".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Connect-NcController {clusterip}

$luns = (Get-NcLun).Path

 foreach ( $lun IN $luns ) {
     $lun_path = $lun.Split("/")
     $lun_name = $lun_path[$lun_path.count-1]
     $lun_name
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 17:53:17 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Powershell-command-script-to-display-lun-name-only-without-full-path-Get-NaLUN/m-p/156596#M3050</guid>
      <dc:creator>JohnChampion</dc:creator>
      <dc:date>2020-05-29T17:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Powershell command/script to display lun name only (without full path)? (Get-NaLUN)</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Powershell-command-script-to-display-lun-name-only-without-full-path-Get-NaLUN/m-p/156597#M3051</link>
      <description>&lt;P&gt;Regex to the rescue!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$Luns = Get-NcLun
foreach ($lun in $luns) { $lun.Path -replace '(?s)^.*\/', '' }&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 May 2020 17:55:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Powershell-command-script-to-display-lun-name-only-without-full-path-Get-NaLUN/m-p/156597#M3051</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2020-05-29T17:55:42Z</dc:date>
    </item>
  </channel>
</rss>

