I used aspnet_regiis successfully encrypted web.config file which running on windows 2003 server. However it doesn't work in IIS 7 on Windows 7/2008 server.
When I try to run the followng command in 64bit Windows 2008 server, it always shows the aspnet_regiis options help. The same thing is in windows 7 OS.
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\aspnet_regiis –pe “appSettings” –app “/ConnectionTest” –site 4
If I open Visual Studio 2008 command in windows 7 and run the following command, I got those. I use the site Id from iis manager.
aspnet_regiis –pe “appSettings” –app “/ConnectionTest” –site 4 Failed to resolve the site ID for '4' Failed!