Link to home
Start Free TrialLog in
Avatar of Travis Martinez
Travis MartinezFlag for United States of America

asked on

Citrix PowerShell Get Items Associated to User ID

I'm looking for a way to get files associated to an user ID that I've derived from a specific StorageZone for Citrix ShareFile.  At this point I've been able to get the list of user ID's but I'm having challenges finding any examples of getting the associated items to user ID.

I've plagiarized some code and have this so far:

Add-PSSnapIn ShareFile

$sfClient = Get-SfClient –Name "H:\unitedlex.sharefile.sfps"

$sfEmployees = Send-SFRequest -Client $sfClient -entity Accounts/Employees -expand "User,User/DefaultZone,User/Security"

$fileOutputEmployee =@()

foreach($sfEmployee in $sfEmployees) {
  $fileOutputEmployee += New-Object PSObject -Property @{'UserId'=$sfEmployee.User.Id; 'FullName'=$sfEmployee.User.FullName; 'Email'=$sfEmployee.User.Email; 'DefaultZoneId'=$sfEmployee.User.DefaultZone.Id; 'DefaultZoneName'=$sfEmployee.User.DefaultZone.Name; 'LastLoggedOn'=$sfEmployee.User.Security.LastAnyLogin}
}

$ShareFileUSEastEmployees = $fileOutputEmployee | where DefaultZoneName -Like "ShareFile US East"

$EmployeeID = foreach($ShareFileUSEastEmployee in $ShareFileUSEastEmployees) {
    Send-SfRequest -Client $sfClient -Entity Users -Id $ShareFileUSEastEmployee.UserId | Select Id
    }

Now that I've got the list of user ID's associated to a specific zone; how do I then get the items associated to the ID?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.