I have a DFS UNC path \\rootxx\xx\xx\
which leads to a file in a remote server ,how can i retrieve the server name , where the file resides using perl.
Asked
Active
Viewed 1,151 times
-4

ninja
- 29
- 7
-
[`NetDfsGetInfo`](https://msdn.microsoft.com/en-us/library/windows/desktop/bb524812.aspx)? `NetDfsGetInfo` seems to have been made available by [Win32::Lanman](http://search.cpan.org/perldoc?Win32::Lanman). – ikegami Jul 01 '17 at 05:22
-
@ikegami : NetDfsGetInfo cmdlet is not recognized and can't download it as well , is it by default working in your powershell or did you install it from some repository – ninja Jul 01 '17 at 06:00
-
@LotPings : no it is not a duplicate , DFS stands for distributed file system and `rootxx` is not the server name , the path leads to a file which is another server – ninja Jul 01 '17 at 06:38
-
@LotPings : did you down vote ?if you did read the question carefully and study whats DFS – ninja Jul 01 '17 at 06:53
-
cmdlet? I linked to a system call and a Perl module – ikegami Jul 01 '17 at 09:05
1 Answers
1
Only a minute of gooogling gives some links
dfsutil link <dfsfolder>
If you by any chance have the option to use powershell v3+ you can use
Get-DfsnFoldertarget <dfs folder> | select targetpath
If you want a list of Shares that are linked to a DFS path then try:
Get-WmiObject -Class Win32_DFSTarget|
Where {$_.LinkName -like "\\Domain\DFS\Folder"}|
Select @{n='Path';e={"\\{0}\{1}" -f $_.ServerName,$_.ShareName}}
-
I tried all those commands and they were not recognized as internal or external command , so i posted the question with just two tags perl and cmd and then you asked me to include powershell , and ok how can i execute this command , i don't think it is possible to download cmdlets – ninja Jul 01 '17 at 07:11
-
If you have access to a distributed file system, you should also have access to one of your administrators who can provide details of the dfs utils/cmdlets. – Jul 01 '17 at 07:50
-
Soon that doesn't matter any more, I already removed the comment but there are 3 other close votes for your question. – Jul 01 '17 at 11:19
-
Seriously? I think it's lack of information first hand and your ahem childish behavior getting you such a response. Are you burning your 11 days old profile intentionally? – Jul 01 '17 at 11:33