How to install cumulative update for exchange 2016 and HealthyAndUpgrading status

Despite of we think the updates as patches, the Exchange 2016 cumulative updates are a complete installation of the messaging application. We can use this CU to install Exchange from scratch or update the Exchange organization.

As the media installation has all files to install a new exchange server, it means that you DON’T need to install the previous CU before install the latest version.

In this scenario, I am going to update from Exchange Cumulative Update 5 to CU 8. Please follow these steps.

• Download the media installation from Microsoft. Be careful; do not download the software from another site.
From Microsoft you will need Exchange CU 8 and .Net Framework 4.7.1.
Cumulative 8 does not implement changes into Active Directory, but CU 7. Therefore, when I execute CU 8 set up, it will make the same changes into Active Directory as CU 7.
• Search for known issues with this Cumulative Update, in some cases Microsoft detect issues with some updates releases and they publish a workaround or fixes to solve the issues. You need to be aware of these cases in order to determine if can be an impact in your organization, in some cases is better wait a little more while Microsoft release those fixes and you are confident to have a reliable version to install. Here you can see a justification to use always Microsoft site to download the installation media.
• Create backups. As the Active Directory will be affected by this installation, you need to have a reliable backup and obviously a backup for all Exchange data bases, in case that you have a DAG (Database Availability Group) configured, you need to check the copy(ies) status. 
• The best scenario, is install the Cumulative Update 8 in a test environment before go to production, with this approach you can detect any issue and work proactively solving any inconvenient before install the CU8 in your production servers.
• Document any customization you have made in production, for example sometimes we modify the ecp access, this changes are saved in web.config file located at C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess, if this the case save a copy of the file. Note: DO NOT replace the file; just copy the code where you made the changes.
• Verify your Exchanges certificates are not expired. This is important to avoid loss access to servers and services.
• Verify that you have access to OWA (Outlook Web App) and you can read, send and receive emails, access to shared mailbox (if any), delegates, etc and create a checklist. After the installation, you will check all of these items again to validate that everything is working as expected.

Installing the Cumulative Update 8 

At this point you need to be aware of you will have some servers in a new version (CU 8) and others in the current version (Before CU8, in this scenario CU5). It’s Ok, this scenario is considered by Microsoft and everything is working properly, but you need to plan complete all the servers in a reasonable time (Maximum a couple of weeks).

If you have a DAG configured, you will put the server in maintenance mode and it helps to work even on business hours because the databases are mounted in other servers.

In my scenario, I don’t have Edge servers but if you have this role in your environment, should be the first servers in deploy Exchange Cumulative Update 8.

The follow steps, should be executed as they appear in this document.


Perform Active Directory, Domain and Schema changes and updates, remember if you are updating from CU7 to CU8, there is no changes, even though is a process that always Exchange setup will verify. Otherwise, you will find errors like these:

 

Error:
The Mailbox server role isn’t installed on this computer.
Error:
The Mailbox server role isn’t installed on this computer.
Error:
The Active Directory schema isn’t up-to-date, and this user account isn’t a member of the ‘Schema Admins’ and/or ‘Enterprise Admins’ groups.
Error:
You must be a member of the ‘Organization Management’ role group or a member of the ‘Enterprise Admins’ group to continue.
Error:
You must use an account that’s a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.
Error:
You must use an account that’s a member of the Organization Management role group to install the first Client Access server role in the topology.
Error:
You must use an account that’s a member of the Organization Management role group to install the first Client Access server role in the topology.
Error:
You must use an account that’s a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.
Error:
You must use an account that’s a member of the Organization Management role group to install or upgrade the first Client Access server role in the topology.
Error:
You must use an account that’s a member of the Organization Management role group to install the first Mailbox server role in the topology.
Error:
Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master.  Run setup with the /prepareAD parameter on a computer in the domain root and site RootEU, and wait for replication to complete.  See the Exchange setup log for more information on this error.
Error:
The forest functional level of the current Active Directory forest is not Windows Server 2003 native or later. To install Exchange Server 2016, the forest functional level must be at least Windows Server 2003 native.
Error:
The Mailbox server role isn’t installed on this computer.
Error:
Either Active Directory doesn’t exist, or it can’t be contacted.
Updating Active Directory, Domain and Schema
 
For this scenario, you need to install Microsoft .NET Framework 4.7.1 in the same computer that you will execute the follow commands, do remember download the framework from the Microsoft official site.
 
Make sure that you have the correct permissions assigned (Enterprise Admins and Schema Admins permissions) to execute the follow commands:
 
NOTE: open a command prompt window with elevated permissions, DO NOT use powershell.
 
1.       setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
2.      setup.exe /PrepareAD /IAcceptExchangeServerLicenseTerms
3.      setup.exe /PrepareDomain /IAcceptExchangeServerLicenseTerms
 
When the Schema, Domain and Active Directory changes have been applied and you didn’t get any error message, then you are good to start with the installation process.
 
Installing Exchange Cumulative Update 8 on Exchange Server 2016
 
In you have a DAG configured, let’s put the server in maintenance mode.
 
Open an Exchange Management Shell window.

Move to exchange scripts folder. Write: cd $exscripts

 
Execute this script:

 

.\StartDagServerMaintenance.ps1 -serverName -OverRideMinimumTwoCopies:$true
NOTE: Even some authors suggest use other commands to put a server in maintenance mode, this is working for me.

Once you can see all databases with healthy status, I suggest as good practice reboot the server to drop all connections from other users and applications opened by other processes or users. 

 
 
 
After reboot, let’s open the installation media, and right click to run as administrator the Setup.exe file. In this way, the installation has begun.

 

The setup process will detect that Exchange is installed and will appears the Upgrade window

Click on Next
Accept the license agreement.

In my case, I got this error:

Error: Setup can’t continue with the upgrade because the PowerShell (40928) has open files.
Open task manager, go to processes or details and finish all PowerShell processes.
Click on Retry
And just sit back and watch the progress.
 
During this process if you try to do something remote via PowerShell, you will receive this error:
PS C:\> Get-MailboxDatabaseCopyStatus -Server MyServer
Creating a new session for implicit remoting of “Get-MailboxDatabaseCopyStatus” command…
New-PSSession : [MyServer] Connecting to remote server MyServer failed with the following error message :
The connection to the specified remote host was refused. Verify that the WS-Management service is running on
the remote host and configured to listen for requests on the correct port and HTTP URL. For more information,
see the about_Remote_Troubleshooting Help topic.
When step 17 finishes, then reboot the server.
As we put the server in maintenance mode, now we need to stop it.
Open an Exchange Management PowerShell.

Move to Exchange Scripts folder.

Run the follow command: .\StopDagServerMaintenance.ps1 –serverName
Wait until the Databases have the Mounted status.


Important Notes.

The “Microsoft Exchange Search Service is crawling the database.” Message error.
 
You will see the follow state in the Content Index: HealthyAndUpgrading

Calm down!!!, is not necessary an error!!!

Remember that we are migrating from Exchange CU5 to CU8, this is a normal process after the installation.

If you run the follow command you will be able to see more details:

Get-MailboxDatabaseCopyStatus | fl
ContentIndexState                       : HealthyAndUpgrading
ContentIndexErrorMessage                : The Microsoft Exchange Search Service is crawling the database.
In my case, I have to wait a couple of days to see the DB’s in healthy status again, but meanwhile they were mounted and working without any issues.
You can verify the progress running the follow command:

Get-MailboxDatabaseCopyStatus -Server MyServer | select name, status, contentindexstate, ContentIndexMailboxesToCrawl
Depending of your server’s capacity and number of mailboxes can be fast or take too long to finish.

 

if we see an error with the Index DB: 

 

 
ContentIndexState                       : Failed

 

