Archives

Dealing with credentials in PowerShell

Whenever you write PowerShell scripts that are going to be used for automation you need to secure your credentials. The best practice is to use a service account to execute the PowerShell script and delegate whatever privileges it needs to execute. When dealing with internal systems and resources that are usually pretty easy if they […]

Read More

On-prem AD vs Office365

When using a local Active Directory connected to Office365 via Azure Active Directory and Azure AD Connect you will run into issues controlling Exchange features via Active Directory. Here is a quick guide how to manage it anyway. The problem When you connect your local Active Directory via Azure AD connect to sync everything with […]

Read More

Powershell: IIS Application Pool Killer

Every now and then IIS application pools lock up and needs to be killed. You can add the field PID in Task Manager and then use cmd tools to find which one of the IIS Worker Process is the right one and kill it. I created a simple script that lists all the IIS Application […]

Read More

Powershell: Pending Windows Updates

Every now and then you need to check if your servers or client computers have pending updates. You can generate a simple list of this with Powershell. I have created a script for this on my Github named ListPendingWindowsUpdates.ps1. Here is a quick breakdown of the script, feel free to use and modify it anyway […]

Read More

Powershell: Manage folder permissions

Working with folder and share security is to often treated as set and forget. A good practice is to run daily jobs to check, report and reset permissions on shared folders and home directories. There are several ways to do this but it can easily be done from Powershell. This can also be used when […]

Read More

Powershell: Manage IIS SMTP server

Setting up Microsoft Internet Information Services (IIS) SMTP service is pretty straight forward for simple implementations. It hasn’t really keept up with time and I’m pretty sure not to many people use it anymore. Working with an older implementation in a system that used distributed SMTP on each and every IIS server I realized we […]

Read More

Exchange – List all e-mail addresses on domain

Listing all e-mail addresses for a domain on an Exchange server. It’s pretty easy from Powershell but it took me a while to figure out so I thought I would share it. [ps]get-recipient | where {$_.emailaddresses -match “<domain>”} | fl name,emailaddresses >> c:addresses.txt[/ps]

Read More

View Members Dynamic E-mail Group – Exchange 2010

Always nice to be able to check who a dynamic group contains. Easy to do from the powershell with these two commands: [ps] $DynGroup = Get-DynamicDistributionGroup "{name of dynamic distribution group}" Get-Recipient -RecipientPreviewFilter $Dyn.RecipientFilter -OrganizationalUnit $DynGroup.RecipientContainer [/ps]

Read More