Share via

Windows server Fileshare list

trong2001 21 Reputation points
2021-06-04T14:14:02.823+00:00

Hello so far I made a powershell script in a post that can record file shares and place them in a txt file from one server. Here is the powershell script: https://social.technet.microsoft.com/Forums/lync/en-US/bbb2ed06-2eef-461c-a777-f02f60b18495/script-list-ntfs-folders-permissions?forum=ITCG

My question is how would I go about updating the script so that it can scan multiple servers instead of just one? Any help is greatly appreciated.

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other

1 answer

Sort by: Most helpful
  1. Rich Matheisen 48,116 Reputation points
    2021-06-04T14:44:02.737+00:00

    You're using Get-WMIObject to collect the data and that cmdlet accepts an array of names of computers. You only need to load $fileServer with a list of names to gather the data. Your Get-ShareInfo function would have to get the computer name from each item in its "$shares" parameter and add that to the information you're storing in the hash.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.