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.
Windows server Fileshare list
trong2001
21
Reputation points
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.