FSMO roles report from Powershell

Today I want to share with you my script to gather FSMO roles report from Powershell. Many times, when I was managing big Active Directory environments I want to find domain controller with specific FSMO role. Of course I could go to Active Directory snap ins and check it manually, but why do it for one server if I can gather all FSMO roles from whole AD forest. At the …

Check scheduled tasks on localhost or remote servers

In this article we will focus on how to get information about scheduled tasks from localhost or remote machines. Function is based on command Get-ScheduledTask which is available starting from Windows Server 2012 in module ScheduledTasks: Basically we can get information about tasks using above 1 liner but just for fun we can create this function. It will allow us to specify state of tasks which we would like to …

Azure invoices are now available via API!

Today I want to talk about Azure invoices. Till now Azure invoices was available to download only from Azure Management Portal, but since last week it was changed. Now user which has proper access to subscription (Billing Reader and proper administrative access) can download Azure invoices programatically. However there are some limitations. API does not allows to download invoices for following subscription types: • Enterprise agreements • Support • Azure …

Recycle Web App Pool using PowerShell Function

Today we will go through process for creating PowerShell function which will recycle Web App Pool remotely. For those who are working with Web Applications this might be helpful. To recycle/restart single Web App Pool we can use one of the commands available in WebAdministration module – Restart-WebAppPool: First step which you have to do is adding your Web App Pools in param sections [ValidateSet(“.NET v2.0″,”.NET v2.0 Classic”,”.NET v4.5″,”.NET v4.5 …

Scheduled task creation using Powershell

Let’s talk today a little bit about how to create scheduled task using Powershell. Windows admins who created big number of task scheduler jobs know that is not very fascinating job. There is a lot of clicking and it’s really boring. So let’s automate it!. First of all you should define $action scriptblock in which your custom script should be pasted and name of the task. In next step job …

How to check servers Up Time and other system information

Today I want to show how easily check servers Up Time and other useful system information with PowerShell. To get all details we will use Get-WmiObject command. Get-SystemInfo function will collect system information like: – Domain – Organization – Machine type – Operating system – Version – Build Number – OSArchitecture – Up Time – Network adapter and IPv4 address – Physical RAM – C:\ Drive free space – Memory usage …

Add AD group to local administrators of the server

Today post will help you to understand how add AD group to local administrators. Below script in first way is searching Active Directory for servers with Windows Server OS (this can be filtered deeper with LDAP filter adjustment). Once all computers objects are gathered script create AD group. Name of the AD group uses pattern ADMComputerName. When AD group is created it’s added to local administrators group of the server. …

Using PowerShell to perform DC health checks (DCDIAG, REPADMIN)

Below you can find another great and useful PowerShell function for checking DC health (DCDIAG, Repadmin) remotely. Please also check out one of the latest article for creating basic DC health email report. DC health checks There are several commands known for basic Domain Controller troubleshooting. In this function we focused on DCDIAG and Repadmin as they are used probably in every situation. On the beginning of script I added …

Updating DNS alias using Powershell

Hello Folks, today we will talk a little bit about updating DNS alias record. Recently I want to change DNS alias record name to the new one, however doing it manually is not possible. Alias name field is not editable, there is only an option to change target host.   It’s also not possible directly from powershell, but I’ve created a function which will: – automatically delete old record, – …

Use PowerShell to check if specific hotfix has been installed on servers

In this article we will focus on how to check if specific hotfix has been installed on servers? Most of you had probably similar issue when after patching cycle something stopped working or some service functionality was limited. Often culprit is one of new installed patches. This is why I created simple function which will help us to search if specific KB has been installed on servers. Usage: Final script: