Powershell – Get Installed Microsoft Outlook Version with WMI

Dec 22, 2011 • Jonathan -

This script is tailored to determine the current version of Outlook 2003, however you can adjust the version numbers to locate other versions of Outlook without much work.

$outlook11Versions = @("11.0.5608.5606","11.0.5608.5703","11.6359.6360","11.6568.6568")

$q = New-Object System.Management.ObjectQuery
$q.QueryString = "Select * from Win32_Product Where Caption Like '%Microsoft Office%'"
$s = New-Object System.Management.ManagementObjectSearcher($q)

$s.Get() | ForEach-Object {
	if ($_.Name -like "*Outlook*") {

		# check for outlook 2003
		for ($i=0; $i -lt $outlook11Versions.Length; $i++) {
			if ($_.Version -eq $outlook11Versions[$i]) {
				$old = $True
				$found = "Outlook 2003 " + $_.Version
			}
		}
	}
}

if ($old) {
	Write-Host $found -ForegroundColor Red
}
else {
	Write-Host "newer than 2003" -ForegroundColor Green
}
.



Changing Permissions on All GPOs In Domain

Nov 2, 2011 • Jonathan -

How-to automate changing permissions on ALL GPOs in a domain via script. Microsoft provides sample scripts for changing permissions on all GPOs. The steps are outlined below describe how to change permissions on all GPO objects in a domain.

  • Download and install the Group Policy Management Console
  • Download and install the Group Policy Management Sample Scripts
  • Open a command prompt, change directory to the newly install sample script folder and run the update permissions script. You need to run these scripts with the Windows cscript utility:
    cd "C:\Program Files (x86)\Microsoft Group Policy\GPMC Sample Scripts"
    cscript GrantPermissionOnAllGPOs.wsf "Some Group" /Permission:FullEdit /domain:yourdomain.com
    

</pre>

  • Select “Y” at the following prompt, this may take awhile depending on how many GPO objects you have configured in your environment:
    GrantPermissionOnAllGPOs.wsf Warning
  • Done.
.



Exchange 2010 – Moving the Discovery Search Mailbox

Oct 6, 2011 • Jonathan -

Moving the Discovery Search Mailbox in Exchange 2010 is a relatively simple process. Chances are you are trying to remove the default database created by Exchange 2010 setup and it won’t let you because of this mailbox. Finding and moving the arbitration mailbox is outlined below.

Get a list of arbitration mailboxes:

Get-Mailbox -Arbitration

Move the arbitration mailboxes:

Get-Mailbox -Arbitration -Database db1 | New-MoveRequest -TargetDatabase db2

Exchange 2010 - Moving Discovery Search Mailboxes

.



Installing Hyper-V Linux Integration Services v2.1 in CentOS 5

Oct 3, 2011 • Jonathan -

Quick walthrough for installing the Hyper-V Linux Integration Services v2.1 in CentOS 5.x. Installing the integration tools gives enables several features. In my case I wanted support for synthetic NICs. The features you gain are listed below followed by installation instructions.

  • Driver support for synthetic devices: The Linux integration components include support for both the synthetic network controller and synthetic storage controller that have been developed specifically for Hyper-V. These components take advantage of the new high-speed bus, VMBus, which was developed for Hyper-V.
  • Fastpath Boot Support: Boot devices now take advantage of the storage VSC to provide enhanced performance.
  • Timesync: The clock inside the virtual machine will remain synchronized with the clock on the host.
  • Integrated Shutdown: Virtual machines running Linux can be shut down from either Hyper-V Manager or System Center Virtual Machine Manager, using the “Shut Down” command.
  • Symmetric Multi-Processing (SMP) Support: Supported Linux distributions can use up to 4 virtual processors (VP) per virtual machine.
  • Heartbeat: Allows the host to detect whether the guest is running and responsive.
  • Pluggable Time Source: A pluggable clock source module is included to provide a more accurate time source to the guest.

