0

I have a vdir with a physicalPath that points to a file share. Setting the "userName" and "password" attributes to a user with access to that share in the vdir config section in applicationhost.config works fine, but the password is then in clear text.

I want this password encrypted in the applicationhost.config file.

The only option I've found is to use "appcmd.exe" to do this, but I am unable to get it to work in the obvious way:

appcmd.exe set vdir /vdir.name:"Default Web Site/img" /password:"ThePassword"

I get this error:

ERROR ( hresult:80090016, message:Failed to commit configuration changes. Keyset does not exist )

I have tried with an elevated cmd prompt, does nothing. Setting the other attributes, like userName, works fine.

Tormod Hystad
  • 2,345
  • 1
  • 19
  • 15
  • Usually that means the machine key is corrupt so that encryption failed. You will have to get that fixed. – Lex Li May 01 '15 at 10:20

1 Answers1

0

Try it like this:

appcmd.exe set vdir "Default Web Site/img" /username:user /password:password

Jamezor
  • 2,488
  • 3
  • 23
  • 16