Last active
September 26, 2021 02:29
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# 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