• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Think PowerShell

PowerShell for IT Pros

  • About
    • Who I Am
    • Why I Blog
    • Privacy Policy
  • Resources
    • More PowerShell Sites
    • Post Series Index
  • Get Help
  • Show Search
Hide Search

Debugging

Use Measure-Command to Test Script Performance

Aaron Rothstein · Dec 5, 2016 · Leave a Comment

Use Measure-Command to time execution.
Using Measure-Command to measure cmdlet execution time.

Throw away your timestamp calculation snippets for testing script performance in favor of the native PowerShell cmdlet Measure-Command.

[Read more…] about Use Measure-Command to Test Script Performance

Try PowerShell “-Verbose” to Troubleshoot Errors

Aaron Rothstein · Oct 5, 2016 · 2 Comments

-Verbose example output.
-Verbose example output.

A real-world example of where using PowerShell “-Verbose” parameter is more efficient than a Google search.

“Couldn’t connect to the source mailbox.”

Recently I needed to export an Exchange 2010 mailbox to a PST file. I opened my Exchange Management Shell and ran New-MailboxExportRequest, only to get the following error:

[PS] C:\Windows\system32>New-MailboxExportRequest -Mailbox jdoe -FilePath \\FileServer1\Exports\jdoe.pst
Couldn't connect to the source mailbox.
    + CategoryInfo          : NotSpecified: (0:Int32) [New-MailboxExportRequest], RemotePermanentException
    + FullyQualifiedErrorId : C7D44FB7,Microsoft.Exchange.Management.RecipientTasks.NewMailboxExportRequest

Why couldn’t it connect to the source mailbox?

[Read more…] about Try PowerShell “-Verbose” to Troubleshoot Errors

Primary Sidebar

Aaron

Follow

Copyright © 2023 · Monochrome Pro on Genesis Framework · WordPress · Log in