export public shares
Is there a way to export the list of public shares? I have a few that are invalid from users changing folder names and would like to present a list to them to clean up.
thanks.
-
I wrote PS code to get it. this gives you a CSV with the results and if the path is still valid (from the server side of things).
[xml]$file = get-content 'c:\software\user_shared_files.xml'
$newarray = @()foreach ($node in $file.cerberus.filelist.file)
{
$exist = Test-Path $node.localpath$outputobject = new-object psobject
$outputobject | add-member -membertype NoteProperty -name "sharedby" -value $node.sharedby
$outputobject | add-member -membertype NoteProperty -name "guid" -value $node.guid
$outputobject | add-member -membertype NoteProperty -name "localpath" -value $node.localpath
$outputobject | add-member -membertype NoteProperty -name "shareddate" -value $node.shareddate
$outputobject | add-member -membertype NoteProperty -name "shareduntil" -value $node.shareduntildate
$outputobject | add-member -membertype NoteProperty -name "IsValid" -Value $exist
# enable to display on screen
#$node.sharedby
#$node.guid
#$node.localpath
#$node.remotepath
#$node.shareddate
#$node.shareduntil$newarray +=$outputobject
}
$newarray |export-csv "c:\software\shared_folders.csv" -notypeinformation1
Please sign in to leave a comment.
Comments
1 comment