Different ways I have automated Processes using Powershell.

Using AzureAutomate to replace all Scheduled Tasks.

I found that scheduled tasks just suck. You cannot go back and see what happened to the scheduled tasks. When you have to change a password to say a service account you have to change each scheduled task. It also can keep your SQL creds and other creds out of your code out of the box. I’ll post some examples

You can implement Source control with your Azure DevOps. So, when you push changes from your repository, it will add to your runbooks.
Scheduling can be very customized
So, you can store anything. I store SQL info, APPIDs / Secret, this can also store certificates which you can call with some commands I’ll show below.
As you can see here you can assign the Credential to a Variable.
You can drill down in a job and see what happens. Instead of Write-Host you will have to use a Write-Output. This will effectively show you what the script did.
You can use the All Logs tab to see more granular information. It will show you any errors or warnings. There is also an option to run everything in verbose.

There is so many things you can use with AzureAutomate, just explore. There is also a feature to have a run AS account for your hybrid worker / Azure worker. So, you can run all the scripts as a single user. I forget to talk about pricing but for the most part I run close to 4K jobs daily and the cost is around 20 dollars a month.

Using Microsoft Forms / PowerApps + Flow + To Azure Automate.

This allows you to quickly make a form you can hand to the helpdesk team that they can use quickly. You can make this external as well if needed. I do have a form for a vendor we work with so they can add users to a group from their end so they can SSO.

Kurt always breaks things
What the flow looks like on the backend. Basically, takes the information on the form and creates a Job in Azure Automate. If you need to run the command on prem make sure you click advanced under the create job and add the name of your hybrid worker.
What the job looks like on the intake side. Just give it parameters, so when you select it in the flow it will have the parameters already in there, as you can see in the above picture.

Powerapps uses the same concept as above, but you can customize it more than a form. It’s not the prettiest thing in the world since I suck at UI, but it does what you need to do. This PowerApp is mainly given to our helpdesk. I give them access to this instead of direct access to AD / Exchange / O365.

Some quick actions our field technicians have, and you can access this all via Mobile APP which is a cool thing.

Using Universal Dashboard

https://universaldashboard.io This allows you to basically create a website on the frontend but it is all programmed with Powershell which is amazing, and easy to work with. It can use SSO, you can also build API endpoints that you can invoke via rest which is amazing.

This is just an example of a webpage I created for our SOC team. It has a Password never expires, Built-in Admin Accounts, ServiceAccount with Domain Admin Tabs. The following is a modal that allows a helpdesk user build a Admin account, they have to put in the ticket number with the approvals and for the most part it keeps our compliance team happy as all of this info is logged into a SQL database.

There is much more you can do with Universal Dashboard. It is very fun to use but does cost 500 a year for a single website.

Powershell Studios

https://www.sapien.com/software/powershell_studio This is the way I used to build UI Apps with Powershell. It is still relevant, but windows forms / WPF is just old school. I have built 2 apps that our company uses.

The main purpose of this app was to give helpdesk access to perform tasks in a safe manner. So, at this company, we are a hosting provider which means we handle multiple companies. That means that all of the customers sit on the same AD Forest. So, if we were to give helpdesk access to AD / Exchange. They could do something like Get-Mailbox | Set-mailbox which would affect all customers instead of one, that would be a bad day.
We manage a big exchange environment. We also do not have SCCM, but this tool allows you to update Exchange on multiple nodes at the same time, and with exchange you need to properly fail it over before you reboot and turn off bitlocker. This app has been pretty huge to the team, and we use it on a daily basis. Anything that happens in the app writes to a teams channel so everyone in the team is notified if someone is working on a server.

There are soo many ways you can automate with Powershell and I wanted to share my experiences and how these apps have changed my life to make it much easier in the long run. Most of these apps take a very long time to build, but when it is finished, you get soo much relief from the day to day / busy work tasks. If you have any questions on how I used these apps feel free to contact me on LinkedIn.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s