Installing Hyper-V Linux Integration Services v2.1:

  • Download Linux Integration Services v2.1 for Windows Server 2008 Hyper-V R2
  • Install CentOS
  • Install the development tools: <pre class="brush: bash; title: ; notranslate" title="">yum groupinstall “Development Tools”</pre>

  • Mount the integration services ISO: <pre class="brush: bash; title: ; notranslate" title="">mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom</pre>

  • Copy the contents of the cdrom to the machine and unmount the cdrom: <pre class="brush: bash; title: ; notranslate" title="">mkdir /opt/linuxicv21 cp –R /mnt/cdrom/* /opt/linuxicv21 umount /mnt/cdrom

</pre>

  • Install the integration tools: <pre class="brush: bash; title: ; notranslate" title="">cd /opt/linuxic21/ make make install

</pre>

  • If you’re running x64 you’ll need to install adjtimex. Insert the CentOS install dvd then: <pre class="brush: bash; title: ; notranslate" title="">rpm –ivh /mnt/cdrom/Centos/adjtimex-1.20-2.1.x86_64.rpm

</pre>

  • Reboot the VM: <pre class="brush: bash; title: ; notranslate" title="">reboot

</pre>

  • Check that the integration services are running:</p> <pre class="brush: bash; title: ; notranslate" title="">/sbin/lsmod grep vsc

</pre>

.



Exchange 2010 SP1 Edge Transport Installation

Sep 21, 2011 • Jonathan -

  • Install Windows 2008 R2 SP1
  • Run Windows Update and download all available updates
  • Set the computer name & static IP information
  • Install all necessary pre-requisites, from powershell:
    Import-Module ServerManager
    Add-WindowsFeature NET-Framework,RSAT-ADDS,ADLDS -Restart
    • Navigate to the location of the Exchange 2010 SP1 install files and run:
      setup.com /mode:install /roles:EdgeTransport,ManagementTools

      You should get something like this:

      Welcome to Microsoft Exchange Server 2010 Unattended Setup
      
      

Setup will continue momentarily, unless you press any key and cancel the installation. By continuing the installation process, you agree to the license terms of Microsoft Exchange Server 2010. If you don’t accept these license terms, please cancel the installation. To review the license terms, please go to

http://go.microsoft.com/fwlink/?LinkId=150127&clcid=0x409/

Press any key to cancel setup……………. No key presses were detected. Setup will continue. Preparing Exchange Setup

Copying Setup Files                           COMPLETED

The following server role(s) will be installed Languages Management Tools Edge Transport Role

Performing Microsoft Exchange Server Prerequisite Check

Configuring Prerequisites                                 COMPLETED
Language Pack Checks                                      COMPLETED
Edge Transport Role Checks                                COMPLETED

Configuring Microsoft Exchange Server

Preparing Setup                                           COMPLETED
Stopping Services                                         COMPLETED
Copying Exchange Files                                    COMPLETED
Language Files                                            COMPLETED
Restoring Services                                        COMPLETED
Languages                                                 COMPLETED
Exchange Management Tools                                 COMPLETED
Edge Transport Role                                       COMPLETED
Finalizing Setup                                          COMPLETED

The Microsoft Exchange Server setup operation completed successfully. Setup has made changes to operating system settings that require a reboot to take effect. Please reboot this server prior to placing it into production. </pre>

  * Restart the server: 
    <pre>shutdown /r /t 0</pre></ul> 

I&#8217;ll detail setting up the Edge subscription in another post.
.



Exchange 2010 – Monitoring Back Pressure on Edge Servers

Sep 19, 2011 • Jonathan -

Monitoring Exchange back pressure messages is a way to detect when your Exchange 2010 server might be at risk of becoming unavailable due to resource overload.

Exchange 2010 Back Pressure Event Log

The Exchange Hub Transport and Edge Transport servers log a several differnt event log messages when resource utilization passes defined thresholds. Specifically, you want to monitor for EventIDs 15005, 15006, and 15007. You can read more about these Event IDs at the Understanding Back Pressure: Exchange 2010 SP1 article on Technet.

Event log entry for an increase in any resource utilization level – Event ID 15004

Event Type: Error
Event Source: MSExchangeTransport
Event Category: Resource Manager
Event ID: 15004
Description: Resource pressure increased from Previous Utilization Level to Current Utilization Level.

Event log entry for a decrease in any resource utilization level – Event ID 15005

Event Type: Information
Event Source: MSExchangeTransport
Event Category: Resource Manager
Event ID: 15005
Description: Resource pressure decreased from Previous Utilization Level to Current Utilization Level.

Event log entry for critically low available disk space – Event ID 15006

Event Type: Error
Event Source: MSExchangeTransport
Event Category: Resource Manager
Event ID: 15006
Description: The Microsoft Exchange Transport service is rejecting messages because available disk space is below the configured threshold. Administrative action may be required to free disk space for the service to continue operations.

Event log entry for critically low available memory – Event ID 15007

Event Type: Error
Event Source: MSExchangeTransport
Event Category: Resource Manager
Event ID: 15007
Description: The Microsoft Exchange Transport service is rejecting message submissions because the service continues to consume more memory than the configured threshold. This may require that this service be restarted to continue normal operation.
.



Exchange 2010 – Error: The operation couldn’t be completed because a change occurred in the remote forest.

Sep 12, 2011 • Jonathan -

When you open the Exchange Management Console (EMC) you may receive an error that the initialization failed and “the operation couldn’t be completed because a change occurred in the remote forest”. This can happen when the Exchange 2010 server you are connecting to has been updated with a Service Pack or Roll Up Update (RU). This happens an awful lot when you are attempting to install the EMC on a Windows 7 machine.

The following error occurred while configuring Help links:
The operation couldn't be completed because a change occurred in the remote forest.
Please complete any operations that are in progress, restart the Exchange Management Console, and follow the help instructions to obtain a compatible upgrade.

Exchange 2010 EMC Initialization Error

You can check the versions by running the Exchange Management Shell cmdlet below.

Get-Command EXSetup | %{$_.FileVersionInfo}

This checks the file version for the local instance of ExSetup.exe on both the client and the server, by default this is located in C:\Program Files\Microsoft\Exchange Server\V14\bin. You can determine what version by checking the Exchange Server and Update Rollups Builds Numbers article on Technet.

Apply the proper update to the machine you are running the EMC on and you should be good to go.

.



Exchange 2010 Management Tools – A reboot from a previous installation is pending.

Aug 19, 2011 • Jonathan -

When attempting to install the Exchange 2010 Management Tools I was receiving an error “A reboot from a previous installation is pending.”. Turns out this was due to a reg key that was referencing printers that were being installed via GPO/Pushprinters.

To resolve this I deleted the following reg key:

HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\PendingFileRenameOperations

As always, when making registry changes, be sure you backup the key before you delete it.

.



Find AD account Associated With Email Address in Active Directory

Jul 29, 2011 • Jonathan -

To determine which AD account a particular email address is associated with follow the steps outlined below.

  • Open Active Directory Users and Computers on a computer with the Exchange management tools installed.
  • Right click on the root domain and select “Find”
  • Under “Find” select “Custom search”
  • Click the “Advanced” tab
  • Enter: proxyAddresses=SMTP:[email protected]
  • Click “Find Now”

.



Generate File of a Determinate Size in Windows With Powershell

Jul 27, 2011 • Jonathan -

Sometimes it’s necessary to generate files of random sizes for testing purposes. Here’s how to do this Powershell.

$file = new-object System.IO.FileStream c:\tmp\file.dat, Create, ReadWrite
$file.SetLength(42MB)
$file.Close()
.



subscribe via RSS