Skip to content

Instantly share code, notes, and snippets.

@jstrong013
Last active September 26, 2021 02:29
Show Gist options
  • Select an option

  • Save jstrong013/bcc736c79732fadbfea746abb0d00035 to your computer and use it in GitHub Desktop.

Select an option

Save jstrong013/bcc736c79732fadbfea746abb0d00035 to your computer and use it in GitHub Desktop.
Example code for how to create a ShareFile Employee account using PowerShell SDK
<# Answers the original question located on the ShareFile-PowerShell Repository Issues list (#66).
https://github.com/citrix/ShareFile-PowerShell/issues/66#issue-1001263931
#>
Add-PSSnapin ShareFile
$sfClient = New-SfClient -Name "$env:Temp\sfclient.sfps"
$sfEmployee = New-Object ShareFile.Api.Models.User
$sfEmployee.FirstName = 'First Name'
$sfEmployee.LastName = 'Last Name'
$sfEmployee.Email = 'employee@mydomain.com'
Send-SfRequest -Client $sfClient -Method POST -Entity Users/AccountUser -Body $sfEmployee
Remove-Item -Path "$env:Temp\sfclient.sfps" -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment