I'm getting ready to migrate a physical file server to our VM environment using VMware standalone converter. This file server has over 300 shares on it, so deleting all the shares and recreating them is not an option. I'd like to be able to disable access to each share during the migration. I can't simply turn off file sharing because VMware converter uses the service to do the P2V. Is there a way I can write a batch file to make the number of connections on each share 0?
Having just done something almost identical to this over the weekend, here's what I did.
On the Source server export: HKLM\SYSTEM\CurrentControlSet\Services\LanManServer\Shares On the Source server stop the Server service: sc stop Lanmanserver
Stopping lanmanserver will turn down all your shares.
Copy all our data over to the Target server.
On the Target server import the Shares registry values you exported. On the Target server restart the lanmanserver service and all your shares will repopulate.
I can think of a few ways to do this:
The method I'd recommend is just to firewall off all hosts but the ones that are needed for VMware converter to do its thing. Simple enough, and easy to reverse once the P2V is complete.
Second, you could create a group with all of your users in it, and apply an inheratable ACL to the root of your volumes that denies them access to the files/directories.
The third option is to export your shares, delete them, run the migration, and then re-import. KB article 125996 explains how to do this.
I'd recommend at least giving the firewall option a try first, though, as that seems to be the least intrusive and gives the least opportunity for things to get messed up.
I'm doing tests right now and VMware Converter only uses file sharing to push their agent. My current process that is working in testing is: start the conversion dialog, push the agent, go in and disable file-sharing on the NIC, then proceed with the conversion. During the conversion the network shares are unavailable. After the conversion is complete boot the VM and activate file-sharing on the new VMware NIC.
Why not just remove the share with
net share xxxx /delete
. If you need to rollback, you can easily re-create usingnet share xxxx=path [options]
.