Posted By Chris Wollesen on 16 Sep 2019 10:41 AM
I found a previous article here http://burnignorance.com/net-development-tips/dynamically-creating-tabs-and-adding-modules-in-dotnetnuke/ which talks about it a little bit, but it doesn't go into detail about how to get reference to the "portal" when your code isn't running from within the DNN codebase. In my case this will be a windows forms application and within it I will be specifying the SharePoint server (and credentials to connect to it) AND the DNN portal (and credentials to connect to it).
There have been other WF apps that addressed the database.
I think there was one for removing spam users, but I'm not sure were you could find it.
If you google getting the Portal from an http module (.net) you might find your answer as that's also outside of the DNN context.