ContentIndexErrorMessage                : An internal error occurred for the database or its index.
LastCopyAvailabilityCheckFailedID       : DatabaseCheckPassiveCopyTotalQueueLength
LastCopyAvailabilityCheckFailedErrorMsg : Database copy ‘DB001′ on server ‘MyServer’ has a total
                                          (copy plus replay) queue length of 32761 logs, which is higher than
                                          the maximum allowed queue length of 400.
Give more time and the status will change to HealthyAndUpgrading again.

 

In summary, the state HealthyAndUpgrading is not really an error and you need to wait a while to see the correct state for Content Index.

 

If you restart the Exchange Search service, will be all Databases with Failed status and maybe you will be scare about this.
If you already did it, again just sit tight and wait.
Regards – Cheers – phir melenge – Hasta luego

 

How to install cumulative update for exchange 2016

Despite of we think the updates as patches, the Exchange 2016 cumulative updates are a complete installation of the messaging application. We can use this CU to install Exchange from scratch or update the Exchange organization.

As the media installation has all files to install a new exchange server, it means that you DON’T need to install the previous CU before install the latest version.

In this scenario, I am going to update from Exchange Cumulative Update 5 to CU 8. Please follow these steps.

  • Download the media installation from Microsoft. Be careful; do not download the software from another site. From Microsoft, you will need Exchange CU 8 and .Net Framework 4.7.1.

Cumulative 8 does not implement changes into Active Directory, but CU 7. Therefore, when I execute CU 8 set up, it will make the same changes into Active Directory as CU 7.

  • Search for known issues with this Cumulative Update, in some cases Microsoft detect issues with some updates releases and they publish a workaround or fixes to solve the issues. You need to be aware of these cases in order to determine if can be an impact in your organization, in some cases is better wait a little more while Microsoft release those fixes and you are confident to have a reliable version to install. Here you can see a justification to use always Microsoft site to download the installation media.
  • Create backups. As the Active Directory will be affected by this installation, you need to have a reliable backup and obviously a backup for all Exchange data bases, in case that you have a DAG (Database Availability Group) configured, you need to check the copy(ies) status.
  • The best scenario, is install the Cumulative Update 8 in a test environment before go to production, with this approach you can detect any issue and work proactively solving any inconvenient before install the CU8 in your production servers.
  • Document any customization you have made in production, for example sometimes we modify the ecp access, this changes are saved in web.config file located at C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess, if this the case save a copy of the file. Note: DO NOT replace the file; just copy the code where you made the changes.
  • Verify your Exchanges certificates are not expired. This is important to avoid loss access to servers and services.
  • Verify that you have access to OWA (Outlook Web App) and you can read, send and receive emails, access to shared mailbox (if any), delegates, etc and create a checklist. After the installation, you will check all of these items again to validate that everything is working as expected.

 

Installing the Cumulative Update 8

At this point you need to be aware of you will have some servers in a new version (CU 8) and others in the current version (Before CU8, in this scenario CU5). It’s Ok, this scenario is considered by Microsoft and everything is working properly, but you need to plan complete all the servers in a reasonable time (Maximum a couple of weeks).

If you have a DAG configured, you will put the server in maintenance mode and it helps to work even on business hours because the databases are mounted in other servers.

In my scenario, I don’t have Edge servers but if you have this role in your environment, should be the first servers in deploy Exchange Cumulative Update 8.

The follow steps, should be executed as they appear in this document.

Perform Active Directory, Domain and Schema changes and updates, remember if you are updating from CU7 to CU8, there are no changes, even though is a process that always Exchange setup will verify. Otherwise, you will find errors like these:

PreReqError

Error:

The Mailbox server role isn’t installed on this computer.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.UnifiedMessagingRoleNotInstalled.aspx

 

Error:

The Mailbox server role isn’t installed on this computer.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.BridgeheadRoleNotInstalled.aspx

 

Error:

The Active Directory schema isn’t up-to-date, and this user account isn’t a member of the ‘Schema Admins’ and/or ‘Enterprise Admins’ groups.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.SchemaUpdateRequired.aspx

 

Error:

You must be a member of the ‘Organization Management’ role group or a member of the ‘Enterprise Admins’ group to continue.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.GlobalServerInstall.aspx

 

Error:

You must use an account that’s a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DelegatedBridgeheadFirstInstall.aspx

 

Error:

You must use an account that’s a member of the Organization Management role group to install the first Client Access server role in the topology.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DelegatedCafeFirstInstall.aspx

 

Error:

You must use an account that’s a member of the Organization Management role group to install the first Client Access server role in the topology.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DelegatedFrontendTransportFirstInstall.aspx

 

Error:

You must use an account that’s a member of the Organization Management role group to install or upgrade the first Mailbox server role in the topology.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DelegatedMailboxFirstInstall.aspx

 

Error:

You must use an account that’s a member of the Organization Management role group to install or upgrade the first Client Access server role in the topology.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DelegatedClientAccessFirstInstall.aspx

 

Error:

You must use an account that’s a member of the Organization Management role group to install the first Mailbox server role in the topology.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.DelegatedUnifiedMessagingFirstInstall.aspx

 

Error:

Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master.  Run setup with the /prepareAD parameter on a computer in the domain root and site RootEU, and wait for replication to complete.  See the Exchange setup log for more information on this error.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.AdInitErrorRule.aspx

 

Error:

The forest functional level of the current Active Directory forest is not Windows Server 2003 native or later. To install Exchange Server 2016, the forest functional level must be at least Windows Server 2003 native.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.ForestLevelNotWin2003Native.aspx

 

Error:

The Mailbox server role isn’t installed on this computer.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.MailboxRoleNotInstalled.aspx

 

Error:

Either Active Directory doesn’t exist, or it can’t be contacted.

For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.CannotAccessAD.aspx

 

Updating Active Directory, Domain and Schema

For this scenario, you need to install Microsoft .NET Framework 4.7.1 in the same computer that you will execute the follow commands, do remember download the framework from the Microsoft official site.

Make sure that you have the correct permissions assigned (Enterprise Admins and Schema Admins permissions) to execute the follow commands:

NOTE: open a command prompt window with elevated permissions, DO NOT use powershell.

  1. exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
  2. exe /PrepareAD /IAcceptExchangeServerLicenseTerms
  3. exe /PrepareDomain /IAcceptExchangeServerLicenseTerms

When the Schema, Domain and Active Directory changes have been applied and you didn’t get any error message, then you are good to start with the installation process.

 

Installing Exchange Cumulative Update 8 on Exchange Server 2016

In you have a DAG configured, let’s put the server in maintenance mode.

Open an Exchange Management Shell window.

Move to exchange scripts folder. Write: cd $exscripts

ExScript

Execute this script:

.\StartDagServerMaintenance.ps1 -serverName <servername> -OverRideMinimumTwoCopies:$true

NOTE: Even when some authors suggest use other commands to put a server in maintenance mode, this is working for me.

Once you can see all databases with healthy status, I suggest as good practice reboot the server to drop all connections from other users and applications opened by other processes or users.

HealthyStatus

After reboot, let’s open the installation media, and right click to run as administrator the Setup.exe file. In this way, the installation has begun.

SetUp1

The setup process will detect that Exchange is installed and will appears the Upgrade window

Upgrade1

Click on Next

UpgradeLic

Accept the license agreement.

In my case, I got this error:

UpgradeErr1

Error: Setup can’t continue with the upgrade because the PowerShell (40928) has open files.

Open task manager, go to processes or details and finish all PowerShell processes.

Process

Click on Retry

Retry

And just sit back and watch the progress.

step1

During this process if you try to do something remote via PowerShell, you will receive this error:

 

PS C:\> Get-MailboxDatabaseCopyStatus -Server MyServer

Creating a new session for implicit remoting of “Get-MailboxDatabaseCopyStatus” command…

