FTP - Get-WebConfiguration to retrieve details of users RRS feed

  • Question

  • User-2108767085 posted

    Hi ther

    I am using this command to set the users access on an FTP site

    Add-WebConfiguration "/system.ftpServer/security/authorization" -value @{accessType="Allow";roles="";permissions="Read,Write";users="*"} -PSPath IIS:\ -location $SiteName

    I want to be able to use Get-WebConfiguration to be able to retrieve what user/users have access and use an If /Else block to be able to add the users if they don't already exist. I cant seem to come up with the correct syntax to make this work??

    I can use this and it will get the users and their permissions:

    Get-WebConfiguration "/system.ftpserver/security/authorization" -Location $SiteName  | Foreach{$_.GetCollection() | Foreach {$_.Attributes | Format-Table name, value} }

    How do I format this to be able to get the actual users in an If /Else statement?

    Basically - If user already has access move on Else "Add-WebConfiguration....."



    Sunday, February 14, 2021 12:25 AM

All replies