cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass company description to file?

Former Member
0 Kudos

Hello guru!

Could you please help me to pass several parameter to file?

I created own Web Enabled task to create identities (non-employee, they are not in HCM):

In this task I create new user and assign it to company (MXREF_MX_COMPANY_ADDRESS).

On "OK" result I have task "Create non-employee"

This task create new user, generate MSKEYVALUE, DISPLAYNAME and then createfile in filesystem.

In pass "Shell Execute" I have script:

powershell.exe "\"%MX_FS_PERSONNEL_NUMBER%;%MX_HCM_SYSUNAME%;%MX_LASTNAME_EN%;%MX_FIRSTNAME_EN% .......\"| Out-File \"%ACCOUNTAD%.txt\" -Force -Encoding \"UTF8\" "

Now I need to pass all company characteristics, such:

%MX_FS_COMPANY_CODE%

%MX_ADDRESS_COMPANY_POST_CODE%

%MX_ADDRESS_STREET_1%

%MX_ADDRESS_CITY%

and other attributes of MX_COMPANY_ADDRESS.

How can I pass them to file?

Now only %MXREF_MX_COMPANY_ADDRESS% can be passed. All other Company's parameters are null.

What I have to do to get and pass to text file parameters about company with which new user is assigned?

Please help me!

Best regards,

Natalia.

Accepted Solutions (1)

Accepted Solutions (1)

terovirta
Active Contributor
0 Kudos

Do you just want to write the contents of those attributes to the file or pass the values to your PowerShell script?

The MXREF_MX_COMPANY_ADDRESS is a reference attribute so you would need to write a script that does the lookup with the passed company address MSKEY and returns the values of those attributes.

Cool part of IdM's scripts is that you can call them pretty much everywhere, I embed scripts into SQL statements, format filenames using scripts etc. If you need to return the 4 fields you mentioned as parameters to your PowerShell script, just call your lookup script in the generated PowerShell with the same notation as you would call the script in toIdentityStore pass' attribute mapping. Return the attribute values as you like from the script as usual.

In pass "Shell Execute" I have script:

powershell.exe "\"%MX_FS_PERSONNEL_NUMBER%;%MX_HCM_SYSUNAME%;%MX_LASTNAME_EN%;%MX_FIRSTNAME_EN% .......\$FUNCTION.getThe4CompAddrFields(%MXREF_MX_COMPANY_ADDRESS%)$$"| Out-File \"%ACCOUNTAD%.txt\" -Force -Encoding \"UTF8\" "

Former Member
0 Kudos

Tero Virta,

I had hopes to use something standarted, not my own scripts.

But in any cases thanks for advice!

Answers (0)