I've found no way to automate the process you're looking for. What I did to retro fit my environment where
vscan was not requires was to do the following.
1) Connect to your filer using computer management, export a list of shares
2) Open the exported list in Excel, delete everything but the column of cifs shares (leave shares in column B for example)
3) In column A, enter 'cifs shares -change ' (be sure to include the space, you'll need it in the command)
4) In column C, enter '-novscan'
5) In column D, enter '=concatenate(A1,B1,C1) - this will put the entire command together (you can click the cells you want to select)
6) Copy column D, and paste special (values) into column E.
7) Open up a CLI to your filer, paste the content of column E
A | B | C | D | E |
cifs shares -change | share_name | -novscan | =concatenate(A1,B1,C1) | cifs shares -change share_name -novscan |
I would suggest that you try one or two to make sure that you've scripted it correctly...most common mistakes are the spaces required between the command.
Scott