When we want to change configurations for site, we usualy use appcmd.exe to handle it. However when website name contains blank, it will throw an error like below.
C:\>%windir%\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /[name='Default Web Site'].logFile.logExtFileFlags:Date,Time,ClientIP,UserName,ServerIP,Method,UriStem,UriQuery,TimeTaken,HttpStatus,Win32Status,ServerPort,UserAgent,HttpSubStatus,Referer,BytesRecv,BytesSent
Failed to process input: The parameter 'Site'].logFile.logExtFileFlags:Date,Time,ClientIP,UserName,ServerIP,Method,UriStem,UriQuery,TimeTaken,HttpStatus,Win32Status,ServerPort,UserAgent,HttpSubStatus,Referer,BytesRecv,BytesSent' must begin with a / or - (HRESULT=80070057).
So how to handle it?
We should use ‘%20’ replace blank in name. For example, use ‘Exchange%20Back%20End’ instead of ‘Exchange Back End’.
%windir%\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /[name='Exchange%20Back%20End'].logFile.logExtFileFlags:Date,Time,ClientIP,UserName,ServerIP,Method,UriStem,UriQuery,TimeTaken,HttpStatus,Win32Status,ServerPort,UserAgent,HttpSubStatus,Referer,BytesRecv,BytesSent
文档信息
- 本文作者:Robin Chen
- 本文链接:https://crushonme.github.io/2021/01/19/How-to-use-APPCMD-change-configurations-for-site-which-name-contains-blank/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享4.0许可证)
Document Information
- Author :Robin Chen
- Link : https://crushonme.github.io/2021/01/19/How-to-use-APPCMD-change-configurations-for-site-which-name-contains-blank/
- Copyright:Attribution-NonCommercial-NoDerivatives-No additional restrictions(CC BY-NC-ND 4.0)