Implement multi-threading with .NET runspaces in Powershell

There are multiple options on how to implement multi-threading in Powershell. They are all well known to engineers:
- Powershell Jobs
- Powershell Workflows
But there is another one, which is not quite popular (because of it's complexity), but very powerful: .NET runspaces. While it's quite difficult to implement, it don't have main disadvantage of native Powershell ways - we will not spawn tons of powershell.exe processes. All work will be done within a single process and that will highly increase overall script performance.
I will not tell you about theory (mainly because I don't clearly understand details), but will give you some insights and script templates to start moving.
- Hits: 26119
[Updated] Monitoring Azure resources with Zabbix

June 25, 2020
During last year, I've been actively refactoring this solution and finally I've updated this article. All code moved to GitHub where you can clone it to your PC and update as needed.
Also, I've removed all comments as they're not relevant anymore.
Hey!
Today is the great day, as I'm finally going to share my approach to monitoring of Azure Cloud resources with Zabbix. There is no built-in solution for monitoring Azure with 3rd-party software (at least, I know nothing about that), so we'll need to build our own. Before you start configuring\scripting, please make sure you're familiar with most common Zabbix features, because the task is not trivial.
Azure monitoring
Why do we need all this? Well, I've encountered a number of issues, problems and limitations while trying to use native Azure tools - Log Analytics (to paint graphs) and Monitor (to configure alerting). Metrics could appear there with big delays, problems with writing queries, triggering - is also a problem.
So, we've decided to adopt Zabbix for monitoring of Azure...
- Hits: 123247
Installing Zabbix cluster in Azure Cloud on CentOS VMs

Z for Zabbix
As we all know, monitoring is a huge part of operations and, in my case, DevOps activities. It's one of the elephants, on which any software maintenance rely on, I would say.
Back to the ground, Azure Cloud is a nice platform, but still, it doesn't have "real" monitoring solution. Not for VMs, nor for any other it's resources. You can say - it has OMS and Azure Monitor, but I've encountered so many limitations and issues with it... Well, my point - is to develop your own bicycle monitoring system to match your environments and needs.
Today I'll try to introduce my solution which is: highly avaliable, free and cloud-based.
- Hits: 10937
Get all images list for VMs in Azure

When you build your environment in Azure Cloud using IaaC (Infrastructure as a Code) approach, sometimes you will face issues during re-deployment. That's because guys from Microsoft update their VM images with new versions of software. As a result, these new images have new IDs and you must update your ARM or Powershell scripts.
I wrote a script that will help to find new versions of images.
- Hits: 11974
Find servers with MS SQL Server installed with Powershell

Here is the script that will find servers in your domain with Microsoft SQL Server installed.
Script can handle unresponsive servers with pings via WMI calls, which is useful if ICMP blocked for some reason. Also - I'm using Powershell Remoting, so please be sure it is enabled on your servers.
- Hits: 7217
Transparent Data Encryption / TDE in SQL Server: enable, keys & certificates, backups, restore

Transparent Data Encryption (TDE) encrypts SQL Server, Azure SQL Database, and Azure SQL Data Warehouse data files, known as encrypting data at rest. You can take several precautions to help secure the database such as designing a secure system, encrypting confidential assets, and building a firewall around the database servers. However, in a scenario where the physical media (such as drives or backup tapes) are stolen, a malicious party can just restore or attach the database and browse the data. One solution is to encrypt the sensitive data in the database and protect the keys that are used to encrypt the data with a certificate. This prevents anyone without the keys from using the data, but this kind of protection must be planned in advance.
- Hits: 7722
How to remotely restart Windows service with Powershell

In case if you need to remotely restart Windows service, here is my Powershell script.
As soon as we have ICMP/ping disabled between our development environments, I've used WMI pings to determine, if remote machine is running.
- Hits: 7710
More Articles …
Page 2 of 13