Help to Format the output [Answered]RSS

2 replies

Last post Apr 22, 2019 10:02 AM by Jalpa Panchal

  • Help to Format the output

    Apr 20, 2019 03:00 PM|Manusan|LINK

    Hi ,

    Trying to get the user name alone for FTP authorization rules using below command, Please help to format the data.

    Get-WebConfiguration -filter /system.ftpserver/security/authorization -Location MYFTP -PSPath 'MACHINE/WEBROOT/APPHOST' | Foreach{$_.GetCollection() | Foreach {$_.Attributes | select name, value }}

    PS Output 

    Name Value
    ---- -----
    accessType 0
    users ftptest1
    roles
    permissions 3
    accessType 0
    users
    roles
    permissions 3
    accessType 0
    users ftpuser2
    roles
    permissions 3

    Expected Output 

    ftptest1

    ftpuser2

  • Re: Help to Format the output

    Apr 20, 2019 03:40 PM|lextm|LINK

    Lex Li
    https://lextudio.com
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Help to Format the output

    Apr 22, 2019 10:02 AM|Jalpa Panchal|LINK

    Hi Manoj,

    You could try below command:

    Get-WebConfiguration -filter /system.ftpserver/security/authorization -Location TestForFtp | Foreach{$_.GetCollection() | Foreach {$_.Attributes | select Name ,value}} | where {$_.Name -eq "users"}

    Regards,

    Jalpa.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.