Dan Munns Posted October 1, 2020 Share Posted October 1, 2020 Hi, I am looking at ITOM to automate our user creation processes. I have looked at the Hornbill provided libraries but as we use a hybrid Azure AD setup, they don't look to be what we would need. We use the PShell command New-RemoteMailbox on our on prem exchange server to create the user and mailbox account as this creates the user on-prem AD account and mailbox as well as the associated mailbox in exchange on-line. As such I would need to be able to take PC answers from the request and use them as variables in a powershell script. I have looked on the wiki to no avail. Is this possible to do? Thanks, Dan Link to comment Share on other sites More sharing options...
Steve G Posted October 1, 2020 Share Posted October 1, 2020 Hi @Dan Munns, There are a couple of ways you could do this: You could write the answers into request custom fields, then pass the values through as input parameters to your package operation, reading them in the PowerShell and using however you need; In the PowerShell, you could make an API call to Hornbill to get the questions for the request you're processing, then extract and use the information from the response. You'd want to use the data::entityBrowseRecords2 API, something like this if you're using the HornbillAPI Module: Set-HB-Instance -Instance "yourinstance" -Key "yourapikey" Add-HB-Param "application" "com.hornbill.servicemanager" Add-HB-Param "entity" "Questions" Open-HB-Element "searchFilter" Add-HB-Param "column" "h_entity_ref" Add-HB-Param "value" $TheRequestReference Add-HB-Param "matchType" "exact" Close-HB-Element "searchFilter" $Questions = Invoke-HB-XMLMC "data" "entityBrowseRecords2" Let me know if you need anything else. Cheers, Steve Link to comment Share on other sites More sharing options...
Steve G Posted October 1, 2020 Share Posted October 1, 2020 @Dan Munns We've also got a task in our list to add a package to manage Exchange mailboxes, I'll make sure New-RemoteMailbox gets looked at. Cheers, Steve Link to comment Share on other sites More sharing options...
Dan Munns Posted October 1, 2020 Author Share Posted October 1, 2020 Thanks @Steve G Am I correct in thinking then that is would be like this, with the custom field variable being the &[global["flowcoderefs"]["resultRef"]["customFieldA"]] bit? Link to comment Share on other sites More sharing options...
Steve G Posted October 1, 2020 Share Posted October 1, 2020 @Dan Munns Yeah that's correct, so in your node that's starting a job against this package operation in workflow, you'd have that variable in the PSVariable input parameter. Link to comment Share on other sites More sharing options...
Dan Munns Posted October 1, 2020 Author Share Posted October 1, 2020 Thanks @Steve G I'll be back here when I break it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now