APGen Documentation Previous Topic: Log.LogEvent() Next Topic: Logon.User Parent Topic: APGen Object Reference    APGen Object Reference
Logon Object
See Also:

The Logon object lets developers specify logon settings that are used when creating or writing to output files and log files.

Syntax

oLogon.[ property ]

Object

oLogon A Logon object.

Properties

User String Sets/returns the logon user name.
Password String Sets/returns the logon user password.
Domain String Sets/returns the logon domain.

Notes

A Logon object is returned from APGen.Logon, Output.Logon, and Log.Logon.

The logon settings stored in the Logon object are used when output files and log files are created.  For example, if Output.Logon.User is set to Paul, and Output.Logon.Password is set to the valid password for Paul, APGen logs on as Paul when creating the output file. 

Though APGen uses Paul's Logon when creating the output file, the APG script is not executed while logged on as Paul.  The APG script is executed using the security context of the thread that opens and runs the APG script.

How the Logon information is used is specific to each Class of output stream - for example, an FTP output stream would use the User and Password values when logging on to the FTP server (currently there is no FTP output stream). 

The file output stream uses the uses the Logon information in two ways, depending on whether the file is a local file or on a network share.  The Win32 API WNetAddConnection2() is used to connect to network shares - no impersonation is required for writing files on network shares.  For local files, LogonUser() and ImpersonateLoggedOnUser() are used to impersonate the user before writing the file.  Either way, the output file is created or overwritten using the specified user account.  See the Security and Executing APG Scripts in Active Server Pages topics for related information.

The APGen.Logon object affects global logon settings.  Its logon values are inherited by the Output.Logon and Log.Logon objects of all child APG scripts.  Use APGen.Logon when you want all (or most) files to be generated using a single user account. 

For more information on security and the Logon object, see Security.

To use the Logon object in C++, see the IAPGenLogon interface in <install dir>\include\APGen.h.