AndyGilly Posted March 16, 2021 Posted March 16, 2021 Hi we creating a script that returns a list of AD groups a user is a member of. The script writes the list of groups as an array & it writes the console fine It will not write to the output variable in the ITOM UI. Is there a way i can check if this is just UI limitations or the variable is actually blank? Are there limitations of the String output parameter type ?? thanks Andy
Ricky Posted March 16, 2021 Posted March 16, 2021 Hi @AndyGilly, it looks like you are attempting to store the output of an array into a string, Hornbill variable types currently do not support the use of arrays. In order to store the content of an array into a variable you would need to store each element into a separate variable or concatenate each element into a single string. Regards, Ricky
AndyGilly Posted March 16, 2021 Author Posted March 16, 2021 Hi @Ricky apologies, the script does write the array output to a single output variable, i just dont get to see it in the output value, hopefully the screenshots make sense thanks Andy
Ricky Posted March 16, 2021 Posted March 16, 2021 @AndyGillyCan you confirm that the string you are attempting to store in a variable has the following format? {{SISJobOutputParamenterStart:MoverADGroups}} ... <some text> ... {{SISJobOutputParamenterEnd}} Ricky
AndyGilly Posted March 16, 2021 Author Posted March 16, 2021 @Ricky Write-Output "Mover Output: $output" "{{SISJobOutputParameterStart:MoverADGroups}}$output{{SISJobOutputParameterEnd}}" is the bottom of the script thanks Andy
Steve G Posted March 16, 2021 Posted March 16, 2021 Hi @AndyGilly, The preferred method to do what you need is: Write-Output "{{SISJobOutputParameterStart:MoverADGroups}}$($output){{SISJobOutputParameterEnd}}" Note the use of a subexpression $($output), this will ensure your variable is printed as you would expect, in the event it's not of type string. Cheers, Steve
AndyGilly Posted March 17, 2021 Author Posted March 17, 2021 Morning @Steve G, @Ricky i have updated as above but still get blank in the Value variable of the UI although the monitor is showing that the output variable has the required information in it thanks Andy
Ricky Posted March 17, 2021 Posted March 17, 2021 Hi @AndyGilly, Looks like your output is in the correct format, however I am unable to verify that as I cannot view the entire string. Could you post the entire string so that I can ensure that format is correct, and run a test in-house. Thanks, Ricky
AndyGilly Posted March 17, 2021 Author Posted March 17, 2021 Hi @Ricky here you go, thanks Andy {{SISJobOutputParameterStart:MoverADGroups}}OC-P2000 OC-HR-INDUCTION OC-C&R NA-PROCANDTRAIN NA-PEOPLE-SUNDAYTIMES NA-PEOPLE-MI NA-PEOPLE Debbie Wood - W2B (WCMS) Vacancy Edit (Rep) Trent Training (QlikView) MI People (O365) Teams Direct Routing (O365) Forms (Internet) Video Streaming (Internet) File Sharing (Azure) Docusign SSO (Applic) Sitedata_RO (Applic) PS2000 (Applic) HRRep Senior Managers (Applic) HRRep People Managers (Applic) GIS (Applic) Acrobat #DIST - ROC Daily Report #DIST - Management Reporting #DIST - Fin Docusign SSO-11004472407 #DEPT - People{{SISJobOutputParameterEnd}}
Ricky Posted March 17, 2021 Posted March 17, 2021 @AndyGilly, Looks all correct, so no issues with the output, however can you confirm that the variable MoverADGroups the same as that configured for the operation (Note that the parameter names are case sensitive). Ricky
Ricky Posted March 17, 2021 Posted March 17, 2021 @AndyGillyThanks for the confirmation. I have tested this in-house and am unable to replicate the issue, and have now passed this to the dev team for investigation to identify the cause and implement a fix if required, and I will keep you updated with any progress. Ricky 1
Graham Posted March 18, 2021 Posted March 18, 2021 @AndyGilly This is proving to be a bit of a head-scratcher! Would you mind posting the complete output from the Console Output tab, rather than the Monitor tab, from the job? Graham
AndyGilly Posted March 18, 2021 Author Posted March 18, 2021 HI @Graham this is the console output, nowhere near as much info as in the monitor Note: This output has been filtered for readability.The original PowerShell CLIXML output has been removed.Get AD Groups for Mover script startedSetting variables...Running ScriptUser = DZWOODGroup are: adding to querylist: OC-P2000adding to querylist: OC-HR-INDUCTIONNND thanks Andy
Ricky Posted March 18, 2021 Posted March 18, 2021 @AndyGillyIn your PowerShell script you have a line that outputs your the content of the variable $output: Write-Output "Mover Output: $output" can you comment that line out and try running it again. Ricky
AndyGilly Posted March 18, 2021 Author Posted March 18, 2021 Hi @Ricky no change i am afraid thanks Andy
Ricky Posted March 18, 2021 Posted March 18, 2021 @AndyGillyDue to nature of this issue, I think the best approach will be to get an Incident raised and organise a remote session, with possibly a member of the dev team included so that we can get this resolved asap. Ricky 1
Ricky Posted March 30, 2021 Posted March 30, 2021 A workaround is available, which can be implemented by turning off the parser within Hornbill Administration Settings:
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