CamFlyerCH / FileShareUtils

Powershell module to help with all file server tasks without using WMI
MIT License
12 stars 3 forks source link

[Request] Function that can get the DFS info behind a DFS UNC path #10

Open n3rdopolis opened 2 years ago

n3rdopolis commented 2 years ago

Hi

I see that you added support for enumerating shadow copies, that is pretty sweet. This allows a programmatic version of the "Previous Versions" tab.

I was wondering if maybe you can add it so there is a programmatic version of the DFS tab too? DFS shares in Windows allow 1 or more physical shares to back it, (screenshot example I found is not mine, but to illustrate the point) image

I found a sample here that wraps around the win32 function, and used it, but it would be pretty sweet to have this in this module too. https://social.technet.microsoft.com/Forums/en-US/26690c4b-fe84-4ae2-b06d-ecc01648d92c/get-dfs-server-name-and-local-path-from-unc-path?forum=winserverfiles

CamFlyerCH commented 9 months ago

I very much understand your wish to get this info. But this is more a client computer thing and FileShareUtils is more server / administration oriented.

On my job we actually have the same issue, that we like to collect Information about active DFS target for mapped drives on client computers. The targets should change by AD site, but it seams they sometimes don't change when the client changes the site (changing from LAN to VPN or back) without a reboot (or logoff / logon). We also would like that with the detected site (nltest /dsgetsite) Also the functions of the three buttons should be available .

If I dig into this, I will probably create a new repo. Goal is to have a script including all function that could be used on a Windows without any installation of a PS Module, Feature or application.

n3rdopolis commented 9 months ago

Sensible, although a good admin case for this could be: sometimes users report that a file (Especially Office files) on a DFSN share might be locked or something, and rather guess what server their workstation selected or checking on each one, enumerating the possible shares, and then Get-NetOpenFiles against all of the members is quicker.

(In theory I guess the dfsn module would also work too I guess...)