I’m trying again now I have some breathing space - I feel like I’ve probably given this two good go’s before but it’s been ages. Currently, I’m having issues with my ServerStartup.ps1 script which runs on psu startup.
Now this is exactly how it used to run in v4.
But in v5.5.4 I’m getting the following error: No dashboard found with name ''
Any ideas?
Additional info:
windows server, running as a service (as a service account not system)
https with self signed cert, oidc
v5.5.4 (new server, clean install, repo cloned across)
migrating from version: v4.5.4
I’ve tried with and without -Integrated (omitting -TrustCert entirely) but still getting the same issue.
I was just wondering if it is because I didnt ‘create’ the dashboard via the GUI and instead just cloned my repo and the universal\dashboards.ps1 which had the app defined.
I renamed my app folder and deleted it from the GUI, then manually created the dashboard in the GUI and copied the files back into the new folder, but even after doing this, i’m still getting the same issue, I’m stumped.
Also tried app settings api security model in Permissive and Integrated mode, with no difference between either.
Hopefully the last issue now, but I’m unfortunately getting assembly conflcts with Graph modules (in my automation scripts)
The 'Get-MgUser' command was found in the module 'Microsoft.Graph.Users', but the module could not be loaded due to the following error: [Could not load file or assembly 'Microsoft.Graph.Authentication, Version=2.28.0.0, Culture=neutral, PublicKeyToken=xxxxxx'. Assembly with same name is already loaded]
I’ve tried the following so far:
Initially copied the same modules in use from my server running PSU v4 (this didnt work)
Uninstalled Az and Graph modules
Reinstalled latest versions via the GUI within PSU
Updated Powershell Core on the server to the latest version
I’m wondering if this is because my scripts are running in Integrated mode and there’s some bundled modules in PSU?
Unfortunately I’m restricted to only running in Integrated, this has been the case forever for me, in PSU v4 it was due to GPRC issues with squid proxy, and in PSU v5 when trying to run in anything else other than integrated the scripts timeout in a similar way - I think it’s the same or similar issue from v4.
Any advise how I can workaround or fix this is appreciated
What other modules are loaded in the session? I’ve seen this with PnP.PowerShell because it bundles and loads an old version of Microsoft.Graph.Core.dll. If you’re using any modules that do this in integrated mode, and that module gets loaded before any commands in the Microsoft.Graph module are invoked, this could be your problem.
If you’re using PnP.PowerShell specifically, install the latest pre-release to resolve.
Appreciate the suggestion. I do have pnp module in my modules folder, but I’m not importing or calling it before this script runs after a clean server reboot. Though I’ll remove it/update it tomorrow and give it a retry to see if that helps.
This pointed me in the right direction, there was a Microsoft.Graph module hiding in c:\prog files\ windows powershell\modules, looks like that was causing the issue, must have been autoloading that one instead of in my PSU modules folder and conflicting with the newer version. After removing its working fine
Thanks again both for your help, I can now say I’m finally on PSU 5
There’s another really bizarre issue, and I’m just going to mention it here incase anyone else comes across it.
I thought i was home free until I noticed that my ServerStartup.ps1 script which is set to run at PSU startup - it connects to azure, well it was throwing the error “Could not find tenant id for provided tenant domain…” oddly, the tenant id in the error message was the correct tenant, and the crednetials/app id, also correct with the right permissions, nothing has changed here other than I’m using the latest Az.Accounts module (v5.1), anyway, I rolled this back to an ancient version on my other sever (v2.13.0), and that works fine!
I’m going to step it up in version slowly to figure out exactly which version it’s breaking on. Just thought it was an odd one.
I took the same code and ran it manually in VSCode and also noticed no issue with connecting with the latest version either!