Migrating from Universal Dashboard v2.9

Since there have been some questions about this the last couple of days, I’ve started to put together a migration doc to go from Universal Dashboard to PowerShell Universal. I’ve also started to put together migration information for users that want to try UDv3.

https://docs.ironmansoftware.com/dashboard/dashboards/migrating-from-universal-dashboard-2.9

The most up to date examples for UDv3 can be found on GitHub.

The goal is to make it as painless as possible to move from Universal Dashboard v2.9 to PowerShell Universal. The hope is that you can change minimal amounts of script within your dashboards and have them work in PSU using the UDv2 framework that is included.

If you run into issues with UDv2 in PSU, please file an issue.

Also, note that you can still run your dashboards for free within PSU. It has the same limitations that prevent authentication without a license but removes the remote access restriction. You’ll also have access to Universal Automation to run up to 25 jobs a day.

2 Likes

Are there any tutorials or guides for migrating Authorization Policies to PSU? I looked at the docs and i still don’t fully understand how i am supposed to migrate over from New-UDAuthorizationPolicies.

Ah, good point. I’ll get some docs put together for that. That needs to be part of the migration doc.

That is good to know! Is there any timeline for this?

Plan on early next week sometime

I’ve written up some migration information here: https://docs.ironmansoftware.com/dashboard/dashboards/migrating-from-universal-dashboard-2.9#authentication-and-authorization

There is also some information here: https://docs.ironmansoftware.com/config/security#authorization

So, reading this over, It wouldn’t just be moving from:

$User.HasClaim(“http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid”, “S-1-5-21-4237598787-2812544678-794467769-137112”)

to

$User.Claims(“http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid”, “S-1-5-21-4237598787-2812544678-794467769-137112”)

Is this method of claim no longer supported?

The $User object is of a different type now. That said, after writing this up, I think we should introduce a HasClaim method so you dont have to change this at all. I’ll put that on the backlog.

This is the structure of the $User object.

public class ClaimsPrincipal
{
    public List<Claim> Claims { get; set; } = new List<Claim>();
    public Identity Identity { get; set; } = new Identity();
}

public class Identity 
{
    public string Name { get ;set; }
}

public class Claim 
{
    public string Type { get; set; }  
    public string Value { get; set; }
    public string ValueType { get; set; } 
    public string Issuer { get; set; }
    public Dictionary<string, string> Properties { get; set; } = new Dictionary<string, string>();
}

Ok, i think i can work around that in the meantime…

Second question is how do i set those policies on the pages themselves? New-UDPage does not seem to have anything for Roles or AuthorizationPolicy?

That is a miss on my part. I’ll put that in the backlog too. i didn’t even realize that was missing.

Hi Adam, can you confirm that the automatic $Roles variable is implemented in PowerShell Universal release v.1.2.9?

User x is part of serveral roles (see logging), but the $Roles variable is empty.

[logging]
[INF] Evaluting claims for user x (b92e9e9d)
[INF] user x is part of role Administrator (2878f509)
[INF] user x is part of role Operator (7a62f33c)
[INF] user x is part of role Reader (4a0a48a3)

Just attempted migration of a UD 2.9.0 site to Universal on FW 2.9.1beta6, following the doc,
I noticed that some items were not listed which I have had to remove from new-uddashboard:
-AdminModeAuthorizationPolicy
-IdleTimeout
-NavBarLogo
-NavBarColor

However after doing this I appear to be stuck (dashboard still wont start), I’m not getting anything tangible in my log to work with either:
[07-23-20 12:11:23 AM] Creating services.
[07-23-20 12:11:23 AM] Starting scheduler.
[07-23-20 12:11:24 AM] Failed to get dashboard. One or more errors occurred.
[07-23-20 12:11:24 AM] Dashboard configuration complete.

Anyone have any ideas where i can go with this?

We just released a new build of 1.2 with a fix for the roles. You should have access to the roles variable now.

1 Like

That’s a new one. It looks like it’s throwing some error while configuring the scheduler. Configuring the scheduler is about the last thing it does before starting up.

Are you using scheduled endpoints? I can get some better logging in there to unroll the aggregate exception that is being throw (One or more errors occurred).

                GrpcLogger.LogInfo("Starting scheduler.");

                _scheduledEndpointManager.StartAsync(new CancellationTokenSource().Token).Wait();

                EndpointService.Instance.ScheduledEndpointManager = _scheduledEndpointManager;
            }
            catch (Exception ex)
            {
                GrpcLogger.LogError("Failed to get dashboard. " + ex.Message);
                _client.startupError(new stringMessage());
            }

            GrpcLogger.LogInfo("Dashboard configuration complete.");

Yeah it was the schedules, I’m dotsourcing a file for those so just commented it out for now and it started up. I’ll try to fiddle around with it a bit more and see if theres anything in particular thats causing the problem.

I just tried to access the page now that its running and i’m getting a blank white screen, nothing else in the log to show any errors etc. Also tried accessing a page directly in the url but it’s still the same. I’ll play about some more and let you know if I find the cause

Can you look in the F12 developer tools of your browser? I wonder if we have a JS error.

:grimacing:

It looks like one of the components is messed up. The style is not defined error is what is causing the issue. Somewhere, we are using the style variable without defining it. If you click the bundle.js:110 or line 236, you might get a hint as to what component is doing it. Unfortunately, it looks like your map files aren’t loading so it might be minified JavaScript code that it will point you to.

If you have some time to spare tomorrow, I’d be happy to do a quick Zoom so we can get to the bottom of this.

Hey, sorry I didn’t get chance to look at this earlier. Thanks for the pointers, I found that it was the ud footer, after commenting out it started up fine. :+1:

Interesting. Can you send me a snippet with your UDFooter code and I’ll add it to a bug?