2 Replies Latest reply on Mar 28, 2018 10:24 PM by jsaudan

    how to unregister bulk archives (older than n years) using batch script?

    Pradeepkumar

      how to unregister bulk archives (older than n years) using batch script.

        • Re: how to unregister bulk archives (older than n years) using batch script?
          Dan Fishman

          I would recommend taking at look at the MoveOldArchives.ps1 powershell script that can be found under program files (x86)\pipc\OSIsoft.Powershell\ExampleScripts

           

          If you take a look at the script, it unregisters the archives, moves them to a new location and then registers the archives again.  You could modify the script to not register the archives and not to move them.  Also, if you need a quick way, PI SMT allows you to select multiple archives and unregister in bulk. 

          5 of 5 people found this helpful
          • Re: how to unregister bulk archives (older than n years) using batch script?
            jsaudan

            Hi Pradeep,

             

            See Dan Fishman's reply above, he's exactly correct. You can either modify that PowerShell script to just unregister archives, or you can unregister archives in bulk in SMT by ctrl-clicking or shift-clicking the archives you want to unregister and then right clicking them and selecting "Unregister archive".

             

            I made a quick and dirty modification of the MoveOldArchives PowerShell script so that it would only unregister old archives rather than move and register them, which I've attached to this post (named UnregisterOldArchives.ps1). You can go ahead and give it a try, if you haven't already taken Dan's suggestion and modified it yourself (or used SMT).

             

            Hope that helps. And thanks Dan for your excellent solution!

             

            -Jacob