This the type of situation where having a well planned and maintained backup strategy really pays off. If that's the case at your company, use it.
What you did is a poor way to save space. Consider the following use case:
- User copies files from Deptx share in preparation to do work on them
- You toss her copies and create symlinks to the origins
- She modifies the originals which were still required by others for their work
- ...
If you're that storage poor, it's best to draft a business plan for the purchase of additional storage. Ideally a solution that supports block level deduplication. If your existing appliance offers deduplication you could have submitted a change request for approval to implement it - but that time is passed.
A note for the future. As a storage admin you need to inform business when it's time to expand storage, which is usually when it's about half full. When it's 70% full you can start pulling the fire alarm daily until they assign budget. If that doesn't happen it's time to inform them in a very frank meeting that they're risking the business. Data is the core of modern business.
You can identify all of the symlinks with:
C:\Users\user>dir /AL /S C:\ | find "SYMLINK"
07/14/2009 01:08 AM <SYMLINKD> All Users [C:\ProgramData]
# Only one result in on my Windows 7 host, and it's a system default.
# There are likely more in Windows Server OSs.
# Cmd Explained:
# /AL A Lists file with attribute:L (Symlinks and dir junctions)
# /S Do recursively
# C:\ Drive to scan
'All Users' is the symlink 'C:\Users\All Users', which targets 'C:\ProgramData'. Note that the output of the above command does not give the full path to the symlink, which you need.
<<< STOP >>> If the number of symlinks is fewer than a thousand, it may be worth strongly considering manually replacing them with their target files.
You could use NTFSLinksView. It appears to be able to export data which includes the full target and symlink paths. http://www.nirsoft.net/utils/ntfs_links_view.html
Once you have these values, you can loop through them with this bit of Powershell. Modify the delim to whatever the program outputs. The example sets spaces as the delimiter. If it uses commas, then use: ','. Make sure the cvs has only the Link and Target data. In that order.
Note: This does not preserve default symlinks...
Import-CVS -Delim ' ' -Path input.cvs -Header Link,Target | ForEach-Object {
cmd /c rmdir $Link
Copy-Item $Target $Link
}
WARNING: This is untested and has potential to do even more damage... Use at own risk. If no prior backups exist, and you've arrived at this outcome, do a backup before going any further.