I am trying to create a script that will list the snapmirror status for my filers and send the results to me in an e-mail. When I type get-nasnapmirror FILERNAME it just brings me right back to the command prompt with no data returned. I have also tried get-nasnapmirror FILERNAME:volume
If I type get-nasnapmirror by itself I get the result of a filer, but not the one I am trying to get. I am not sure how or why it is going to that particular filer.
Hello, Kurt. When you issue Connect-NaController, the resulting connection is cached in $global:CurrentNaController, and this value is used by all subsequent Toolkit cmdlet invocations unless you specifically provide the target using the -Controller parameter.
So to get Snapmirror relationships on a single controller, try:
To get Snapmirror relationships on a different controller, or in a loop context, try this:
In this last case, the -Location parameter is just a string that matches the values returned by Get-NaSnapmirror or the values in /etc/snapmirror.conf. Don't forget that you can use wildcards in the -Location parameter to expand your query results. Also, nearly all Toolkit cmdlets have one or more examples in their online help, i.e. 'man Get-NaSnapmirror -Examples'.
Here is what I have so far. I am stuck trying to get the results of this script in the body of the e-mail I am sending at the end of the script. I can get it to output the results to the screen, but not in the body of the email. Can someone tell me what I am doing wrong. I am pretty new to PS so I am assuming I am missing something obvious. I tried using Write-Output in the loop, but I couldn't get that to work either.