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'
)
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
- Close EMC
- Browse to C:\users\%username%\AppData\Roaming\Microsoft\MMC\ and delete the file called "Exchange Management Console".
- Using your favorite registry editor go to HKCurrentUser\Software\Microsoft\Exchangeserver\v14\AdminTools\ and delete the value NodeStructureSettings
- Now run Exchange Management Console again and your problem should be fixed
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"
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
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