New-PSSession : [MyServer] Connecting to remote server MyServer failed with the following error message :

The connection to the specified remote host was refused. Verify that the WS-Management service is running on

the remote host and configured to listen for requests on the correct port and HTTP URL. For more information,

see the about_Remote_Troubleshooting Help topic.

 

When step 17 finishes, then reboot the server.

step17

As we put the server in maintenance mode, now we need to stop it.

Open an Exchange Management PowerShell.

Move to Exchange Scripts folder.  cd $exScripts

Run the follow command: .\StopDagServerMaintenance.ps1 –serverName <ServerName>

Wait until the Databases have the Mounted status.

 

Important Notes.

The “Microsoft Exchange Search Service is crawling the database.” Message error.

You will see the follow state in the Content Index: HealthyAndUpgrading

Calm down!!!, is not necessary an error!!!

Remember that we are migrating from Exchange CU5 to CU8, this is a normal process after the installation.

If you run the follow command you will be able to see more details:

Get-MailboxDatabaseCopyStatus | fl

 

ContentIndexState                       : HealthyAndUpgrading

ContentIndexErrorMessage                : The Microsoft Exchange Search Service is crawling the database.

 

In my case, I have to wait a couple of days to see the DB’s in healthy status again, but meanwhile they were mounted and working without any issues.

You can verify the progress running the follow command:

Get-MailboxDatabaseCopyStatus -Server MyServer | select name, status, contentindexstate, ContentIndexMailboxesToCrawl

Depending of your server’s capacity and number of mailboxes can be fast or take too long to finish.

ToCraw

if we see an error with the Index DB:

mountedFailed

ContentIndexState                       : Failed

ContentIndexErrorMessage                : An internal error occurred for the database or its index.

LastCopyAvailabilityCheckFailedID       : DatabaseCheckPassiveCopyTotalQueueLength

LastCopyAvailabilityCheckFailedErrorMsg : Database copy ‘DB001′ on server ‘MyServer’ has a total  (copy plus replay) queue length of 32761 logs, which is higher than                    the maximum allowed queue length of 400.

Give more time and the status will change to HealthyAndUpgrading again.

Mounted

In summary, the state HealthyAndUpgrading is not really an error and you need to wait a while to see the correct state for Content Index.

If you restart the Exchange Search service, will be all Databases with Failed status and maybe you will be scare about this.

If you already did it, again just sit tight and wait.

 

Regards – Cheers – phir melenge – Hasta luego

Where are the scripts in Exchange 2016?

Where are the scripts in Exchange 2016?
   Exchange has a folder with a complete suite of scripts that we use in the day-to-day managing activities or sometimes we are going to use only once, for example in a migration process if we need to migrate public folders to Exchange 2016 we need to use some scripts from this suite.

   In addition, there are scripts to put in maintenance mode the server in case that we need to stop the DAG due to reboot the server in order to complete a patching process or shutdown the server for another different reason.

   As well as exist the script to stop the DAG, as well exists the script to stop the maintenance mode or resume the mailbox databases copies.

   Other scripts are used to security and hygiene activities for example enable or disable antimalware, install or uninstall antispam agents.

   In the same suite we can find scripts to get metrics about the exchange organization, they have the capability to read information from the event logs of the servers in a DAG to gather information on databases mount, moves and failover over some range of time.

   In some cases, the script has a xml file with the same name with help information, this file is very helpful because you can see all the details related to the script execution, for example what king of parameters you need to include in the script execution; also,  what kind of information you need as output (data in the console, html or csv file, etc).

  The path of the scripts in Exchange 2016 is C:\Program Files\Microsoft\Exchange Server\V15\Scripts (in case you have installed Exchange in the C: drive) or you can use the exchange variable $exinstall who will send you to this directory:

   As well you can use the exchange variable $exscripts to go directly to the scripts folder in Exchange 2016
This is the directory where you can see all scripts into the server

Remember always test the scripts in another environment different to production.

