$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
The Citrix ShareFile Sync application is quite limited in functionality, one of those limitations is that you can only synchronize to a single (one) local folder.
As Helge Klein wrote in his excellent article "Configuring Citrix ShareFile Sync from PowerShell" this is simply a GUI restriction and not a restriction in the actual ShareFile sync engine.
Helge describes that you can easily do this in PowerShell with the following example:
1 2 3 | Add-SyncJob -ApplicationId 1 -ApplicationName "PowerShell" -Account helgeklein.sharefile.com -RemoteFolderName "foc86c19-d904-434a-9d67-xxxxxxxxxxxx" -LocalFolderPath "D:\Daten\Sync to ShareFile" -AuthType 4 -UserName xxxxxx@helgeklein.com -SyncDirection 2 -Password "MY SHAREFILE PASSWORD" |
While the command was accepted, nothing was synchronized.
I then created a Sync job with the Gui and noticed it had a different value for Authentication Type:
1 2 3 4 5 6 7 8 9 10 11 | Id : 3 Account : mydomain.sharefile.com FolderId : foh4e8f2-0fd2-42ae-a435-xxxxxxxxxxxx User : remko@mydomain.com DeviceId : LocalFolderPath : C:\Users\Remko\ShareFile\My Files & Folders Application : SFSyncEngine.SyncApp Mode : Bidirectional Persist : True AuthenticationType : ShareFile CachedJobState : Idle |
Notice that the AuthenticationType is not listed as an Integer but with it’s name. The job that I added however had AuthenticationType 4 while I expected oauth_sharefile as per Helge’s article.
Let’s use PowerShell to tell us what the possible values are for AuthenticationType:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Import SF Sync Engine Module Import-Module 'C:\Program Files\Citrix\ShareFile\Sync\SFSyncEngine.dll' # Get All Syncjobs, assuming there's at least one $anyJob = (Get-SyncJobs -All)[0] # this doesn't work '| select -First 1 # Get the type (SFSyncEngine.AuthenticationType) $type = $anyJob.AuthenticationType.GetType() # list to store the enum names and values $list = @() # Get enum names and their value and add them to the list $type.GetEnumNames() | % { $item = "" | select name, value; $item.name = $_ ; $item.value = $type::$_.value__ ; $list += $item } # show the list $list | Format-List |
Here’s the output:
1 2 3 4 5 6 | name value ---- ----- ShareFile 0 Saml 1 WinAD 2 WinSso 3 |
As you can see there is no value 4! Perhaps Helge used an older version of the Sharefile Windows Client or the Enterprise version. Shame on the developers though for documenting so badly and breaking stuff between versions and editions.
This is also shows two design principles of a REST API (which is what lies under the PowerShell commands) that I dislike:
This means that there’s little type safety and that input validation is often lacking.
To complete this post let’s do the same trick for SyncDirection which type is
1 2 3 4 5 | name value ---- ----- UploadOnly 0 DownloadOnly 1 Bidirectional 2 |
I changed the AuthType param to 0 and now my folder is synchronizing.
Happy synching!
Leave a reply