Category Archives: Microsoft

Find Missing Subnets in Active Directory

This is a very manual task of logging onto each domain controller and copying the file to a central location, and then sifting through the data to remove any duplicate IP addresses etc. This task becomes very time consuming if you have a large number of domain controllers.

Find Deferred Messages in Exchange

Here is a quick little one liner to find all the deferred messages with FromAddress, Recipients and DeferReason. Get-TransportServer | Get-Queue | ?{$_.Identity -like ‘*submission*’} | get-message -IncludeRecipientInfo | ?{$_.Status -eq ‘Retry’} | select FromAddress,Recipients, DeferReason

PowerShell Random Password Function

Generating a password with PowerShell is relatively easy if you leverage a particular method of .Net, System.Web.Security.Membership. Add-Type -AssemblyName System.Web[System.Web.Security.Membership]::GeneratePassword(8,2) Simple and to the point. But below is a pretty good function to do something similar, if you are curious about string operations with PowerShell. function Get-RandomPassword($length){    $length-=1    $lower = ‘abcdefghijklmnopqrstuvwxyz’    $upper = $lower.ToUpper()    $number = 0..9    $special=’~!@#$%^&*()_+|}{[]\’    $chars = “$lower$special$upper”.ToCharArray() $pass = Get-Random -InputObject… Read More »

Find Active Directory Computers by OS

Finding machines in Active Directory is pretty easy using the Get-ADComputer commandlet. You can specify what to find by any number of parameters. For example, the most basic use of the commandlet is: Get-ADComputer -Filter * The above code will return all Active Directory computer objects. But lets say you are in the process of upgrading operating systems across the domain, and… Read More »

Set your signature in OWA

Ever get tired of adding a signature block to an email? Typing your name and other info every time you write an email? Here is how to get rid of that tedium with Outlook for the web.

Use PowerShell to see who Rebooted a Server

Let’s say one of the production servers got rebooted unexpectedly and you would like to find out who rebooted it and when the server got rebooted. In PowerShell, you can take a look at the event log using the PowerShell one-liner command shown below. You don’t need to write a bunch of lines in a script and then… Read More »