IT Knowledge Base

Technical Repository

HowTo: Windows 2012 R2 Cluster Aware Updating – Enable PowerShell Remote Shutdown

Error when running the Cluster Updating Readiness Analyzer Error: Rule ID: 9 Title: A firewall rule that allows remote shutdown should be enabled on each node in the failover cluster Result: Error Problem: One or more failover cluster nodes do not have a firewall rule enabled that allows remote shutdown Impact: Cluster-Aware Updating may not […]

Read More


HowTo: Powershell – Enable Active Directory Inheritance on all objects

Import-Module ActiveDirectory $users = Get-ADUser -ldapfilter “(objectclass=user)” -searchbase “ou=Domain Users,dc=DOMAIN,dc=CORP” ForEach($user in $users) { # Binding the users to DS $ou = [ADSI](“LDAP://” + $user) $sec = $ou.psbase.objectSecurity if ($sec.get_AreAccessRulesProtected()) { $isProtected = $false ## allows inheritance $preserveInheritance = $true ## preserver inhreited rules $sec.SetAccessRuleProtection($isProtected, $preserveInheritance) $ou.psbase.commitchanges() Write-Host “$user is now inheriting permissions”; } else […]

Read More


HowTo: Add multiple IP’s to Exchange Receive Connector CLI

Return the list of IP’s from the connector: Get-ReceiveConnector “Relay Connector” | fl RemoteIPRanges Add a single IP address to the Connector. We pull the list of existing IP’s and append the new IP and then add the entire list back. $RecvConn = Get-ReceiveConnector “Relay Connector” $RecvConn.RemoteIPRanges += “10.0.0.99” Set-ReceiveConnector “Relay Connector” -RemoteIPRanges $RecvConn.RemoteIPRanges Read […]

Read More


HowTo: Powershell – Disable Drive Indexing

Create a file named Disable_Disk_Indexing.ps1 and copy and paste the following: function Disable-Indexing { Param($Drive) $obj = Get-WmiObject -Class Win32_Volume -Filter “DriveLetter=’$Drive'” $indexing = $obj.IndexingEnabled if(“$indexing” -eq $True){ write-host “Disabling indexing of drive $Drive” $obj | Set-WmiInstance -Arguments @{IndexingEnabled=$False} | Out-Null } } #Use: #Disable Drive Indexing on C:\ Disable-Indexing “C:” Don’t forget to set […]

Read More


HowTo: Powershell – Clear All Windows Event Logs

wevtutil clear-log Application wevtutil clear-log Security wevtutil clear-log Setup wevtutil clear-log System or wevtutil el | foreach { wevtutil cl $_ }

Read More


HowTo: Powershell – Using the Get-Child Cmdlet

Here’s a quick tip on working with Windows PowerShell. These are published every week for as long as we can come up with new tips. If you have a tip you’d like us to share or a question about how to do something, let us know. Fun Things You Can Do With the Get-ChildItem Cmdlet […]

Read More


HowTo: Powershell – Check to see if the previous command completed successfully

The completion status of the previous command can be accessed via the special variable $?. This works best with non-terminating errors, terminating errors are the result of a direct throw or an exception getting thrown in .NET and they alter the flow of your code. Best to use a trap or try/catch statement to observe […]

Read More