Regards – Cheers – phir melenge – Hasta luego


How to search notes deleted in Exchange 2016

 

If the notes disappear from your outlook and you can’t find them, execute the follow command in Exchange Power Shell:
 
PS C:\> Search-Mailbox agonzalez -SearchQuery kind:Notes -TargetMailbox “Support” -TargetFolder “Recover” -LogLevel full -LogOnly
The switch –logonly means you are not going to copy the information, only you want to know if the notes are in the mailbox. You will have a result something like this:
 
ResultItemsCount : 134
Then you can remove the –logonly switch and copy the information to the target folder:
 
PS C:\> Search-Mailbox agonzalez -SearchQuery kind:Notes -TargetMailbox “Support” -TargetFolder “Recover” -LogLevel full 
In this case I used the support mailbox creating a new folder called Recover where I will copy the information from agonzalez.

 

Some special operators in PowerShell: $($Variable), @( ), &, S_., %, ?

There are some operators that they are not common in PowerShell and we have problems to figure out the logic when we are reading a script written by another person.

For example $($Variable) operator. This is a subexpression operator that always will evaluate first the expression contained into the parenthesis and return the value as an array, and therefore you can use this information directly. Let’s see the follow example:

$c = Aduser 430001150
The variable $C contains all the information for this Active Directory object, and therefore If I want to know only the first name and last name I can write this:

Write-Host “The firstname is: $($c.GivenName)-ForegroundColor Yellow
Write-Host “The firstname is: $($c.Surname)-ForegroundColor Yellow
And the output will be:
The first name is: Tony
The last name is: Gonzalez

@() Array expression

Returns the result of one or more statements as an array, when you have the construct @() you are creating an array without any elements at all. Otherwise, if you add elements to the array they will have an index;

$array = @()   #We declare this variable as array
$array = @(1,2,5,6,9,”Hello”,”World”)   #We are adding elements to the array, the first element has the index 0, in this case has the value 1.
$array[0]
1
If we want to know what information contains this array:

PS C:\> $array
1
2
5
6
9
Hello
World
& Call operator. We use this operator to run a command, script, or script block. For example:

PS C:\> $b = “Get-ChildItem”
If we execute this value to see the result, will be the string stored in quotes.

PS C:\> $b
Get-ChildItem
But if we put the call operator & we are going to get another result

PS C:\> & $b
    Directory: C:\
Mode                LastWriteTime     Length Name                                                                                                                                                
—-                ————-     —— —-                                                                                                                                                 
d—-         12/7/2016   2:52 PM            Dell                                                                                                                                                  
% Is an Alias for the command let ForEach-Object is a loop who returns each pipeline object one after the other. Which means that you can use both in a sentence.

? Is an alias for the command let Where-Object. We use this sentence to select an object from a collection.

In both aliases we can use $_. To reference to a filed into the result. For example:

PS C:\> Get-ChildItem “C:\” | ?{$_.Name -eq “temp”}
    Directory: C:\
Mode                LastWriteTime     Length Name                                  
—-                ————-     —— —-                                  
d—-          2/1/2018  11:51 AM            temp                                   

These are only some of the operator that sometimes we do not know how they mean when we are analyzing a script that has been created by another person, but obviously, there are much more. 

I will put another post with a little more. 

How to count members in an Active Directory group using PowerShell

   There are different methods to get this information when the group is small, but the problem shows up when a group contains thousands of members.

The first cmdlet that I tried was:
$members = Get-ADGroupMember -Identity “Group Name”

The idea is execute the follow line:
$members.count

But I got this error: “The size limit for this request was exceeded”

And the same with the follow cmd lets:
  • Get-ADGroupMember -Identity “Group Name” > C:\Temp\members.txt (even exporting the result to a csv file).
  • Get-ADGroupMember -Identity “Group Name” | Measure-Object
  • Get-ADGroupMember -Identity “Group Name” | Measure-Object | select count

The command that worked properly for me was:
$members = Get-ADGroup -Identity “Group Name” -Properties Members
$members.count

