mdavis332 / LimeSurvey-XML

PowerShell module for LimeSurvey's XML-RPC API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LimeSurvey-XML

PowerShell module for interacting with LimeSurvey's XML-RPC API

Issues and pull requests welcome!

Big thanks to Warren Frame for his many PowerShell posts and GitHub contributions that I used as templates and springboards.

Also thanks to Mooser Lee for his XMLRPC PowerShell module from which I borrowed heavily and modified for LimeSurvey's output.

Instructions

# One time setup
    # Download the repository
    # Unblock the zip
    # Extract the LimeSurvey-XML folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)

# Import the module.
    Import-Module LimeSurvey-XML

# Get commands in the module
    Get-Command -Module LimeSurvey-XML

Examples

Create a session

$SessionKey = New-LimeSession -BaseUri 'https://limesurvey.fqdn/limesurvey/index.php?r=admin/remotecontrol' -Credential (Get-Credential)

Query for participants on an existing Survey

# After creating a session...
Get-LimeParticipant -SurveyId '123456' -Session $SessionKey -BaseUri $ApiUrl

Add participants to existing Survey

# After creating a session...
# Create a participant email hash that contains hashes of each user's properties
$ParticipantEmailHash = @{ 'user1@host.com, @{ email = 'user1@host.com' }.
                           'user2@host.com, @{ firstname = 'user'; lastname = '2'; email = 'user2@host.com' }
                        }
Add-LimeParticipant -SurveyId '123456' -Session $SessionKey -BaseUri $ApiUrl -InputObject $ParticipantEmailHash

Release session key

# After creating a session...
Remove-LimeSession -BaseUri $ApiUrl -Session $SessionKey

About

PowerShell module for LimeSurvey's XML-RPC API

License:MIT License


Languages

Language:PowerShell 100.0%