<?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 Re: Changing rsh to PowerShell for Win2012 in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115222#M4713</link>
    <description>&lt;P&gt;Not sure what type of example you're looking for. &amp;nbsp;Your "ExecRsh" can be replaced by the "Invoke-NcSsh" (or "Invoke-NaSsh" for 7-mode), but it's not a 1-for-1...you will need to do some updates to the script which is calling the fuction, the first being convert it from VBscript to PowerShell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other function I gave an example of in the other response...it all depends on what output you're looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jan 2016 19:37:57 GMT</pubDate>
    <dc:creator>asulliva</dc:creator>
    <dc:date>2016-01-31T19:37:57Z</dc:date>
    <item>
      <title>Changing rsh to PowerShell for Win2012</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115164#M4703</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please give me tips to change my script from rsh (win2003) to PowerShell!!!?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Function 1:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'############################################################################################&lt;BR /&gt;'&amp;nbsp; GetNetAppQuota()&lt;BR /&gt;'&amp;nbsp; Ermittelt die insgesamt vergebene Quota (in MB) auf einem NetApp-Server Volume&lt;BR /&gt;'############################################################################################&lt;BR /&gt;Private Function GetNetAppQuota(lstrServer, lstrVolume)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;On Error Resume Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;GetNetAppQuota = 0&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Dim lWshShell, loExec&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Dim lstrLine, lsz1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Dim lnQuota&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;If bDebug Then Call Logging("GetNetAppQuota().Param: " &amp;amp; lstrServer &amp;amp;", "&amp;amp; lstrVolume)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set lWshShell = CreateObject("WScript.Shell")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lsz1 = ""&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Set loExec = lWshShell.Exec (Join(Array(&lt;FONT color="#FF0000"&gt;"rsh"&lt;/FONT&gt;, lstrServer, "-n", "quota report")))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Do While Not loExec.StdOut.AtEndOfStream&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lstrLine = MyTrimSpaces(replace(loExec.StdOut.ReadLine, vbCr, ""))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'wscript.echo lstrLine&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lsz1 = split(lstrLine, " ")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if lsz1(0) &amp;lt;&amp;gt; "K-Bytes" And lsz1(0) &amp;lt;&amp;gt; "Type" And lsz1(0) &amp;lt;&amp;gt; "-----"&amp;nbsp; And lsz1(1) &amp;lt;&amp;gt; "*" then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if lsz1(2) = lstrVolume then lnQuota = lnQuota + lsz1(5) / 1024&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;end if&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Loop&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;GetNetAppQuota = lnQuota&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;If bDebug Then Call Logging("GetNetAppQuota().Return: " &amp;amp; GetNetAppQuota)&lt;BR /&gt;&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Function 2:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'############################################################################################&lt;BR /&gt;Private Function ExecRsh (host, cmd)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;On Error Resume Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Dim WshShell&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;If bDebug Then Call Logging("ExecRsh().Param: " &amp;amp; host &amp;amp; ", " &amp;amp; cmd)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Set WshShell = CreateObject("WScript.Shell")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if bDebug then Call Logging("ExecRsh().exec: " &amp;amp; Join(Array("rsh", host, "-n", cmd)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Set ExecRsh = WshShell.Exec (Join(Array("rsh", host, "-n", cmd)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Set WshShell = Nothing&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;If bDebug Then Call Logging("ExecRsh().Return: " &amp;amp; ExecRsh)&lt;BR /&gt;&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#######################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jalal_&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 22:13:00 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115164#M4703</guid>
      <dc:creator>Jalal_</dc:creator>
      <dc:date>2025-06-04T22:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Changing rsh to PowerShell for Win2012</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115165#M4704</link>
      <description>&lt;P&gt;Well, this isn't that hard, but you have to start be reading the getting started with powershell documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RSH should be eliminated at all cause b/c of the massive security hole, so you are going down the correct route..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not going to write it before you, but you can get started by reading the help for the powershell toolkit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Connect to controllers via https or rpc with connect-nacontroller&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For any help, you can do get-nahelp *quota*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 18:41:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115165#M4704</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2016-01-28T18:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Changing rsh to PowerShell for Win2012</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115171#M4705</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/46096"&gt;@Jalal_﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/11560"&gt;@JGPSHNTAP﻿&lt;/a&gt;&amp;nbsp;mentioned, be sure to give the docs a read. &amp;nbsp;Once you install the NetApp PowerShell Toolkit you can access the cmdlet documentation with the command "Show-NcHelp" (or Show-NaHelp for 7-mode). &amp;nbsp;This makes all the cmdlet definitions, examples, etc. available in HTML format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first script you have is simply doing a "quota report" against your storage system. &amp;nbsp;There are two ways you can do this: 1) use "Invoke-NcSsh" (or Invoke-NaSsh if using 7-mode) to execute the same "quota report" command against the system and parse the result in PowerShell vs VBscript, or 2) use the quota cmdlets...Get-NcQuotaReport (or Get-NaQuotaReport if 7-mode) to get the information. &amp;nbsp;I believe that the entire first function can be replaced by this...but it's hard to tell without knowing 7-mode vs clustered or what the expected output is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(Measure-Object -Sum (Get-NcQuotaReport).DiskUsed).Sum / 1024&lt;/PRE&gt;&lt;P&gt;The second function will simply execute any command against the controller using rsh. &amp;nbsp;This can be replaced using the above mentioned "Invoke-NcSsh" (or Inovke-NaSsh for 7-mode).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 01:51:49 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115171#M4705</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2016-01-29T01:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Changing rsh to PowerShell for Win2012</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115196#M4708</link>
      <description>&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;Is there an example&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for my&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;functions&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 12:44:38 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115196#M4708</guid>
      <dc:creator>Jalal_</dc:creator>
      <dc:date>2016-01-29T12:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Changing rsh to PowerShell for Win2012</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115222#M4713</link>
      <description>&lt;P&gt;Not sure what type of example you're looking for. &amp;nbsp;Your "ExecRsh" can be replaced by the "Invoke-NcSsh" (or "Invoke-NaSsh" for 7-mode), but it's not a 1-for-1...you will need to do some updates to the script which is calling the fuction, the first being convert it from VBscript to PowerShell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other function I gave an example of in the other response...it all depends on what output you're looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2016 19:37:57 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Changing-rsh-to-PowerShell-for-Win2012/m-p/115222#M4713</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2016-01-31T19:37:57Z</dc:date>
    </item>
  </channel>
</rss>

