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:

Send SOAP message from Powershell

Today I want to give you example how to send SOAP message from Powershell. Nowadays is very popular that most of the applications have API interface for external applications to be used. New applications use REST web service instead of SOAP, because JSON syntax is simpler than XML. However sometimes there is a need to collect data from older, SOAP based applications and today I wanna show you how to …

Get cluster information remotely using PowerShell

Today I want to show you how to get cluster information remotely using simple PowerShell function. To pull all needed information about our cluster we will use some dedicated cmdlets which can be found here. On the beginning script will check if module for failover clustering is installed – Import-Module FailoverClusters. Then we need to ensure that server provided as a parameter exist and cluster service is running. To do …

Gathering O365 calendar information via Powershell

Today I want to share with you my experience with gathering O365 calendar information via Powershell. Office 365 is currently the most popular service to provide access to Microsoft Office tools including mail account. Sometimes information from calendar are very usefull, for instance when work time registration is included in Office 365 calendar If we want to create report with details about user tasks, we can take it directly from …

How to check Web Application Pools status and restart IIS remotely on multiple servers?

During work in large scale ADFS environment there is often situation when you are forced to quickly restart IIS on multiple machines. Of course you won’t spend whole day doing this manually. In this article I would like to share one of my scripts which will help to determine the status of Web Application Pools and then restart IIS if needed. On the beginning of this script I added some …

How to copy groups membership from reference account?

Recently I received task to copy groups membership from reference account. Function which I’ve prepared is not very complicated. To create this I used Active Directory module. In first step function gather memebrship of the reference user and save them in groups array. Once array is completed AD module function Add-ADGroupMember is used (for details check https://technet.microsoft.com/pl-pl/library/ee617210.aspx). Usage: Copy-GroupMemebrship -ReferenceAccount “SANofRefAccount” -ReferenceAccountServer “RefAccountServer” -AccountToChange “SANofAccToCahnge” -DomainAccountToChange “DomainofAccToChange” I hope it …

Get list of unhealthy SCOM agents (grey state) using PowerShell

Today I want to show you how easily you can get the list of unhealthy SCOM agents using PowerShell. In this example I used Microsoft.Windows.Computer class for scanning all of those SCOM agents which availability state equals false: In results $SCOMArray you will find additional information like “Primary Management Server”, “last modified date” and check if it’s “in maintenance mode”. Script needs to be run on SCOM server. Final script: …

Pull server name from ADFS eventlog and check LDAP connection

When it comes to ADFS, network connectivity to the global catalog servers is one of the most important aspects. You may often see in ADFS logs that LDAP server returned a specific error when it was queried or it’s even unresponsive. As an engineer you need to determine either its temporary network connectivity problem or maybe something wrong with one of your Domain Controllers. I also had this problem so …

How to gather SCCM device collections

If you was working with System Center family, you know purpose of SCCM device collections from SCCM. For those who didn’t have a chance to deal with this I strongly reccomend to read article https://technet.microsoft.com/en-us/library/gg682177.aspx. System Center Configuration Manager console allows user to check all collections to which specific device belongs. What in case that customer want to have a list of collections for some reports? Of course you can …