Blogging about Royal TS/X, Royal Server and Royal Passwords

New Feature: PowerShell Connection

When managing Windows servers there is no way around PowerShell. So it was only logical that one of the most requested features was to fully integrate PowerShell in our products.

Note: This feature is included in the current beta releases of Royal TS and Royal Server (Royal TSX is coming soon!).

 

Use Cases

By executing PowerShell scripts on remote machines you can achieve virtually everything an IT Pro dreams of:

  • Manage User Accounts (resetting the password, disabling/enabling them, unlocking them etc)
  • Installing Windows Features
  • Working with specialised PowerShell commands for Exchange, Sharepoint etc
  • Searching for patterns in SQL Databases
  • Work with DSC (Desired State Configuration) commands
  • and so much more …

 

Creating a PowerShell connection

Creating a new PowerShell connection is straight forward: just add it by using the context menu:

2015-05-21 11_51_55-

Enter a Display Name and a Computer Name (as usually, this can be a list of Computers):

2015-05-21 16_27_10-Add PowerShell Connection

Lets assume, we want to display all Administrators on a server. The Microsoft TechNet Script Center already has a script that does this. You can find it here.

Paste it in the Script tab:

2015-05-21 16_39_21-Edit Properties_ Get members of Administrator group

Note: Always take care which scripts you execute from the Internet.
Note: This script does not work if you have a different operating system language than English because of the hard-coded group name “Administrators”
Note: I modified the script in the way that it returns a PowerShell object instead of strings

 

Now, this script contains a function, but no output yet. Since we actually want to get back the members we have to add the following code at the end:

get-localadmin -strcomputer localhost

 

In the Display Options you can specify if the output of your script should be shown as Text (as in the PowerShell console) or as a Grid.

2015-05-21 12_56_32-Add PowerShell Connection

 

Note: The checkbox Show Script Panel displays the script directly above the script output when you connect which enables you to easily adapt the script and see the changes immediately.

 

The Text tab in the Display Options settings page allow you to configure the Font, Font Size etc as you can configure it in your normal PowerShell console.

2015-05-21 12_57_02-Add PowerShell Connection

 

If you work with remote machines, specify a Credential that has the necessary rights.

2015-05-21 13_07_13-Add PowerShell Connection

 

The Royal Server settings page allows you to specify, if you want to execute the PowerShell script by using Royal Server or Direct Connect (No Royal Server).

2015-05-21 12_57_31-Add PowerShell Connection

 

As a result you get all logged in users from the specified hosts:

2015-05-21 16_40_56-Get members of Administrator group

 

Executing on multiple Servers

If you took a close look, we had to add the following line to the end of the script:

get-localadmin -strcomputer localhost

The computer is “localhost” since the PowerShell connection executes the script for each host that is entered in the Computer Name by using PowerShell Remoting. If you enter multiple hosts, the script is executed on multiple machines:

2015-05-21 16_38_59-Get members of Administrator group

Note: See the different hosts in the __ComputerName column which was populated from the  Computer Name property from the Connection.

 

But what if you actually want to pass in parameters to the Script? Additionally these parameters should be populated by information already stored in some Royal Object.

 

Working with Parameters

Lets assume, you want to specify the Administrators groups name in the CustomField1 in Royal TS and push it to the script when it executes.

1. Specify the name in the CustomField1:

2015-05-21 16_43_52-Edit Properties_ Get members of Administrator group

 

2. Adapt the script to work with Parameters

Every script needs to be prepared to work with Parameters. This is a block at the beginning of the script that looks like this:

Params (
    $param1
)

Adapt the script to use the newly introduced parameter:

 


2015-05-21 17_00_07-Edit Properties_ Get members of Administrator group

Note: The script has been changed to use the $AdminGroupName variable

 

3. Define the parameters in the Parameters Tab

Specify the parameter by referencing the CustomField1 variable.

2015-05-21 16_48_50-Edit Properties_ Get members of Administrator group

Note: The Test Value can be used for specifying static values for testing the script in the Test tab.

 

For testing purposes you can specify test-values and execute the Script in the Test tab to see if it works as expected (the output when testing is always Text)

 

Developing a Script

When you still develop a script, its inconvenient to always reopen the properties of the PowerShell Connection if you want to change the script. As a shortcut, you can use our Script Panel and edit your script and Refresh the output to see the results.

2015-05-21 17_05_44-

 

Using the Text output

Rendering the output of the script as a Grid only works if the script actually returns objects. But if the output is just plain text chose Text as Default Output in the Display Options settings page.

Consider the following script:

2015-05-21 17_57_38-Edit Properties_ Restart Printer Spooler

 

With Default Output set to Text:

2015-05-21 17_57_52-

 



New Windows Feature: Overview

In the past, Royal TSX for OS X had to do a lot of catching up to get on par with all the Royal TS for Windows features. Since the Royal TSX V2 release, there’s almost no feature missing anymore but there is one Royal TSX for OS X feature missing in Windows: Overview

The main reason for the Windows version not having an “Overview” mode in the Dashboard tab was simply a technical limitation. The Remote Desktop ActiveX control (which is used by Royal TS for Windows) does not support capturing screenshots when the control is not visible (i.e. in a background tab). Well, we found another way to capture this screenshot and the Overview mode is available in the latest 3.1 beta release. We don’t want to go into much technical details here but to enable this feature, additional files are necessary – which are not  shipped with Royal TS. We got feedback from some users that those required files are not allowed in their environment, so we chose to let the user decide if he wants to enable this feature or not.

To switch between the Dashboard and Overview mode, simply click on the icon of the Dashboard / Overview tab (the dashboard needs to be opened and tabbed). When you hover over the tab you will see the following tooltip:

Overview-01

As you can see, a couple of different tabs are open and after switching to the Overview mode for the first time, you will notice an information banner on the top:

Overview-02

Since the required files are not yet installed, you only see live thumbnails from connections like web page connections, performance views or Rebex based terminal connections, for example. The Remote Desktop connection thumbnails are not shown. When you click on the “Download now?” link of the information banner, you will be asked if you want to download and install the files. Once Royal TS finished downloading and installing them on your system, you will also see the thumbnails of the Remote Desktop connections showing up:

Overview-03

Some additional information:

For performance reasons, the thumbnail update interval is set to 2 seconds. If you experience bad performance, let us know. On the upper right, you have a slider where you can set the thumbnail size. Right now, all external application based connection types (Terminal based on PuTTY, VNC based on TightVNC or UltraVNC and all External Application connections) do not show thumbnail images. Double-clicking a thumbnail will activate the connection tab (which is currently not working reliably – we are looking into it).

Happy overviewing…

 

 



New Feature: Overrides

Royal TS (for Windows) V3.1 (currently available as beta) and Royal TSX (for OS X) V2.0.4.7 (currently available as beta) ship a new feature, which was requested regularly, called “Overrides“.  In a nutshell, Overrides allow you to customize/personalize connections in a document, without actually modifying the connection in a document. The best way to introduce this new feature is by just walking through a simple example:

Let’s assume we have a shared document containing terminal connections (based on the Rebex plugin). The screenshot below shows such a terminal connection:

Overrides-01

Since this is a shared document, provided by one of my team members, I have to use the connection exactly as it is, with all the display options, colors, etc. If I want to change those things to my liking, I either have to modify the shared document (then everyone is going to use those new settings) or I have to duplicate the connection to one of my personal documents, modify it there and use the duplicate. Needless to say that option 1 is kind of egoistic and not really team friendly and option 2 results in manual labour and is hard to maintain.

Overrides are the perfect solution in situations like this. To configure override settings, navigate to the Application document’s Default Settings folder and click on Terminal as shown below:

Overrides-02

Note that there’s a new button called Edit Overrides. Clicking on it will either show the Overrides dialog immediately (in case only one plugin is available for the selected connection type) or it will show a drop-down menu which allows you to select the plugin you want to configure the overrides for. In our example we select the Terminal (based on Rebex) plugin.

The Overrides dialog looks and behaves similar to the bulk-edit dialog. The Override button at the top right corner allows you to enable or disable individual settings to override. In the Display Options page, we are going to override the Font and the Font Size setting:

Overrides-03

Once you check an override setting, it will be enabled in the dialog and you can configure the setting like you want to. In addition to the font settings, I also want to have a specific background and foreground color. Let’s switch to the Colors page and enable the overrides for Black and White in the Normal Colors palette:

Overrides-04

Of course, you can go through all the pages and override as many settings as you want. If you’re done with configuring the overrides, we can now apply the override in two different ways. By default, overrides are only applied when holding the Alt key while you are connecting. To change this behavior, go to View -> Options -> Behavior -> Modifiers and change how Royal TS should apply the overrides:

Overrides-05

So whenever you want, you can connect to your connections with or without the overrides applied:

Overrides-06

Conclusion

Overrides can massively increase the flexibility in your workflows. This level of granularity, which is also offered by the bulk-edit feature, allows you to work in many different scenarios. The overrides are stored in the application document along with the default settings (%appdata%\code4ward), which means that you can have different overrides in different environments (such as work PC and personal laptop). Overrides are not affecting the document where the actual connection resides, they are applied “on the fly” without changing the document. Here are some use cases and scenarios where overrides can be handy:

  • Personalization of connection properties
  • Working with two different sets of credentials, depending on the environment
  • Applying secure gateway or proxy configuration, depending on the environment

I hope you will find this handy too. Let us know what you think and if you can think of features we should implement, visit our support portal and submit your idea.

Happy overriding!



View Clean & Dirty Server Reboots – Using Templates

In a previous blogpost we have described the approach how to check for clean and dirty server reboots using the Windows Events View. But imagine, you want to see this information from different servers? Always changing the machine name(s) in the Windows Events View is tedious and not really effective. Royal TS/X offers a much more flexible technique for this problem: Templates.

 

Using Templates

Instead of creating a Windows Events View we create a Template for Windows Events:

Screen Shot 2015-05-22 at 16.42.30 copy

 

This template is configured in the exact same way as the one in the previous post (filter the Event IDs, specify Credentials, specify the Royal Server) with one exception: since the Computer is variable, we need to use Tokens that are replaced at runtime:

Screen Shot 2015-05-22 at 16.44.59

Additionally, specify the Credentials if needed and a Royal Server:

Screen Shot 2015-05-22 at 16.46.11

 

Screen Shot 2015-05-22 at 16.46.14

 

Having this in place, you can directly connect to any configured Connection by using the Template:

Screen Shot 2015-05-22 at 16.47.42 copy

Gimme more!

For the case that you have a group of servers that you want to check: this is as simple as a single server. Just modify the Template to use $URIS$ (note the plural) for allowing the template to work with multiple servers.

Screen Shot 2015-05-22 at 16.49.34

 

Then, switch to the Dashboard in Royal TS X (either by using the Menu “View” -> “Switch to Dashboard” or by clicking on the Icon of the Overview Tab. By clicking on a Folder that contains e.g. RDP connections, you can select the list and connect using the Template:

Screen Shot 2015-05-22 at 16.50.22 copy

 

You will get for each server a Ad Hoc Connection with the settings from the Template.

 

Remark: For the case that you think, that you might use this connection more often, you can just drag n drop it in your document for later use!

 

 

Cross Platform

Again, this usage of Templates work exactly the same in Royal TS (for Windows). With one exception: If you select multiple servers and use $URIS$ in your template you will end up with one Connection containing all servers in the Computer Name field. But we will adapt the Royal TS X soon so both clients function in the same way.



Using Royal TS/X to View Clean & Dirty Server Reboots

Remark: the main idea behind this post comes from this post which is using SCOM for this task. This blogpost achieves a similar scenario by using Royal TS/X.

 

The Use Case

We want to know when a specific list of servers had a clean server reboot:

Screen Shot 2015-05-22 at 16.31.10

 

Step-by-step “Clean Server Restarts”

First, we create a new Windows Events View – as usually you have the flexibility to specify multiple servers in the “Computer Name” field:
Screen Shot 2015-05-22 at 16.31.59

 

The Windows Events View is connected via a Royal Server:
Screen Shot 2015-05-22 at 16.32.41

Remark: You might also specify a Credential, if needed.

 

Now go to the Filter tab of the Windows Events View and specify the “System” Log and “Event ID” equals: 6006.

Screen Shot 2015-05-22 at 16.33.44

 

Remark: If you leave the Time Range on “None” you get all (!)  clean Server Restarts which will take a while. As a recommendation limit this to the last week or something similar that fits your requirement.

 

Once connected, you’ll get the full view on your clean server restarts combining all specified servers:

Screen Shot 2015-05-22 at 16.35.04

 

For quick data analysis you can drill down in the view by using the Filter Toolbar of the Windows Events Connection:

Imagine, you want to show only events from February 2nd:

Screen Shot 2015-05-22 at 16.35.36

 

or compare the different servers and show only the server located at 192.168.1.170:

Screen Shot 2015-05-22 at 16.36.11

 

This was just the “Basic” configuration – in the “Advanced” Tab you can specify even more complex queries:

Screen Shot 2015-05-22 at 16.37.48

 

Dirty Server Restarts – the fast way

For the “Dirty Server Restarts” just duplicate the previously created Connection, rename it properly and change the Event ID to 6008.

 

Cross Platform

You can use the specified Connections in Royal TSX (for OS X) as well as Royal TS (for Windows) – even at the same time.

 

Notifications

Right now, we do not have the capability to trigger notifications based on connections. But this might be a future extension to Royal Server – tell us, what you think about it:

  • Would you need a notification system?
  • Are you using one right now? If so: which one?
  • Which ways of notifying (email, SMS, triggering a web service/web site for creating a ticket etc.) would you be interested in?
  • Just drop us a line at info@royalapplications.com – we’d love to hear from you!