Our environment is in the process of removing a bunch of Windows 2003 servers, and in an attempt to pull permissions on shares that exist, I've been trying to come up with a solution to script it out.
The kicker to this however is that WMI is not working on these servers, so I cannot do a GWMI Win32_Share. Given the age of the servers as well, more modern powershell commands do not work.
What I can do, is a Get-ACL, however I need to provide the paths for the shares. The only way I can see to getting the full paths for the shares is through Net Share or a Get-ItemProperty HKLM , of which I've had no luck.
If anyone smarter than I out there knows a way to parse out just the "resources" column of a net share, you'd be doing me a huge favor.
You can probably achieve the desired result with a bit of regex
Powershell V1 compatible
Powershell 3.0+
On powershell 5.1 you can use
ConvertFrom-Stringwith "training" data. It can be real sample data or generic. It may take some adjusting for your specific environment but this worked well in testing.Any output shown should now be contained in the variable
$ShareListYou could also use psexec to get the information remotely and apply either proposed solution.
or