- Community Home
- >
- Storage
- >
- HPE Nimble Storage
- >
- Array Performance and Data Protection
- >
- Powershell script to sell all Snapshot
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2017 11:39 AM
06-09-2017 11:39 AM
I want to use powershell to list all snapshot beginning by Ncss on all volumes
I can't find how to do it for all volumes but I am able to do it for one volumes with this command
Get-NSSnapshot -vol_name "NMBL-DBEX-SIEGESOCIAL" | where {$_.name -match "NSs"}
Is it possible to achieve my goal
thanks
Solved! Go to Solution.
- Tags:
- powershell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2017 12:42 PM
06-09-2017 12:42 PM
Re: Powershell script to sell all Snapshot
Hello Francois,
There are several ways to script this. Here is an example, where we first get volumes, and then pass the output through a foreach loop. In the sample below, I am focusing on volumes that have 2017-06-09 in the snapshot name.
Dianne
Sample script |
---|
Connect-NSGroup -Credential $nm_cred -group $nsarray $volname = Get-NSVolume | Select-Object -Property "name" $snaplist = @() foreach ($name in $volname) { $res = Get-NSSnapshot -vol_name $name.name | where { $_.name -like "*2017-06-09*" } | select name, id $snaplist += $res } Write-Output $snaplist |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2017 12:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2017 01:06 PM
06-09-2017 01:06 PM
Re: Powershell script to sell all Snapshot
thanks it is working!! If I could put 2 solutions as the correct answer you will be marked as that too
thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2017 01:07 PM
06-09-2017 01:07 PM
Re: Powershell script to sell all Snapshot
Thanks also working!!!
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP