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 …

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 …

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 …

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 …