Category: Powershell

Restart Computers by OU

#RestartComputersbyOU.ps1 Import-Module ActiveDirectory $ou = “CN=Computers,DC=domain,DC=local” $computers = Get-ADComputer -Filter * -SearchBase $ou ForEach ( $c in $computers ) { Restart-Computer -ComputerName $c.name -Force }  

Restart Computers in Sequential Order

Restarting servers is a necessary evil in a Windows administrator’s world.  Unfortunately, you cannot not always just restart servers during maintenance as they may have a service dependent on another server.  Due to this, you may need to restart your servers in sequential order.  Luckily, powershell 3.0 makes this quite easy using the restart-computer commandlet.  …

Continue reading

365Licenses.ps1

#========================================================================= # 365Licenses.ps1 # VERSION: 1.0 # AUTHOR: Brian Steinmeyer # EMAIL: [email protected] # WEB: https://sigkillit.com # DATE: 4/4/20114 # REQUIREMENTS: # 1) Microsoft Online Services Sign-In Assistant for IT Professionals # -(http://www.microsoft.com/en-gb/download/details.aspx?id=28177) # 2) Windows Azure Active Directory Module for Windows PowerShell # -(http://technet.microsoft.com/en-us/library/jj151815.aspx#bkmk_installmodule) # COMMENTS: This script is intended to retrieve Office 365 …

Continue reading

Modify Proxyaddresses Domain

This powershell snippet is used to replace a domain in all values in a user’s proxyAddresses attribute.  It requires using Microsoft’s ActiveDirectory module.  It is is capable of bulk modifying all users in an OU or can modify a single user if you specify their DN.  In the script below, modify the SearchBase and replace …

Continue reading