From 7f69971e950709dda6c2c234267dd659b993c57d Mon Sep 17 00:00:00 2001 From: Chris Blyth Date: Thu, 1 Aug 2024 08:25:38 +0100 Subject: [PATCH] SetSiteConnectAs to SetSitePathWithConnectAs --- .../create-website/set-site-connect-as.md | 28 ------------------ .../set-site-path-with-connect-as.md | 29 +++++++++++++++++++ src/Scripts/createWebSite.ps1 | 3 +- 3 files changed, 31 insertions(+), 29 deletions(-) delete mode 100644 docs/powershell/create-website/set-site-connect-as.md create mode 100644 docs/powershell/create-website/set-site-path-with-connect-as.md diff --git a/docs/powershell/create-website/set-site-connect-as.md b/docs/powershell/create-website/set-site-connect-as.md deleted file mode 100644 index 485fe7b6..00000000 --- a/docs/powershell/create-website/set-site-connect-as.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: createWebsite.ps1 - SetSiteConnectAs -linkText: SetSiteConnectAs -description: Details about the SetSiteConnectAs function in createWebsite.ps1 helper script ---- - -# StartAppPool - -```PowerShell -{% raw %} -SetSiteConnectAs - [-name] - [-username] - [-password] -{% endraw %} -``` - -## Description - -Sets the site to connect to the file system as a dedicated user - -## Example - -```PowerShell -{% raw %} -SetSiteConnectAs -name "MySite" -username "MyUser" -password "5ecureP@ssw0rd -{% endraw %} -``` diff --git a/docs/powershell/create-website/set-site-path-with-connect-as.md b/docs/powershell/create-website/set-site-path-with-connect-as.md new file mode 100644 index 00000000..dc20516b --- /dev/null +++ b/docs/powershell/create-website/set-site-path-with-connect-as.md @@ -0,0 +1,29 @@ +--- +title: createWebsite.ps1 - SetSitePathWithConnectAs +linkText: SetSitePathWithConnectAs +description: Details about the SetSitePathWithConnectAs function in createWebsite.ps1 helper script +--- + +# StartAppPool + +```PowerShell +{% raw %} +SetSitePathWithConnectAs + [-name] + [-path] + [-username] + [-password] +{% endraw %} +``` + +## Description + +Sets the site physical path with connect as set to a dedicated user + +## Example + +```PowerShell +{% raw %} +SetSitePathWithConnectAs -name "MySite" -path "\\remoteshare\folder" -username "MyUser" -password "5ecureP@ssw0rd +{% endraw %} +``` diff --git a/src/Scripts/createWebSite.ps1 b/src/Scripts/createWebSite.ps1 index 2e8930ac..28ca961d 100644 --- a/src/Scripts/createWebSite.ps1 +++ b/src/Scripts/createWebSite.ps1 @@ -679,10 +679,11 @@ function SetAppPoolAlwaysRunning([string] $appPoolName) Set-ItemProperty IIS:\AppPools\$appPoolName processModel.idleTimeout "00:00:00" } -function SetSiteConnectAs([string] $name, [string] $userName, [string] $password) +function SetSitePathWithConnectAs([string] $name, [string]$path, [string] $userName, [string] $password) { Set-ItemProperty IIS:\Sites\$name -name userName -value $userName Set-ItemProperty IIS:\Sites\$name -name password -value $password + Set-ItemProperty IIS:\Sites\$name -name physicalPath -value $path } Write-Host "Ensconce - CreateWebsite Loaded"