0
votes

On Windows 7 I run the following Powershell script to start an FTP Site, however I encounter the following error

Start-Website : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) At C:\MyFolder\StartFTPSite.ps1:5 char:16 + Start-WebSite <<<< -Name "My LocalFTP Site" + CategoryInfo : InvalidData: (IIS:\sites\My LocalFTP Site:String) [Start-Website], UnauthorizedAccessException + FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provider.StartWebsiteCommand

Here is the PowerShell script:

Clear-Host  
StartWindowsService -svcDisplayName "Microsoft FTP Service"  
Import-Module WebAdministration  
Start-WebSite -Name "My LocalFTP Site"
1
How did you do to put the code in a nice gray box like that? - Polymerase
There is a code formatting button on the toolbar of the WYSIWYG editor (looks like "{}"). But the simple wiki formatting is at least 4 spaces indentation with a blank line before the block of code. - JasonMArcher

1 Answers

0
votes

Be default windows 7 will start powershell under restricted access uac account. right click on the powershell icon and say run as administrator and see if that fixes your problem.