I'd like some assistance creating a batch file (or possibly powershell, but I haven't looked into that enough yet) that will automate some common tasks that I perform when I create a new website (the site name will be passed as an argument) The tasks are as follows (assuming domain name is example.com):
- Create username that is the sitename minus the TLD (example.com becomes example)
- Add this user to the group "Web Site Managers"
- Create directory C:\Sites\example.com with two folders, logs & www
- Add 2 sites, one for example.com and one for www.example.com
- Set example.com home directory to C:\Sites\example.com and set HTTP Redirect (301) to www.example.com
- Set home directory for www.example.com
- Set logging directory for both sites to be C:\Sites\example.com\logs
- Set .NET user [Network Service] to have full permissions on C:\Sites\example.com\www
- Create FTP virtual directory for the user (directory name equals user name) under the DefaultFTPSite with the FTP login directory being C:\Sites\example.com
If someone could also provide resources (lilnks, books, etc) on documentation that will help me achieve all of this, I would be as willing to award points as if they had written the script for me myself. This is a learning experience for me. Thanks in advance for all your help.