I need advice on how to implement a workflow for a Exchange/Ad script for a small I.T. staff to use.
I created a module which encompasses functions that will create Exchange mailboxes and associated AD accounts, with Group memberships along with AD fields. This module resides on the Exchange server itself and from the Exchanger server desktop, it works like a charm.
However, after completing this project, the I.T. helpdesk admin wants his users to be able to run it from either either local powershell console or from the Exchange management Tools Shell.
I installed the Exchange 2010 Exchange management tools but I am having some problems running commands. I can however remote to their Exchange server via ‘New-PSession’ with appropriate ‘connectionURI’ and ‘Authentication’ arguments.
But, I am not sure how to launch my script that resides on this server which then imports my module and does its thing with AD. I am fairly new to the ‘double-hop’ situation and not sure if that applies to this scenario.
So basically I have a controller script and module on exchange server and trying to run my controller script which imports my module and does its import from a CSV file that also resides on the server.
Controller Script -> Mandatory CSVFile parameter. Imports AD Module and imports Custom module which contains custom functions
Custom Module -> Functions in module will process CSV File and write output to the screen on status as well as a prompt to continue if it fails to validate the data.
Need to be able to invoke the controller script and specify the CSVFile.
Would I just create a session and then use invoke-command and reference the local controller script with the appropriate arguments?
Would it be better to use ‘Enter-pssession’ which would require enabling winrm on exchange. I am not sure of the security implications of that.
Any advice would be helpful.