Unable to remove product with code yada yada

Hello postini!!
Here we are, another new problem uninstalling Exchange 2007! 😦
Running setup.com /uninstall, see what happened:

C:\Program Files\Microsoft\Exchange Server\Bin>Setup /mode:uninstall
Welcome to Microsoft Exchange Server 2007 Unattended Setup
Preparing Exchange Setup
The following server roles will be removed
 Mailbox Role
 Management Tools
Performing Microsoft Exchange Server Prerequisite Check
Configuring Microsoft Exchange Server
Mailbox Server Role              ......................... COMPLETED
 Exchange Management Tools        ......................... COMPLETED
 Removing Exchange Files          ......................... FAILED
 Unable to remove product with code 24b2c164-de66-44fe-b468-a46d9d5e6b31. Fa
 tal error during installation. Error code is 1603.
The Exchange Server Setup operation did not complete. For more information, visi
 t http://support.microsoft.com and enter the Error ID.
Exchange Server setup encountered an error.

ARGHH!!! WHAT THE HELL IS THIS?!?!?!?
Googling around and trying, I found this solution:
Go to Exchange installation directory (usually C:\Program Files\Microsoft\Exchange Server) and propagate the directory inheritable security permissions.
allow_inheritable_permissions

From my experience, this problem happened in conjunction with this one:
“Process execution failed with exit code 5”
that you can solve looking at the uninstallation log (usually placed here: C:\ExchangeSetupLogs\ExchangeSetup.log) an registering the dll that raises the error.

See ya!

Missing winrm listener

Hey guys!

just a quick tip I found playing with Invoke-Command on a remote machine.

Launching a script remotely with Invoke-Command, I came into this error:

[remotemachine] Connecting to remote server failed with the following error message : The client cannot connect to the d
 estination specified in the request. Verify that the service on the destination is running and is accepting requests. C
 onsult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM.
 If the destination is the WinRM service, run the following command on the destination to analyze and configure the Win
 RM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
 + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
 + FullyQualifiedErrorId : PSSessionStateBroken

As suggested by the error message, the first things you should read are theese:

about_Remote_Troubleshooting

and:

WinRM (Windows Remote Management) Troubleshooting

The empty result of the command :

winrm enumerate winrm/config/Listener

told me that there weren’t any winrm listener running.

As the machine I was trying to connect to was in production environment and wasn’t rebootable, I solved rebuilding the winrm listner with this simple command:

winrm create winrm/config/Listener?Address=*+Transport=HTTP

Then trying again with

winrm enumerate winrm/config/Listener
Listener
Address = *
Transport = HTTP
Port = 5985
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint
ListeningOn = 192.168...

and Invoke-Command working like a charm!

Other useful resources:

Invoke-Command

Installation and Configuration for Windows Remote Management (Windows)

How to force WinRM to listen interfaces over HTTPS

Three ways to configure WinRM listeners.

Massive remote service restart oneliner

Hello guys!

You have to say “Thank you Gianlu!!!” to my colleague Gianluca if you can have this tricky one-liner to restart services around (transport servers in this case):

Get-TransportServer | % { Restart-Service -InputObject $( Get-Service -ComputerName $_ -Name yourservicename ) -Verbose }

Enjoy!

Sincerly

AR

ExFolders remote install

Hey guys!

Have you ever thought about having ExFolders installed on every mailbox server, instead of searching every time the server in wich you installed it?

Here it is, a very simple script for a remote deploy and installation, provided AS IS, not sure if this version actually worked, if not it’s not so far to work.

It was useful for me, maybe also for you.

Get-Content .\server_list.txt | % { 
    $server = $_
    # variabile contenitore degli errori
    $errori = $null
    $fqdn = $server + ".yourdomain.com"
    # share di destinazione reg
    $dest_folder_reg = "\\" + $server + ".yourdomain.com\c$\exfolders\"
    # share di destinazione bin
    $dest_folder_bin = "\\" + $server + ".yourdomain.com\c$\Program Files\Microsoft\Exchange Server\V14\Bin"

    # copio i file 
    Copy-Item C:\exfolders\TurnOffSNVerificationForExFolders.reg $dest_folder_reg -Confirm:$false -Force -ErrorVariable errori -ErrorAction silentlycontinue
    if ( $errore ) { write-host "FAIL COPY REG - salto host $server"; return }

    Copy-Item C:\exfolders\ExFolders.exe $dest_folder_bin -Confirm:$false -Force -ErrorVariable errori -ErrorAction silentlycontinue
    if ( $errore ) { write-host "FAIL COPY BIN - salto host $server"; return }

    $var = Invoke-Command -ComputerName $fqdn  -ScriptBlock{ reg.exe import C:\exfolders\TurnOffSNVerificationForExFolders.reg } -ErrorVariable errori -ErrorAction Silentlycontinue

    # $errori is
    # The operation completed successfully.
    #    + CategoryInfo          : NotSpecified: (The operation completed successfully.:String) [], RemoteException
    #    + FullyQualifiedErrorId : NativeCommandError

    if ( $errori -like "The operation completed successfully.") { write-host "--> OK - host $server" } else { write-host "FAIL IMPORT REG - host $server"; }
}

