I would like to build an InfoPath form that users can use to request a new Active Directory account (e.g. for a new employee). Once the form is submitted, I would like it to then run a PowerShell script using the supplied values from the form as parameters to the script. The script will create a new Active Directory user using these values.
I can run a PowerShell script from a C# application by importing the System.Management.Automation assembly (example), and while I could add the users directly through C# with System.DirectoryServices, our requirement is to have several forms that collect different information which are passed to specific scripts that are managed by our IT department (the adding users script for example would perform some other tasks beyond simply creating the user and IT would like control over this). I understand that the PowerShell script would somehow have to be run as a user with rights to add users in the domain.
I have no experience with InfoPath. Can InfoPath call PowerShell scripts using the information that was submitted?