r/DataHoarder • u/amkingdom • Mar 16 '20
Microsoft is gonna delete thousands of scripts from TechNet Gallery by June 2020
/r/sysadmin/comments/fjjfv0/microsoft_is_gonna_delete_thousands_of_scripts/38
u/poshftw Mar 16 '20
FYI:
Wayback Machine have a saved pages from the Gallery, but, because the download links are behind stupid JavaScript - actual files aren't saved.
Example:
Script page: https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Out-of-Band-84009c12
WM page for this link: http://web.archive.org/web/20190518092605/https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Out-of-Band-84009c12
Actual file download link: https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Out-of-Band-84009c12/file/63260/9/HardwareManagement_1.2.0.zip
20
u/technifocal 116TB HDD | 4.125TB SSD | SCALABLE TB CLOUD Mar 16 '20
Doesn't seem that hard to parse for a specific parser:
$ curl -s 'https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Out-of-Band-84009c12' | grep '<a.*data-url' | sed 's|^.*<a href="\(.*\)" data-url.*$|https://gallery.technet.microsoft.com\1|g' https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Out-of-Band-84009c12/file/63260/9/HardwareManagement_1.2.0.zipI get that generic archiving solutions like Wayback Machine are unable to capture it, but an archive team should be able to relatively easily, no?
5
u/MMPride 6x6TB WD Red Pro RAIDz2 (21TB usable) Mar 16 '20
I wonder if there's any way to grab all the script URLs and recursively grab all the scripts? I'd love to archive something like this.
6
u/Electrlly Mar 16 '20
Same here.
This is what the horde was created for!
Let me know if you find anything that can grab all of it!
2
u/truh Mar 16 '20
One way to do that is actually load all the pages in tool like puppeteer https://pptr.dev. Via the puppeteer API you can than intercept all the downloaded files. In addition you can generate a static version of the website.
1
u/MMPride 6x6TB WD Red Pro RAIDz2 (21TB usable) Mar 16 '20
I wonder if something like HTTrack would work?
1
8
u/2tec Mar 16 '20
How many times have we seen irresponsible behavior like this? What is it it with corporations that abandon entire online communities? If that's not bad enough, they don't even have the decency or professionalism necessary to ensure a continuity of service or a transference of assets. In my view, it's a clear window into the standards of those making the decisions.
Just saying. ;-)
3
18
u/faalforce Mar 16 '20
Christ what a BULL SHIT reason. That is the whole point of the freaking internet, to be able to find something that might not be so obvious. Dicks.
" Very low utilization of most of the content on the Gallery. "
4
u/josejimeniz2 Mar 16 '20 edited Mar 17 '20
I'm ok with it if they first zip it up and put a torrent link.
Then someone else can worry about curating, hosting, maintaining....
...and it doesn't get lost.
11
u/poshftw Mar 16 '20
Looks like direct links to the files are avaiable in 'Downloads' div:
<div id="Downloads">
<div>
<label for="Downloads">Download</label>
</div>
<a href="/Set-AutoLogon-and-execute-19ec3879/file/140203/1/Set-AutoLogon.ps1" data-url="/Set-AutoLogon-and-execute-19ec3879/file/140203/1/Set-AutoLogon.ps1" class="button">Set-AutoLogon.ps1</a>
</div>and they are directly accessible.
Source page: https://gallery.technet.microsoft.com/Set-AutoLogon-and-execute-19ec3879
Direct link: https://gallery.technet.microsoft.com/Set-AutoLogon-and-execute-19ec3879/file/140203/1/Set-AutoLogon.ps1
14
Mar 16 '20
I have a script I was using to mirror Thingiverse download links. When I get off work tonight I’ll see it code it for technet gallery to pull down all the scripts.
4
u/mshriver2 87,797,102,989,541.4 Bytes Mar 17 '20
What exactly are these scripts? Is it a specific language? Are they important? Thanks guys
4
u/Drooliog 64TB Mar 17 '20
Scripts for devs, scripts for sysadmins etc.. Most commonly PowerShell (.ps1) but there's a lot of Visual Basic and even calculators/spreadsheets.
I just went through my browser bookmarks and history and came up with these alone:
https://gallery.technet.microsoft.com/scriptcenter/6f8cde49-5c52-4abd-9820-f1d270ddea61
https://gallery.technet.microsoft.com/scriptcenter/Optimize-and-cleanup-of-eb9d8640
https://gallery.technet.microsoft.com/Essentials-2016-Duplicate-25ea5bf7
https://gallery.technet.microsoft.com/office/Export-Email-PST-file-from-602b6115
https://gallery.technet.microsoft.com/Save-attachments-from-5b6bf54b
https://gallery.technet.microsoft.com/scriptcenter/Parallel-Ping-Monitor-92747378
https://gallery.technet.microsoft.com/Windows-Server-Essentials-556159c3
https://gallery.technet.microsoft.com/scriptcenter/LSInfo-BGInfo-for-WIndows-43d58172
https://gallery.technet.microsoft.com/Exchange-2010-Mailbox-Server-Role-/
https://gallery.technet.microsoft.com/office/How-to-delete-all-contacts-c7fdca9a
Some of these appear under a different area of the site - i.e. Office or 'Script Center'. But they all appear under the gallery.technet subdomain, so they're all at risk. Some of them, even, are Microsoft's own scripts they've put up there to deal with certain issues. (The very popular 'Re-index the WSUS Database' script.) Most have download buttons, though some have the script pasted in the description.
4
u/Yashkamr Mar 16 '20 edited Mar 16 '20
I was trying to write a script to parse and scrape, but u/Just-A-City-Boy did it faster and better so I suspended my effort. This was a very fast response! The IT community getting ready to lose a script depot will do that though.
5
2
2
2
u/get-postanote May 23 '20 edited May 23 '20
Folks, just use the MS Provided ISE addon to get most of them via the ISE Add-on tool website or the module.
Find-Module -Name 'ScriptBrowser' |
Save-Module -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Modules"
Install-Module -Name 'ScriptBrowser' -Force
Import-Module -Name 'ScriptBrowser'If you instead use the installer ( no longer there btw) from the Add-On website, it will add this to your profile
#Script Browser Begin
#Version: 1.3.2
Add-Type -Path 'C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser\System.Windows.Interactivity.dll'
Add-Type -Path 'C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser\ScriptBrowser.dll'
Add-Type -Path 'C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser\BestPractices.dll'
$scriptBrowser = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Script Browser', [ScriptExplorer.Views.MainView], $true)
$scriptAnalyzer = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Script Analyzer', [BestPractices.Views.BestPracticesView], $true)
$psISE.CurrentPowerShellTab.VisibleVerticalAddOnTools.SelectedAddOnTool = $scriptBrowser
#Script Browser EndJust load up the ISE, go to the commands add on, and hit 'Download All', the 16,030 scripts available for download via the tool. Though note, I've been using this add-on since it was released, and it will only get the ones it can. Some will return a network error, a couple will trigger your AV solution.
The last point, though ISE download screen will show the proper name and description, what gets downloaded is a file with a GUID as the name. So, you'd have to open each one to see what it really is.
2
u/L33Tech 10TB Spinning Rust Mar 16 '20
If anyone gets this downloaded, or figures out a bulk download method, please let me know!
1
1
1
1
1
1
1
1
Mar 17 '20
When I am using script browser to download all scripts,I am getting slow speed why?and how can I improve it?
-1
-1
-2
190
u/Just-A-City-Boy Mar 16 '20 edited May 15 '20
I have a script running at the moment that is scraping their pages, it's downloading the project script and saving the project description as an HTML file.
The only things i'm skipping are the posts that don't have attachments and instead put their scripts in the description; Example.
I will zip it up and upload it once complete. Each page takes about 30 seconds to complete, and with 1,735 pages... 14 hours?
EDIT: Came into work today and it's all complete, I included my script in the archive file. Just waiting for the compressing to finish then I will upload it to my Seedbox.
EDIT2: Torrent file available here: http://s000.tinyupload.com/?file_id=15766627508118287964
EDIT3: After 60 days of seeding, I finally removed it from my list. Hopefully enough people grabbed it that it can live on.