试图通过powershell自动化IIS7.5上的ftp站点操作,但我无法启动ftp站点。到目前为止,其他的一切我都成功了。
PS IIS:\Sites> Get-ChildItem | Where {$_.Name -eq "FtpData"}
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
FtpData 3 Stopped D:\Services\_Empty ftp *:80:
PS IIS:\Sites> Start-WebSite -Name "FtpData"
Start-WebSite : The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8)
At line:1 char:1
+ Start-WebSite -Name "FtpData"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Website], COMException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provider.StartWebsiteCommand
这个问题是在使用PowerShell.IIS7.5在2008年R2启动/停止一个FTP站点中解决的,但已经有了三年的历史。
使用appcmd也存在相同的问题:
C:\Users\myself>c:\Windows\system32\inetsrv\appcmd start site FtpData
ERROR ( hresult:800710d8, message:Command execution failed.
The object identifier does not represent a valid object.
)
本文服务器核上IIS 7上的FTP指出从UI控制台启动它,但这意味着它不能被自动化。
有谁有办法解决这个问题吗?
发布于 2014-04-19 11:52:24
在Powershell自动完成中偶然发现了这一点,并最终在服务器2012 R2上工作:
$ftpSite = IIS:\Sites\FtpData
$ftpSite.ftpServer.Start()
发布于 2018-06-14 06:00:15
$ftpSite..。对我不起作用。我还发现下面的东西更整洁。
首先:
(get-Website -Name "myftpsite").ftpserver.start()
停止:
(get-Website -Name "myftpsite").ftpserver.stop()
来源:https://peter.hahndorf.eu/blog/iisftp.html (永久呼吸孤独的单词-彼得·哈恩多夫在软件IIS -用PowerShell管理FTP站点)
https://stackoverflow.com/questions/23015011
复制相似问题