<?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 script in General Discussion</title>
    <link>https://community.netapp.com/t5/General-Discussion/powershell-script/m-p/456464#M1610</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I am looking for a sample powershell script to login to the snapcenter server and run Get-SmBackup&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2024 21:05:31 GMT</pubDate>
    <dc:creator>Lionl</dc:creator>
    <dc:date>2024-11-06T21:05:31Z</dc:date>
    <item>
      <title>powershell script</title>
      <link>https://community.netapp.com/t5/General-Discussion/powershell-script/m-p/456464#M1610</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am looking for a sample powershell script to login to the snapcenter server and run Get-SmBackup&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 21:05:31 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/powershell-script/m-p/456464#M1610</guid>
      <dc:creator>Lionl</dc:creator>
      <dc:date>2024-11-06T21:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: powershell script</title>
      <link>https://community.netapp.com/t5/General-Discussion/powershell-script/m-p/456690#M1613</link>
      <description>&lt;P&gt;Hi Lion liao,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the sample script to connect to SnapCenter and run Get-SmBackup command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Define SnapCenter server and credentials&lt;BR /&gt;$SnapCenterServer = "&lt;A href="https://snapcenter:8146" target="_blank" rel="noopener"&gt;https://snapcenter:8146&lt;/A&gt;" # Replace with your SnapCenter server address&lt;BR /&gt;$Username = "demo\administrator" # Replace with your username&lt;BR /&gt;$Password = ConvertTo-SecureString "password@123" -AsPlainText -Force&lt;BR /&gt;$Credential = New-Object System.Management.Automation.PSCredential($Username, $Password)&lt;BR /&gt;&lt;BR /&gt;# Connect to the SnapCenter server&lt;BR /&gt;Write-Host "Connecting to SnapCenter Server: $SnapCenterServer..."&lt;BR /&gt;Open-SmConnection -SMSbaseurl $SnapCenterServer -Credential $Credential&lt;BR /&gt;&lt;BR /&gt;# Check if the connection was successful&lt;BR /&gt;if ($?) {&lt;BR /&gt;Write-Host "Connected to SnapCenter Server successfully."&lt;BR /&gt;# Get SnapCenter backups Write-Host "Fetching SnapCenter backups..."&lt;BR /&gt;$Backups = Get-SmBackup&lt;BR /&gt;&lt;BR /&gt;# Output backup details&lt;BR /&gt;if ($Backups) {&lt;BR /&gt;$Backups&lt;BR /&gt;} else {&lt;BR /&gt;Write-Host "No backups found."&lt;BR /&gt;}&lt;BR /&gt;} else {&lt;BR /&gt;Write-Host "Failed to connect to SnapCenter Server."&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output from my lab:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Connecting to SnapCenter Server: &lt;A href="https://sc.demo.netapp.com:8146" target="_blank" rel="noopener"&gt;https://&lt;/A&gt;snapcenter:8146...&lt;/P&gt;&lt;P&gt;Connected to SnapCenter Server successfully.&lt;BR /&gt;Fetching SnapCenter backups...&lt;BR /&gt;&lt;BR /&gt;BackupId BackupName BackupTime BackupType&lt;BR /&gt;-------- ---------- ---------- ----------&lt;BR /&gt;1 RG1_SQL1_11-18-2024_02.38.40.9407 11/18/2024 2:39:01 AM Full Backup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pravin Kumar&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 02:56:20 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/powershell-script/m-p/456690#M1613</guid>
      <dc:creator>PravinKumar</dc:creator>
      <dc:date>2024-11-18T02:56:20Z</dc:date>
    </item>
  </channel>
</rss>

