PhenixID

Write to File

Version: 2.1

Category: Output

Extended Category: Files

Action Package: Standard Actions

Description

Write to File.

Parameter

Description

Example

Directory to Add a File Into:

[Optional] The directory to add a file into. Leave blank for system tmp directory. Supports SESSION() and GLOBAL().

c:\data\

File Name:

[Optional] The name of the file including file extension. Leave blank to add random, unique name. Supports SESSION() and GLOBAL().

SESSION(date)_SESSION(time)

Random File Name Prefix:

[Optional] Create a random, unique file name starting with this prefix. Will be used if no other file name is specified. Default: tmp

test

Random File Name Extension:

[Optional] Create a random, unique file name with this file extension. Will be used if no other file name is specified. Default: .txt

.log

Session Attribute Storing File Name/Path:

[Optional] The attribute which stores the file name including path.

outfile

Character Set:

[Optional] The file output character set, Example: UTF-8, ISO-8859-1 etc. Default is system charset

UTF-8

All Session Objects in one File (true/false):

[Optional] If set to true, the data from all Session Objects will be written to the file. If set to false, each Session Object will empty the file before writing it’s data to the file. (true/false) Default: false

true

Append Mode (true/false):

[Optional] If the file already exists and this is set to true, the data will be added to the bottom of the file. If this is set to false, the file will be emptied before writing the data to the file. (true/false) Default: true

false

Heading in File:

[Optional] The heading that is printed on the first line in the file. Leave empty to disable. Supports GLOBAL().

userID,First Name,Last Name, Category

Data to Write into the File:

[Optional] The data to write into the file. This part will be entered into the file once per Session Object. Supports SESSION() and GLOBAL().

SESSION(samaccountname), SESSION(givenname),SESSION(sn),USER

Footer in File:

[Optional] The footer that is printed on the last line in the file. Leave empty to disable. Supports GLOBAL().

— Created at GLOBAL(date)

Use Cases

Example 1: Write users to import in file

This action will write some session attributes to a csv file which could be imported by another application.

Parameter

Value

Directory to Add a File Into:

/var/opt/export

File Name:

export.csv

Random File Name Prefix:

[BLANK]

Random File Name Extension:

[BLANK]

Session Attribute Storing File Name/Path:

[BLANK]

Character Set:

[BLANK]

All Session Objects in one File (true/false):

true

Append Mode (true/false):

true

Heading in File:

USERNAME,GIVEN NAME,LAST NAME

Data to Write into the File:

SESSION(samaccountname),SESSION(givenname),SESSION(sn)

Footer in File:

[BLANK]

Example 2: Write users to xml file

This action will write some attributes from the session objects to an xml file, named using a session attribute ‘date’ containing the current date.

Parameter

Value

Directory to Add a File Into:

/var/opt/export

File Name:

users_SESSION(date).xml

Random File Name Prefix:

[BLANK]

Random File Name Extension:

[BLANK]

Session Attribute Storing File Name/Path:

[BLANK]

Character Set:

UTF-8

All Session Objects in one File (true/false):

true

Append Mode (true/false):

false

Heading in File:

<users>

Data to Write into the File:

<user>
<id>SESSION(samaccountname)</id>
<givenname>SESSION(givenname)</givenname>
<lastname>SESSION(sn)</lastname>
</user>

Footer in File:

</users>


DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.

The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.

PhenixID - support.phenixid.se