Search
Application Server

Exchange Server 2013 : The Exchange Management Shell - Verbose PowerShell, Controlling access to Exchange

Published 1 min readBy Programming4us Editorial Team

Verbose PowerShell

Usually, EMS gets on with whatever you ask it to do and doesn’t give any indication of the processing it performs in the background. You ask for a new mailbox to be created, and it’s created, or some problem occurs that stops the command from executing. If the problem originates with an error introduced by the user, such as an error in syntax or attempting to do something that doesn’t make sense, such as creating a mailbox in a database that doesn’t exist, you can just fix the problem and try again.

Sometimes you need to know exactly what EMS does to help track down a problem, perhaps to provide information to Microsoft support to help them figure out what’s going on in your Exchange deployment. You might just want to know what’s happening when you execute a command. In either case, you can add the /verbose switch to a command to have PowerShell generate details of exactly what it does as it proceeds. Figure 1 shows some of the output when the New-MailboxDatabase cmdlet is used to create a new mailbox database. You can see how EMS validates the context within which it is executing, including checks to locate a global catalog server, validate RBAC authorization, and confirm that the mailbox database doesn’t already exist.

Figure 1. Examining some verbose PowerShell output

Controlling access to Exchange

EMS is a great way to get work done with Exchange as long as you don’t mind grappling with the command-line interface. If no control were exerted, you could do massive damage to an Exchange organization with EMS, such as selecting all the mailboxes in a database and removing them with a single line of code. Only the people who need to control the full scope of the organization should be able to take such drastic action. Traditionally, control is given through permissions and privileges. Exchange takes a different approach and adopts the RBAC model. All administrators need a solid grounding in RBAC and its implementation in Exchange, and that’s the next subject of discussion.