Posted in
Hosting & IIS7,
Windows Powershell |
1 Comment | 5,467 views | 16/12/2010 22:00
Powershell function to setting basic authentication for websites in IIS7.
1
2
3
4
5
6
7
| Function Set-UserPermissions
{
Param ($Description, $Username, $Password)
Set-ItemProperty IIS:\Sites\$Description -Name Username -Value "$Username"
Set-ItemProperty IIS:\Sites\$Description -Name Password -Value "$Password"
} |
Function Set-UserPermissions
{
Param ($Description, $Username, $Password)
Set-ItemProperty IIS:\Sites\$Description -Name Username -Value "$Username"
Set-ItemProperty IIS:\Sites\$Description -Name Password -Value "$Password"
}
Description is the name of website in IIS7.