SOAP - How to get list of Virtual Directories for a user?

Comments

2 comments

  • Official comment
    Avatar
    Vincent Drake

    You will have to access the directories assigned to the user explicitly as well as those assigned to groups the user is a member of.

    `GetUserInformation` returns a user object having a `rootList` property representing all of the virtual directories directly assigned to the user.

    Here is a code-snippet that assumes you have have dot-sourced Example-UserManipulation.ps1 from our examples:

    PS > $getUserRequest.userName = "loadtest"
    PS > $getUserResp = $CerberusSvc.GetUserInformation($getUserRequest)
    PS > $getUserResp.UserInformation.rootList

    name    path       permissions
    ----    ----       -----------
    ftproot c:\ftproot CerberusFtp.DirectoryPermissions
    nodl    c:\ftproot CerberusFtp.DirectoryPermissions

    Then examine the groups the user is a member of for more virtual directories they have access to:

    PS > $getUserResp.UserInformation.groupList

    name
    ----
    SimpleDirModeDisabled_anotherroot

    PS > $getGroupRequest.name = "SimpleDirModeDisabled_anotherroot"
    PS > $getGroupResp = $CerberusSvc.GetGroupInformation($getGroupRequest)
    PS > $getGroupResp.group.rootList

    name path permissions
    ---- ---- -----------
    c    c    CerberusFtp.DirectoryPermissions

     

    Comment actions Permalink
  • Avatar
    Artur Sobczyk

    Thank you! Just tried and it works perfectly.

    I have no idea how I have missed this.

    0
    Comment actions Permalink

Please sign in to leave a comment.