4D Blog

Home Product New server administration commands

New server administration commands

February 6, 2019

Product

4D continues to deliver features to help you create your own applications to monitor your servers. From programmatically retrieving information about sessions, processes, and the application server, to getting information about the web server.

Having already provided you commands to read about statuses, 4D v17 R4 now gives you the ability to change statuses. You can now create your own administration interfaces as dialogs on the server, client, or even as HTML pages for web access. It’s up to you. These commands allow you to perform the same actions as the standard 4D administration interface. For example, you can send a message to your users to notify them of scheduled maintenance, or block new connections to the application server while you perform an operation on it.

User commands 

You can send a message from the server to a remote user with the SEND MESSAGE TO REMOTE USER command. To retrieve a list of user sessions, you can use the Get process activity command.

For example, the server administrator wants to send a message to all connected users.

C_TEXT($message)
$message:="A maintenance operation is scheduled and the server will be restarted. Please log out before 10pm."
SEND MESSAGE TO REMOTE USER($message)

Or send a message only to John.

C_TEXT($message)
C_COLLECTION($userCol)
C_OBJECT($element)

// Retrieve the list of sessions with the userName: "John"
$userCol:=Get process activity(Sessions only).sessions.query("userName = :1";"John")

$message:="Hello John."
For each ($element;$userCol)
   SEND MESSAGE TO REMOTE USER($message;$element.ID)
End for each

You can also end a user session with the DROP REMOTE USER command.

C_COLLECTION($userCol)
C_OBJECT($element)

// Retrieve the list of sessions
$userCol:=Get process activity(Sessions only).sessions.query("userName = :1";"John")

For each ($element;$userCol)
   DROP REMOTE USER($element.ID)
End for each

Process commands

With the new ABORT PROCESS BY ID command, you can stop a specific process by using its unique process ID. To retrieve the unique process ID, you can use the Get process activity or Process properties commands.

For example, an operation was started on the database but it seems never-ending and is disrupting server performance. The administrator can retrieve the process number and thus abort the process.

// Retrieve the list of processes on the server and display it in a list box
$activity:=Get process activity(Processes only).processes
...
// The process selected by the administrator is aborted
ABORT PROCESS BY ID($activity.processes[selectedItem].ID)

Client connections

The server administrator can block new remote connections with the REJECT NEW REMOTE CONNECTION command. To tell if the connections have been accepted or refused, use the Get application info command.

// Reject the new connections
REJECT NEW REMOTE CONNECTIONS(True)
// Execute the maintenance operation
...
// Accept the new connections
REJECT NEW REMOTE CONNECTIONS(False)

SOAP REQUESTS

To block SOAP requests, you can use the SOAP REJECT NEW REQUESTS command. To know if the requests have been accepted or refused, use the WEB Get server info command.

If (WEB Get server info.SOAPServerStarted)
   SOAP REJECT NEW REQUESTS(True)
End if

Refresh license

Your team has grown, so you’ve purchased new client connections for your server. Server administrators are no longer required to physically access the server machine to update a license. The Refresh license command is now available. It calls the same action as if the administrator had clicked the button in 4D Server’s license dialog. Just in case you missed this feature, it automatically installs purchased licenses for clients, 4D Write Pro, or 4D View Pro. Read more about this feature.

C_OBJECT($res)
$res:=Refresh license
If ($res.success)
   ALERT("Success")
Else
   ALERT($res.message)
End if

 

Discuss

Tags Administration, Programming, v17 R4, v18, Web

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Vanessa Talbot
Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy