I need to change the physical path of a web site through command line via the appcmd.exe tool which I want to point to Amazon FSx, but I can't figure out why I have errors. Here is what I'm using in PowerShell as admin:
PS C:\Windows\system32> appcmd list app
APP "Test Services/" (applicationPool:Test Services)
APP "Test Simple Site/" (applicationPool:Test Simple Site)
APP "Test/" (applicationPool:Test)
PS C:\Windows\system32> appcmd list vdir
VDIR "Test Services/" (physicalPath:\amznfsxthjfzxec.test.local\share\Sites\TestServices)
VDIR "Test Simple Site/" (physicalPath:\amznfsxthjfzxec.test.local\share\Sites\TestSimple)
VDIR "Test/" (physicalPath:C:\inetpub\wwwroot)
PS C:\Windows\system32> appcmd set site /site.name:"Test" /application[path='Test/'].virtualDirectory[path='Test/'].physicalPath:"\\amznfsxthjfzxec.test.local\share\Sites\Test"
ERROR ( message:Malformed collection indexer; format is [@position,name='value',name2='value2',...]. The @position specifier is optional, and be '@start', '@end', or '@N' where N is a numeric index into the collection. )
Could you please advise me? Thank you!
If you want to replace physical path for the virtual directory under site level.
Please try this
If you also have an application under my site like "mysite/myapplication" and the virtual dirtory is "mysite/myapplication/my virtual.
Then you could try this
Please remember to run cmd as adminsitrator when you try this.