Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
You should install Windows File Services to use DirQuota cmdlet in Powershell. DirQuota Quota Add /Path:"$LogDir" /Limit:$FTPQuota Usage of $FTPQuota is like "100mb". You can use help to find out more. Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
First you need to clear default security settings to create your own settings. Clear-WebConfiguration -Filter /System.FtpServer/Security/Authorization -PSPath IIS: -Location "Default FTP Site/$FTPUserDir" As I said in earlier posts, $FTPUserDir is the name ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
Last post, We created a new ftp site on IIS7.5 with Powershell. Now we set security settings of FTP site with Powershell. Import-Module WebAdministration Add-WebConfiguration -Filter /System.FtpServer/Security/Authorization -Value (@{AccessType="Allow"; Users="$FTPUsername"; Permissions="Read, Write"}) -PSPath ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
It’s really easy to create new ftp web site on IIS7.5 with Powershell WebAdministration module. Import-Module WebAdministration New-Item IIS:\Sites\"Default FTP Site"\$FTPUserDir\$FTPUsername -Type VirtualDirectory -PhysicalPath "$LogDir" $FTPUserDir is the name of the Virtual Directory ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
I'll show you how to create a New Web site on IIS7.5 with a Powershell function. Function Create-WebSite { Param ($LogDir, $Description, $Domain) $Domain = $Domain.TrimStart("www.") New-Item IIS:\Sites\$Description -Bindings (@{Protocol="http";BindingInformation="*:80:$Domain"},@{Protocol="http";BindingInformation="*:80:www.$Domain"}) -PhysicalPath "$LogDir\http" } You can execute our ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
It's really easy to create new web site on IIS7.5 with Powershell WebAdministration module. Import-Module WebAdministration New-Item IIS:\Sites\$Description -Bindings (@{Protocol="http";BindingInformation="*:80:$Domain"},@{Protocol="http";BindingInformation="*:80:www.$Domain"}) -PhysicalPath "$LogDir\http" As you see, you can set Bindings with the same command. ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
After creating web site directories, you should set ACL settings of directories. Function Set-IISACL { Param ($Username, $LogDir) $Netbios = "FABRIKAM" $Account = New-Object System.Security.Principal.Ntaccount("$Netbios\$Username") $ACL = Get-Acl -Path "$LogDir" $ACL.SetAccessRuleProtection($True, $True) Set-Acl -Path "$LogDir" -AclObject $ACL $Permission ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
You can create default web site directories with a function on Powershell: Function Create-Directories { Param ($LogDir) New-Item "$LogDir" -Type Directory New-Item "$LogDir\db" -Type Directory New-Item "$LogDir\http" -Type Directory New-Item "$LogDir\http\bin" -Type Directory New-Item "$LogDir\http\stats" -Type Directory New-Item "$LogDir\http\upload" ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
You can assign a domain user called FABRIKAM\user_yusufozturk.info to a directory with Powershell: $LogDir = "C:\inetpub\yusufozturk" $Account = New-Object System.Security.Principal.Ntaccount("FABRIKAM\user_yusufozturk.info") $ACL = Get-Acl -Path "$LogDir" $ACL.SetAccessRuleProtection($True, $True) Set-Acl -Path "$LogDir" -AclObject $ACL $Permission = "$Account","Modify","ContainerInherit,ObjectInherit","None","Allow" $AccessRule ... Read more..Saturday, February 27th, 2010 Posted in Hosting & IIS7, Windows Powershell, Windows Server | No Comments »
You can assign a domain user called FABRIKAM\user_yusufozturk.info to a directory with Powershell: $LogDir = "C:\inetpub\yusufozturk" $Account = New-Object System.Security.Principal.Ntaccount("FABRIKAM\user_yusufozturk.info") $ACL = Get-Acl -Path "$LogDir" $ACL.SetAccessRuleProtection($True, $True) Set-Acl -Path "$LogDir" -AclObject $ACL $Permission = "$Account","ReadAndExecute","ContainerInherit,ObjectInherit","None","Allow" $AccessRule ... Read more..