From the class documentation on OSUserName:

Operating system username of process.
Username given to the process by the operating system when the process
is created. When displayed, it is truncated to 16 characters. Note that the real O/S
username is only returned when connecting to UNIX or VMS systems; For Windows, it
will return the O/S username for a console process, but for telnet it will return
the $USERNAME of the process. For client connections, it contains the O/S username
of the client. This field is truncated at 16 characters.

_Ensemble is a Caché user under which all Ensemble jobs are run.

If you need to understand the context under which the service runs execute in a BS:

do $zf(-1,"set > vars.txt")

to output all environment variables to a file.

There is no Cache function to do that.

But as PDF contains readable "postscript" parts you can use regexp to search for relevant information. Stack. Article. It's not guaranteed to be precise though.

Here's my article about using LibreOffice for work with documents. I've also used ghostscript and postscript to work with pdf from Caché and it's all fairly straightforward.

Also, here's the code I wrote (execute is defined here) to add footer to every page of a PDF file using ghostscript:

/// Use ghostscript (%1) to apply postscript script %3
/// Upon source pdf (%4) to get output pgf (%2)
/// Attempts at speed  -dProvideUnicode -dEmbedAllFonts=true  -dPDFSETTINGS=/prepress
Parameter STAMP = "%1  -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=%2 %3 -f %4";

ClassMethod stampPDF(pdf, psFile, pdfOut) As %Status
{
    set cmd = $$$FormatText(..#STAMP, ..getGS(), pdfOut, psFile, pdf)
    return ..execute(cmd)
}

ClassMethod createPS(psFile, text) As %Status
{
    set stream = ##class(%Stream.FileCharacter).%New()
        // For cyrillic text
    set stream.TranslateTable = "CP1251"
    set sc = stream.LinkToFile(psFile)
    quit:$$$ISERR(sc) sc
    
    do stream.WriteLine("<<")
    do stream.WriteLine("   /EndPage")
    do stream.WriteLine("   {")
    do stream.WriteLine("     2 eq { pop false }")
    do stream.WriteLine("     {")
    do stream.WriteLine("         gsave")
    do stream.WriteLine("         /MyFont 12 selectfont")
    do stream.WriteLine("         30 70 moveto (" _ text _ ") show")
    do stream.WriteLine("         grestore")
    do stream.WriteLine("         true")
    do stream.WriteLine("     } ifelse")
    do stream.WriteLine("   } bind")
    do stream.WriteLine(">> setpagedevice")
    
    quit stream.%Save()
}

/// Get gs binary
ClassMethod getGS()
{
    if $$$isWINDOWS {
        set gs = "gswin64c"
    } else {
        set gs = "gs"
    }
    return gs
}

Ghostscript can be used to get a number of pages in a PDF file. Here's how.

1. https certificate would apply to the cache and csp sites defined under IIS.  It would apply  to everyrhing really.

2. Not sure about html landing page being a security threat. That depends on your setup. Do you embed http parts in your (future) https pages?

I'd recommend as a first step to install let's encrypt certificate - it's free and easy.

Then force http->https redirect on your iis server.

After that check how your html landing page behaves.

Thank you! That's very useful.

Is there a way to return real implementation class?

For example, consider these classes:

Class App.Use {

ClassMethod Test()
{
    w 1/0
}
}

and:

Class App.Use2 Extends App.Use
{
}

If I call:

do ##class(App.Use2).Test()

I get  the following CLS source line:

App.Use2:Test+1

Yet, the relevant code is actually implemented in

App.Use:Test+1

One approach I see is checking %Dictionary.MethodDefinition recursively till I find a method definition, but there's bound to be many problems multiple inheritance.