I my case, I ran this command for a group that contains more than 7k members. 

Error in skype for business “Create skype meeting failed. Please make sure that Skype for Business is running and signed-in and try again”

Error in Skype for business “Create Skype meeting failed. Please make sure that Skype for Business is running and signed-in and try again”
I saw an error when a user with outlook 2016 and windows 10 tried to create a Skype meeting and this message error showed up.

After check the policies configured for this user in the server, I thought it was an outlook issue related, because all policies were configured correctly.

My Troubleshooting was:
  • The first step check the Add in in outlook and verify if it was enabled. The add in was already enabled and the issue persists.
  • The second was recreate outlook and Skype profiles but the problem still was there.

As the user has two pools in Skype, I moved the user to the second pool and it solved the problem.

Now the user is able to create Skype meetings from outlook.

I hope this information helps. 

Outlook rules are not working

Few days ago I was working in a case where the user was migrated and after move the mailbox the rules configured in his outlook stop working.

I’ve tried several things like:

Back up the rules, delete and create again.
Create a new .ost file.
Create another outlook profile.
Create the rules in outlook web app.
Start outlook with different switches like: outlook /cleanrules, /safe, /cleanprofile, etc. 
• I’ve checked if the mailbox had been listed as the “JournalingReportNdrTo” in a transport rule. Is a new security feature in Exchange. If you find the email address with this configuration
then stop reading because this is the problem. Assign another mailbox for journaling reports.

Even worse the rules were not running manually.
   After check the account configuration, I realized that it has two different x500 accounts.
In ECP go to recipients mailboxes search the affected user, select and double click to see the properties.
  Once in the properties window, Go to email address tab and you will see the SMTP address, SIP address (if it has a sip address configured), maybe a x400 account but the most important check how many x500 accounts appear in the list.

    After verify that I have two x500 email addresses in the list, I opened both and I noticed one of them has a different Active directory (AD) forest and with a different organizational unit (OU). 

   Once I validated both accounts, I removed the email address with a different AD information. I saved the changes and Voila!

First, check in outlook that you do not have any rule configured. If so, delete it (you can back up the rules, just in case…)

Close outlook.

Create the rule using outlook web app. To do this, open outlook web app – in the upper-right corner click on SettingsManage integrations.


In the left side, on Mail options go to Inbox and sweep rules



Here you can create the new rule. Once you finish the same rule will appears in MS outlook.

And your rules will be working properly!!!!

Regards.

How to view members of a Dynamic group or distribution list

Apply for exchange 2016

 
   We create a dynamic group to get the current users in a specific OU, region, office, department or any other filter, is helpful because you always have active users, which means that all disable users are not part of this group (or distribution list). but sometimes you need to be sure if a user belongs to this group, and therefore you need to execute the follow lines in Exchange PowerShell:

first, to retrieve all members of the dynamic group:

once you have all the information in the $Dyn variable, the next step is filter the information:

and you can see the information in PowerShell, but if you have a huge amount of users there, then you can export the information to a csv file:

And then use excel to search, filter or just store the file as record.

I hope this can be useful for you.

Regards

-Tony Gonzalez

How to reuse commands in PowerShell

Sometimes you have a repetitive tasks in PowerShell, for example purging emails in Exchange, or maybe you just wanted to polish or correct a command you wrote.

There are some different ways to do so:

1. Arrow Up and Arrow Down, press those keys to scroll up or down in your command history and select the desired command to work with.

2. Using F5 and F8 you are able to the same as above (arrows keys).

3. Using F7 and then scrolling up or down using arrow up and down to select the command into the history list. This option is my favorite. With F9 you can enable the numbers if you want to use a number stead of press enter.

With (Alt)+(F7) you can clear the command history and start from scratch.

In addition, the command history only keeps 50 commands by default, but you can modify this value in your profile.

I hope these tips can help you in your day-to-day.

Best regards.

Tony Gonzalez.