Using Add-WebConfiguration to add properties to the FTP server
hi again,
i have examples on how integrate between powershell , ftp component using above cmdlet, configure properties of ftp below called <location path>. question is, if want reach parameter stored in <system.applicationhost> part of applicationhost.config file, how go doing that? example, have been trying update exit messages of ftp site (more fun sense..) cant working. supplied;
add-webconfiguration -filter "/system.applicationhost/sites/site[@name='myftpsite']/ftpserver/messages" -value @{exitmessage='work_baby'} -pspath iis:\ -location myftpsite
i not sure parameter location (it looks wrong)... more or less, know how reach / manipulate settings of ftp server if located in location path part of applicationhost.config file, if want set residing under <system.applicationhost> off track....
regards, sausage eater.
br4tt3
found better way should definetly work you...
btw why having same issues within same weeks?
[system.reflection.assembly]::loadwithpartialname("microsoft.web.administration") $iis = new-object microsoft.web.administration.servermanager $site = $iis.sites["mainftp"] $ftpserver = $site.getchildelement("ftpserver") $messages = $ftpserver.getchildelement("messages") #shows attributes $messages.attributes #shows attribute exitmessage $messages.attributes["exitmessage"] #shows value of exitmessage $messages.attributes["exitmessage"].value #sets value of exitmessage(and others) $messages.attributes["exitmessage"].value = "byebyebaby" #comits changes $iis.commitchanges()
Windows Server > Windows PowerShell
Comments
Post a Comment