Appcmd.exe是IIS7提供的一個管理站點的命令行工具,同時支持Ftp和Http的站點,功能還算強大,具體使用方法參考微軟網站。
我這里的例子主要配置一個Ftp站點,并且允許CcUser這個用戶對其目錄具備讀和寫的權限:

@echo offset cc_inbox_dir=c:/CC_Inboxset cc_outbox_dir=c:/CC_Outboxset appcmd_exe=%systemroot%/system32/inetsrv/appcmd.exeset ftp_siet_name=CC_Inbox::create cc inbox folder::rd /S /Q %cc_inbox_dir%IF NOT EXIST %cc_inbox_dir% (md %cc_inbox_dir%)::create cc outbox folder::rd /S /Q %cc_outbox_dir%IF NOT EXIST %cc_outbox_dir% (md %cc_outbox_dir%)::delete the ftp site and then make a new one. ID of the ftp site will be auto-generated.%appcmd_exe% delete site %ftp_siet_name%%appcmd_exe% add site /name:%ftp_siet_name% /bindings:ftp://*:21 /physicalpath:%cc_inbox_dir%::add virtual dir for cc outbox. Note there is "/' at the end of the app.name%appcmd_exe% add vdir /app.name:"%ftp_siet_name%/" /path:/outbox /physicalpath:%cc_outbox_dir%::config ftp authentication%appcmd_exe% set site %ftp_siet_name% -ftpServer.security.ssl.controlChannelPolicy:SslAllow -ftpServer.security.ssl.dataChannelPolicy:SslAllow -ftpServer.security.authentication.basicAuthentication.enabled:true::config ftp authorization to allow CcUser to read and write%appcmd_exe% set config %ftp_siet_name% -section:system.ftpServer/security/authorization /+"[accessType='Allow',users='CcUser',permissions='Read, Write']" /commit:apphost
新聞熱點
疑難解答