Reboot server remotely via PowerShell

Reboot 🙂 I guess that all of the server administrators had this situation when server was not responding. If you don’t have access to iDRAC, iLO .etc the only way to fix the issue will be rebooting server remotely. So today I would like to show you couple of ways to do that. The easiest way is to run cmd as an administrator and use command: SHUTDOWN /r /f /t …

How to export KeyVault certificates from Azure?

Todays article will describe how easly download KeyVault certificates (including private keys) to your computer. It can be very usefull in scenario where you want to authenticate to some web application but certificate is needed. It is not so easy to download certificate, including private key directly from Azure portal – for me it was impossible 🙂 In first way you must define password which will be used to install …

Pull out Azure metrics from each resource

I want to tell you a little bit about Azure metrics and how they can be usefull for you. For instance, if organization already has some monitoring system and don’t want to use Azure alerting for monitoring purpose it can use data from Powershell. Information taken from Powershell can be send via some API to monitoring system and that’s all. You’ve got custom solution without using alerting directly from Azure …

Create your first PowerShell function

For those who are starting their journey with PowerShell I prepared today short article describing how to create first simple function. To makes things a little bit complicated I added if/else conditions to give better functionality to our script. Function name is called Get-Sessions and it will check for Active Directory users sessions and status on some particular server.   I used if/else conditions to make sure that person who …

Secure resources in your Azure subscription by simple Powershell script

Today I want to tell you a little bit about Azure locks. Frequent problem which I observed in some of the organizations is unexpected removal of resources. Situation is always the same, user created some test resource group and another user remove this resource group. Explanation is always similar to “I thought that is not used anylonger”. Locks can help with preventing this kind of situation. There are two types …

How to put servers in SCOM Maintenance Mode?

As some of you already know SCOM 2016 finally have a new feature called – Maintenance Schedules. It allows us to plan Maintenance Mode for several computer objects using GUI: For those who didn’t migrate yet their SCOM infrastructures to 2016 version it might be hard to schedule maintenance mode during planned activities like weekend patching. I also had this problem so I developed a script and added it to …

Powershell and Azure – how to begin?

I want to share with you my beginner experience with Azure Powershell module. Microsoft Azure is one of the most popular public cloud provider in the world. Platform is available in 38 regions ( and still growing). For those who didn’t check yet this I strongly recommend Azure docs site where all documentation reside. Azure Powershell is divided into two models. ARM – Azure Resource Manager (for more read about …

How to check SCOM Maintenance Mode history?

In this article I would like to show you quick and easy way to get detailed information about last SCOM maintenance mode. To gather SCOM MM history we have to use Operations Manager PowerShell cmdlets available here. After providing server name script will gather the following information: – Start Time – End Time – Scheduled End Time – User – Reason – Management Group – Comments In our other article you …

Testing connection to secure channel ( Test-NetConnection )

I recently worked on script which gather all needed information for basic DC troubleshooting. One of the steps is to test netconnection to secure channel from affected Domain Controller on following ports: 88, 135, 139, 389, 464, 636, 3268, 3269. First thing is to find out which secure channel is currently set on this DC. To do this I used the following nltest command: nltest.exe /sc_query:yourdomain.com PS C:\windows\system32> nltest.exe /sc_query:yourdomain.com …