Zum Inhalt springen

Command templates

Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen

Once you enabled the Run Command Service, you want to get the information about the currently available commands for you to use.

The following documentation describes how you can retrieve all currently available and supported command templates in the STACKIT Portal in order to use them for remote execution on your server.

Use the following steps, if you want to use the STACKIT Portal in order to get the information about the currently available command templates:

In your project navigate to the overview of your server you want to run a command remotely at and click on “Commands” → “Templates” to find a list of all available command templates for this server:

Click on a command template (i.e. “ShowUsers”) and it will display an infobox with details about the supported operating system (Linux/Windows) as well as the content of the executed script:

NumberOS TypeCommand Template NameCommand Template TitleArgumentsDescription
1linuxRunShellScriptRun shell script-

Linux: Run custom shell script on Linux servers.
Example usage of arguments:
- arguments: “arg1 arg2 arg3”

2windowsRunPowerShellScriptRun PowerShell script-

Windows: Run custom PowerShell script on Windows Servers.
Example usage of arguments:
- arguments: “arg1 arg2 arg3”

3linux/windowsRunScriptFromCustomSourceRun script from custom stackits3, local or public sourcesourceType, location

Linux: Run shell script from different custom source.
Available source types: stackits3, local, public.
Examples:

  • Run script from STACKIT Object Storage which is S3 compatible. Ensure that there is a service account attached to the server on which you run the script and it has permissions to access the bucket.
    sourceType: stackits3
    location: https://<bucket_name>.object.storage.eu01.onstackit.cloud/<key_name>

  • Run script from file saved locally on the server.
    sourceType: local
    location: /usr/local/bin/myscript.sh

  • Run script from public source. Ensure that the address is accessible via internet without any authentication.
    sourceType: public
    location: https://<my_script_address>

4

Windows: Run shell script from different custom source.
Available source types: stackits3, local, public.
Examples:

  • Run script from STACKIT Object Storage which is S3 compatible. Ensure that there is a service account attached to the server on which you run the script and it has permissions to access the bucket.
    sourceType: stackits3
    location: https://<bucket_name>.object.storage.eu01.onstackit.cloud/<key_name>

  • Run script from file saved locally on the server.
    sourceType: local
    location: C:\Program Files\myscript.ps1

  • Run script from public source. Ensure that the address is accessible via internet without any authentication.
    sourceType: public
    location: https://<my_script_address>

5linux/windowsResetPasswordReset password or create a new userusername, passwordLinux: Reset password of an existing user or create a new user with sudo privileges on Linux servers.
Windows: Reset password of an existing user or create a new administrator on Windows Servers.
6linuxResetSSHPublicKeyReset SSH key or create a new userusername, keyLinux: Reset SSH Public Key of an existing user or create a new user with sudo privileges on Linux servers.
7linux/windowsShowUsersShow all users in the system-Linux: Show all users in the system with user ID, group ID, home directory, shell and further information.
Windows: Show all users in the system with description.
8linux/windowsShowGroupsShow all groups in the system-Linux: Show all groups in the system with details.
Windows: Show all groups in the system with details.
9linux/windowsShowUsersGroupsAssignmentShow users and their assigned groupsusers

Linux: Show users in the system and their assigned groups. You can specify a single user or a list of users (user1,user2,user3).

Windows: Show users in the system and their assigned groups. You can specify a single user or a list of users (user1,user2,user3).

10linux/windowsAddUsersToGroupsAdd users to all groups specifiedusers, groups

Linux: Add one or more users to one or more groups.
Example usage of arguments:
- users: “user1,user2,user3”
- groups: “group1,group2,group3”

Windows: Add one or more users to one or more groups.
Example usage of arguments:
- users: “user1,user2,user3”
- groups: “group1,group2,group3”

11linux/windowsRemoveUsersFromGroupsRemove users from groupsusers, groups

Linux: Remove one or more users from one or more groups. However, you cannot remove a user from its primary group.
Example usage of arguments:
- users: “user1,user2,user3”
- groups: “group1,group2,group3”

Windows: Remove one or more users from one or more groups.
Example usage of arguments:
- users: “user1,user2,user3”
- groups: “group1,group2,group3”

12linux/windowsDeleteUsersDelete local users from the systemuser

Linux: Delete one or more local users from the system.
Example usage of arguments:
- users: “user1,user2,user3”

Windows: Delete one or more local users from the system.
Example usage of arguments:
- users: “user1,user2,user3”

13windowsjoinDomainJoin a Windows Server to a domainDNS, DomainName, DomainUser, DomainPassword, OuPath

Windows: Join a Windows Server to a domain. Input arguments:

  • DNS: At least one DNS Server to access your domain. If you want to add more then one, please separate them with comma dns1,dns2,dns3.
  • DomainName: Domain name.
  • DomainUser: Domain username of a user who has permissions to join a computer into your domain.
  • DomainPassword: Password of the domain user.
  • OuPath: Domain Organizational Unit (OU) path.
14linux/windowsShowHostnameShow the host name-Linux: Show the FQDN (Fully Qualified Domain Name).
Windows: Show the local host name.
15linux/windowsShowSystemInfoShow system information-Linux: Show system information about CPU, storage, RAM, BIOS and more.
Windows: Show system information about CPU, storage, RAM, BIOS and more.
16linux/windowsShowLogEntriesShow log entries from the system