Exchange 2007 server disposal – part 2 [DRAFT]

[DRAFT]

Removing Exchange 2007 on a a CCR+SCR environment
Following the instructions on:

Uninstalling Clustered Mailbox Servers
http://technet.microsoft.com/en-us/library/bb885058%28v=exchg.80%29.aspx

Once you made sure that the hosts you are working on are not providing any service (see post LINK), follow theese steps:

1) remove Exchange 2007 binaries from the SCR

from a command prompt:

cd C:\Program Files\Microsoft\Exchange Server\Bin
Setup /mode:uninstall

2) remove Exchange 2007 binaries from the PASSIVE CCR node

from a command prompt:

cd C:\Program Files\Microsoft\Exchange Server\Bin
Setup /mode:uninstall

Then remove the host from the cluster:

How to Evict a Node from a Windows Server 2003 Failover Cluster
http://technet.microsoft.com/en-us/library/bb123503%28v=exchg.80%29.aspx

net stop clussvc
Cluster <ClusterName> node <NodeName> /evict

3) remove Exchange 2007 binaries from the ACTIVE CCR node, again from a command prompt:

cd C:\Program Files\Microsoft\Exchange Server\Bin
Setup /mode:uninstall

Then remove the host from the cluster:

Cluster <ClusterName> node <NodeName> /evict

Done!

Things to check:

  1. grab your exchange powershell and check that the server you have just uninstalled is not present when you run Get-ExchangeServer and Get-MailboxServer
  2. from adsiedit.msc, go to Configuration [domainControllerName.domain.com], expand CN=Configuration,DC=domain,DC=com, expand CN=Services, expand CN=Microsoft Exchange, expand CN=Messaging, expand CN=Administrative Groups, expand CN=Exchange Administrative Group (FYDIBOHF23SPDLT), and then expand CN=Servers. Check that the server you have just uninstalled is not present in the list.
  3. The cluster name from the DNS, remove it.
  4. The virtual server computer object from AD, remove it.

Other useful resources:

How to uninstall the Cluster service on a Windows Server 2003 cluster
http://support.microsoft.com/kb/282227/en-us

How to Evict a Node from a Windows Server 2008 Failover Cluster
http://technet.microsoft.com/en-us/library/bb676524%28v=exchg.80%29.aspx

Remove-Cluster
http://technet.microsoft.com/en-us/library/ee461005.aspx

The mistery of the missing emails

Hello everybody!

This post was inspired by a gifted user (in this story I will call her Barbara Streisand), who opened a ticket asking about some missing email sent to him by a colleague (Park Jae-Sang) but that she has never seen in his mailbox. And the more PSY is sending her email, the less she can read them!! How crazy!!

You know, apart when you find a bug, email flow is the main business of Exchange, so it’s almost impossible that an email is not delivered without any notification to the sender…

So let’s start troubleshooting, a quick Get-MessageTrackingLog has a lot to say:

Get-TransportServer | Get-MessageTrackingLog -Start when_you_want -MessageID sucasuca@cucucu | sort timestamp | fl

The last object returned contains some useful informations:

RunspaceId              : bb3e88f0-3563-5e6f-8741-75c78a9f4a72
 Timestamp               : 21/12/2012 12:35:16
 ClientIp                :
 ClientHostname          : hubcas_server
 ServerIp                :
 ServerHostname          : backend_server
 SourceContext           : 08CF9D1BEF59FCD6;2012-12-21T11:35:16.229Z;0
 ConnectorId             :
 Source                  : STOREDRIVER
 EventId                 : DELIVER
 InternalMessageId       : 13303961
 MessageId               : <sucasuca@cucucu>
 Recipients              : {Barbara.Streisand@domain.com}
 RecipientStatus         : {Deleted Items}
 TotalBytes              : 12982
 RecipientCount          : 1
 RelatedRecipientAddress :
 Reference               :
 MessageSubject          : tuca tuca
 Sender                  : Park.Jae-Sang@domain.com
 ReturnPath              : Park.Jae-Sang@domain.com
 MessageInfo             : 2012-12-21T11:35:15.656Z;SRV=backend_server.fqdn:TOTAL=0;SRV=hubcas_server.fqdn:TOTAL=0
 MessageLatency          : 00:00:00.7450000
 MessageLatencyType      : EndToEnd
 EventData               : {[MailboxDatabaseName, dag00-db00], [DatabaseHealth, -1]}

