I am trying to resolve a problem with ‘File History’ on a Windows 10 LAN network.
I had been using Backup to save copies of certain files in various drives and folders on all my PCs on a NAS (Drobo5N2). I had been using the advanced options in the file history section of the control panel to remove old file copies. This appears to have been stopped by Microsoft.
So as I am trying to learn PowerShell 5.1 and 7.2.6 I thought I might be able to delete the old files meeting the criteria I want using PowerShell.
The problem, all the different PCs use a mapped network drive to access their share on the NAS but could be using different drive letters and certainly different shares on the NAS.
So how can I access the mapped drives to run the deletion of the older files in the different folders that are being backed up?
If the remote PC uses a local drive to save the file history I can do the deletions but how do I do it on the NAS shares?
If the network drives are mapped you can access them by their drive letter!? But you have to run the code in the context of the user who mapped the drives. … or did I miss something?
You can get a list of all available drives with the cmdlet
No you did not miss anything. The mapping of the File History folder as a network attached drive is done by the NAS (Drobo5N2) dashboard, which is why when I try your excellent comment that Get-PSDrive, shows the network attached drives, but NOT the ones mapped by the dashboard. Is this what you meant by “context of the user”?
Hmmm … unfortunately I don’t know Drobo5N2. But if you have to install some software to be able to use those mapped drives I would not expect PowerShell to able to use it out of the box.
If you have any Windows OS and you want to share some folders for others it will help you. But most NASes I know of use Linux as OS. So I’m not sure if this will help you in your case.
Thanks again for your reply. When I open File Explorer on a machine running Windows 10 it lists all the shares on the Drobo5N2 with their assigned drive letter in the format
VBXWA1 (Drobo5N2) (F:) where VBXWA1 is the name of the share on the Drobo, (Drobo5N2) is the NAS, and (F:) is the drive letter assigned. Thereafter using file Explorer I can open the share by clicking the entry and it will show me the contents of the share. I can write to the share, using copy ( or similar method).
I have tried using NET USE T \Drobo5N2\VBXWA1 vbxwa1 from a command prompt on the PC named as VBXWA1 but it does not recognise the Drobo as a server.
How did you mapp those shares to their drive letter? If you do net see them with Get-PSDrive I’d suspect that you use some kind of API for the Explorer to see them. But you might not be able to access them outside of the Explorer.
The mechanism is via the Drobo dashboard. You identify the share you want to access and select the drive letter you want to use. The dashboard then creates the entry in the file explorer list of drives.
It is software provided by Drobo and is essential to operating the Drobo NAS.
I have asked the Drobo help centre for information on any software they have which would do the work that I require in the absence of any hope of support from Microsoft. I also asked if they had a way to access the shares on the Drobo using PowerShell but that is a faint hope.
I am sure there is a way to access the Drobo but they may be unwilling to release any proprietary information. Microsoft have a way to write to the share/s as the output from the Backup can be directed to a share. The missing connection is just that a missing connection.
I have noted from the Drobo Community that there rumours that Drobo is in trouble and may not reply to my questions. But I think that I will call this thread closed marking your get-psdrive as the solution. Thanks again