<p>In a LotusScript Agent that is being run via WebQueryOpen, how do you get the name of the current server?</p>

[{'answer_id': 59683, 'author': 'Derek', 'author_id': 5440, 'author_profile': 'https://Stackoverflow.com/users/5440', 'pm_score': 3, 'selected': False, 'text': '<pre><code>Set s = New NotesSession\nSet db = s.CurrentDatabase\n\nIf db.Server &lt;&gt; "" Then\n  Set sName = New NotesName(db.Server)\nElse\n  Set sName = New NotesName(s.Username)\nEnd If\n</code></pre>\n'}, {'answer_id': 62801, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': -1, 'selected': False, 'text': "<pre><code>'initialize event of a WebQueryOpen agent\n\nDim s As New notessession   \nDim servername As String\nservername = s.UserName\n</code></pre>\n"}, {'answer_id': 76770, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>The sample code already provided is good but I also do it this way and just get the hierarchical name of the server:</p>\n\n<pre><code>Set s = New NotesSession\nSet db = s.CurrentDatabase\nIf db.Server &lt;&gt; "" Then\n   Set sName = New NotesName(db.Server)\nElse\n   Set sName = New NotesName(s.Username)\nEnd If\nServerName = sName.Abbreviated\n</code></pre>\n'}, {'answer_id': 2446498, 'author': 'angryITguy', 'author_id': 193467, 'author_profile': 'https://Stackoverflow.com/users/193467', 'pm_score': 0, 'selected': False, 'text': '<p>Gary\'s answer is the most appropriate. You can actually identify the server name using hierarchical syntax to.</p>\n\n<pre><code>dim session as new notesSession\ndim strCurrServer as string\ndim nmServer as notesName\n\nstrCurrServer = session.currentagent.servername\n\' this bit is optional \nset nmServer = new notesName(strCurrServer)\n\' then you can do stuff like this\nprint nmServer.Abbreviated   \n</code></pre>\n\n<p>That would be the fastest (dirtiest?) way to get the server name from the webquery open agent. The notesName class is a handy object for dealing with hierarchical names\n<a href="http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer.domino.main.doc/H_NOTESNAME_CLASS.html" rel="nofollow noreferrer">link text</a></p>\n'}]
['https://Stackoverflow.com/questions/59680', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5440/']