First: the message has been delivered to themailbox server. (EventId: DELIVER)

Second: look at the “RecipientStatus: {Deleted Items}” section: this tells that there’s a rule that has automatically moved that particular message to a folder, in this case the “Deleted Items” folder, ever heard about it guys???

A quick look at the rules in Barbara’s mailbox with Get-InboxRule and here it is:

...
Description                           : If the message:
 the message was received from 'Park.Jae-Sang@domain.com'
 Take the following actions:
 move the message to folder 'Deleted Items'
 and stop processing more rules on this message
Enabled                               : True
 Identity                              : yourDistinguishedName
 Name                                  : 'test'
 Priority                              : 1
 RuleIdentity                          : 17620459049621389313
 SupportedByTask                       : True
...

A quick shot with Remove-InboxRule and the evil has gone.

NB: in this case the rule was NOT a “Client Only” rule, so it’s managed by the server without the need for an Outlook client up and running. Try for example with a “Client Only” rule that moves a message to another folder, you will see that RecipientStatus field will not cointains the folder name.

I leave to the willing student the task to understand the difference between “Client Only” and not “Client Only” rules.

Reference:

Get-MessageTrackingLog

Get-InboxRule

Understanding Message Tracking

Your everyday internet tools

Hi guys!

Today’s post is just a quick, lazy list of tools found on Internet I really find useful:

  1. mxtoolbox http://mxtoolbox.com/ all the DNS records you need
  2. MS TechNet http://technet.microsoft.com/ of course the link is to the EN-US version (because the translations really suck!!)
  3. CentralOps http://centralops.net/ very useful the Email Dossier section
  4. MS TechNet Blogs http://blogs.technet.com/ pick the one you prefer, they are really smart!
  5. Exchange related blogs: http://exchangeserverpro.com http://blogs.technet.com/b/exchange/

Maybe I will update the list in the future!

Ciao!

AR

Exchange 2007 server disposal – part 1

Hi guys!!

Is your boss asking you to quickly remove everything about Exchange 2007 in your infrastructure? The mailbox migration is finished, so why keeping all those phisical server around on your server farm!

As first post about the complete removal of Exchange 2007, check theese out:

  • that all your mailboxes have been migrated (different methods from an Exchange 2007 server):
$AdminSessionADSettings.ViewEntireForest = $True
Get-Mailbox -Server my2007mailboxserver01
Get-MailboxDatabase my2007db01 | Get-Mailbox

You can ignore all the CAS_{… mailboxes you will find, you can disable them and quickly go on

  • once you are surethat all your databases are empty:
Get-StorageGroup -Server my2007mailboxserver01 | Suspend-StorageGroupCopy
Get-MailboxDatabase -Server my2007mailboxserver01 | Dismount-Database
Get-MailboxDatabase -Server my2007mailboxserver01 | Remove-MailboxDatabase
Get-StorageGroup -Server my2007mailboxserver01 | Remove-StorageGroup

Of course, all database files will still be there, you have to manually delete them.

Stay tuned for the next posts!

AR

 

Useful resources:

Removing and Modifying Exchange 2007

http://technet.microsoft.com/en-us/library/aa998193%28v=exchg.80%29.aspx

How to Remove the First Exchange 2007 Server in a Coexistence Scenario

http://technet.microsoft.com/en-us/library/bb310767%28EXCHG.80%29.aspx

Delete just files

Hi guys!

Just a quick script, to remove just the files on a specified directory, not the subfolders or the files in the subfolders

Start-Transcript C:\remove_transcript.txt
$folderlist  = Get-ChildItem C:\yourfolder
$folderlist | % {
        Get-ChildItem  ( "C:\yourfolder\" + $_ ) | where { ! $_.PSIsContainer } | Remove-Item -Confirm:$false -Verbose
}
Stop-Transcript

Enjoy!

AR

Services all around

Hello Guys!

I’ve been pretty busy in theese days, you know, your family, your women….

So much things to do and so few time, so why logon every server in your farm and disable 20 services with your brand new Microsoft Wedge Touch Mouse, just before executing Exchange 2010 JetStress?

So, save on a file the name of the services you have to stop/start/disable/antomatically start and then:

Get-Content services_list.txt | % {
    $serv = gwmi win32_service -ComputerName (&hostname) -filter "name LIKE '$_'"
     write-host "Starting $_ ... " -nonewline
    $retu = ( $serv.startservice() ).ReturnValue
#   $retu = ( $serv.stopservice() ).ReturnValue
#   $retu = ( $serv.changestartmode("Disabled") ).ReturnValue
#   $retu = ( $serv.changestartmode("Automatic") ).ReturnValue
     Write-Host "$_ returned $retu"
     Start-Sleep 1
}

The Start-Sleep line is there to wait for some dependent services to stop properly.

See you!

AR