Linux: -
Windows: logname, entrytype, after, before, limit

Linux: Show systemd journal entries with higher priority from last boot.

Windows: Retrieve and display Windows event logs with options to filter by log names, entry type, time and date, and limit output.
Available log names: System, Application, Security.
Available entry types: Error, Warning, Information, SuccessAudit, FailureAudit.
Default behavior shows 10 logs per log name in chronological order.
Example usage of arguments:

  • LogName: “System,Application”
  • EntryType: “Error,Warning”
  • After: “10/22/2023 08:00:00”
  • Before: “10/23/2023 08:00:00”
  • Limit: “50”
17linux/windowsShowCurrentWorkloadShow current workload on the system-Linux: Provide a dynamic real-time view of the running system.
Windows: Show the current workload (CPU and RAM utilization).
18linux/windowsShowProcessesShow processes on the system

Linux: -
Windows: ProcessName

Linux: Report a snapshot of the current processes.

Windows: Show processes and their related workload. Execute the script without arguments to get all processes. If you want to specify one process or a list of processes, run it with arguments.
Example usage of arguments:
- ProcessName: “process1,process2”

19linux/windowsManageServicesManage services on the systemaction, services

Linux: Manage services and perform actions on them. Input arguments:

  • action: Specify the action that will be performed. Possible values:

    • status: Show terse runtime status information about one or more services, followed by most recent log data from the journal.
    • start: Start (activate) one or more services.
    • stop: Stop (deactivate) one or more services.
    • restart: Stop and then start one or more services.
    • reload: Asks all specified services to reload their configuration.
    • enable: Enabling a service means it will start at boot.
    • disable: Disabling a service means it will not start at boot, but can be started manually, or as a dependency of another service.
  • services: Service name or list of services i.e “nginx,sshd”.

Windows: Manage services and perform actions on them. Input arguments:

  • action: Specify the action that will be performed. Possible values:

    • start: Start (activate) one or more services.
    • stop: Stop (deactivate) one or more services.
    • restart: Stop and then start one or more services.
    • suspend: Suspend one or more services.
    • enable: Enabling a service means it will start at boot.
    • disable: Disabling a service means it will not start at boot, but can be started manually, or as a dependency of another service.
    • remove: Remove a Windows service in the registry and in the service database.
  • services: Service name or list of services i.e “WinRM,Schedule”.

20linux/windowsKillProcessesKill processes on the system

Linux: signal, processname
Windows: processname

Linux: Kill (end) a process. Input arguments:

  • signal: The signal to be sent along with the kill command, i.e. the way a process is terminated. Possible values:

    • SIGKILL: Immediate termination of a process. Cannot be caught, ignored or blocked. Child processes are killed as well.
    • SIGTERM: Used for gracefully terminating a process. Can be referred as soft kill, because the receiver may choose to ignore it.
  • processname: Name of the process to kill.

Example usage of arguments:
- signal: “SIGKILL”
- processname: “process1”

Windows: Kill (end) one or more processes.
Example usage of arguments:
- processname: “process1,process2”

21linux/windowsShowNetworkConfigurationShow network configuration-Linux: Show network interfaces configuration.
Windows: Show IP configuration.
22linux/windowsShowRoutingShow routing table entries-Linux: Show routing table entries.
Windows: Show routing table entries.
23linux/windowsShowSocketStatusShow all sockets and status-Linux: Show all sockets and status.
Windows: Show all sockets and status.
24linux/windowsShowMemoryUsageShow memory usage-Linux: Show memory and swap usage.
Windows: Show total, used and available physical memory.
25linux/windowsShowFilesystemsShow filesystems with disk usage-Linux: Show filesystems with disk usage.
Windows: Show filesystems with disk usage.
26linuxShowInodesShow filesystems with Inodes usage-Linux: Show filesystems with Inodes usage.
27linuxShowBlockDevicesShow block devices-Linux: Show block devices.
28linuxShowPartitionsTableShow partitions table-Linux: Show partitions table.
29linuxShowMountedFilesystemsShow mounted filesystems-Linux: Show mounted filesystems.
30windowsEnableRemotePowerShellEnable remote PowerShell-Windows: Configure the machine to enable remote PowerShell.
31windowsDisableNetworkLevelAuthenticationDisable Network Level Authentication-

Windows: Use this script to disable NLA if RDP connections are failing with error ‘The remote computer that you are trying to connect to requires Network Level Authentication (NLA), but your Windows domain controller cannot be contacted to perform NLA.’ or error ‘An authentication error has occurred. The Local Security Authority cannot be contacted.
You need to restart the server manually after the script completes. The script itself does not perform a restart of the server.
NLA is a security feature that should only be disabled temporarily to allow RDP connections to succeed until the domain controller connectivity issue has been resolved.

32windowsShowRDPSettingsShow RDP listener settings-Windows: Show detailed information about the IP address, subnet mask and default gateway for each adapter bound to TCP/IP.
33windowsResetRDPCertificateReset RDP certificate to default-

Windows: Remove the SSL certificate tied to the RDP listener and restores the RDP listener security to default.
Use this script if you see any issues with the certificate. This script will restart the TermService.

34windowsEnableRDPPortConfigure Remote Desktop portRDPPort

Windows: Set the default port number (3389) or user specified port number for Remote Desktop connections and enable firewall rule for inbound access to the port.
Example usage of arguments:
- RDPPort: “3389”