Zero Hour Sleep
11Dec/120

Returning “Automatic” services only in powershell

There are a lot of cases when you might need to check the services on a server and it is a pity that the get-service powershell cmdlet doesn't return the startup type of a service. That makes it useless for tasks like quickly checking what automatic services are not running on a particular server.

Fortunately WMI calls can solve this issue although it would have been much easier to simply use get-service cmdlet.

Here is a quick example of how to use get-WmiObject to return all services that are set to Automatic startup but are currently not running

Get-WmiObject Win32_Service |
Where-Object { $_.StartMode -eq 'Auto' -and $_.State -ne 'Running' } |
# process them; in this example we just show them:
Format-Table -AutoSize @(
'Name'
'DisplayName'
@{ Expression = 'State'; Width = 9 }
@{ Expression = 'StartMode'; Width = 9 }
'StartName'
)

8Dec/120

Microsoft Exchange 2010 Management console is pointing to a wrong / orphan server

Sometimes Microsoft Exchange 2010 Management console get stuck and tries to connect to the wrong server instead of the one you are logged on to.

If it is only connecting to the wrong server (but connecting) you can simply right click on "Microsoft Exchange On-Premises (ServerName)" properties and select the server you want to connect to.

However things get more complicated if the server it is trying to connect to no longer exists or is orphaned. In that case you cannot right-click properties and this will yield your management console totally useless

To fix this follow the below steps

  1. Close EMC
  2. Browse to C:\users\%username%\AppData\Roaming\Microsoft\MMC\ and delete the file called "Exchange Management Console".
  3. Using your favorite registry editor go to HKCurrentUser\Software\Microsoft\Exchangeserver\v14\AdminTools\ and delete the value NodeStructureSettings
  4. Now run Exchange Management Console again and your problem should be fixed
13Sep/110

Quick Tip: Fix “Enable Web-based distribution” greyed out in offline address book

After upgrading from Microsoft Exchange 2003 to Exchange 2007 or 2010 you might notice that the "Enable Web-based distribution" option is greyed out. The first thing to check is if you have moved the Offline Address Book generation to an Exchange 2007/2010 server.

However if you have already done this and the option is still disabled it can easily fixed by running ApplyMandatoryProperties on it. This can be done by running the below powershell command

Get-OfflineAddressBook | Set-OfflineAddressBook -ApplyMandatoryProperties

Et voila! you can now "Enable Web-based distribution"

10Aug/110

Cannot install the Certificate Authority Web Enrollment component

I have recently been faced with a Certificate Authority server running on Microsoft Windows 2008 R2 that was refusing to have the Web Enrollment component installed.

I have tried installing by the GUI and using powershell using add-windowsfeature ADCS-Web-Enrollment and both method failed with the following error

"Certification Authority Web Enrollment cannot be installed on this computer or Error: Cannot install Certification Authority Web Enrollment."

The solution to this problem is

  1. Run regedit on the server
  2. Browse to HKLocalMachine\System\CurrentControlSet\Services\CertSvc\Configuration
  3. Change the SetupStatus key to 0×6001 (it was 0x6003 in my case)

Et voila you should be able to install the web enrollment now without issues

6Jun/115

Outlook mail forwarding rule to external address not working

You might notice that, your Microsoft Exchange environment, if your users setup outlook rules to automatically forward their emails to an external email address, these rules will not work and the forwarded email will never leave your organization.

This is because Exchange blocks, by default,automatic forwarding message. To solve this problem you will need to follow the below steps

10Oct/102

Autodiscover/Outlook anywhere fails when using a wildcard certificate

A very common issue faced with people who buy a wildcard certificates is that Autodiscover and Outlook Anywhere will not work because the Certificate Principal Name *.domain.com doesn't match the name returned by the autodiscover service server.domain.com

This issue is a pretty easy fix it is enough to run from Exchange Management Shell to match the Certificate Principal Name with the setting returned by the autodiscover service.

Set-OutlookProvider -Identity EXPR -CertPrincipalName msstd:*.domain.com

You can verify the changes you have done by running

Get-OutlookProvider
Page 1 of 212