Alans Wiki

IT tips and tricks

Load Exchange Powershell Management Shell into ISE

Posted by alambert on July 16, 2019
Posted in: Exchange, Powershell, Uncategorized.

First start by forcing the creation of your PowerShell ISE profile file if it doesn’t exist

if (!(Test-Path -Path $PROFILE ))&amp;lt;br&amp;gt;&lt;br&gt;<br>
{ New-Item -Type File -Path $PROFILE -Force }

Second, within your ISE console, type the following

psEdit $profile

In the script pane, just copy/paste the below blue script

$StopWatch = [System.Diagnostics.StopWatch]::StartNew()

Function Test-Command ($Command)

{

Try

{

Get-command $command -ErrorAction Stop

Return $True

}

Catch [System.SystemException]

{

Return $False

}

}


IF (Test-Command "Get-Mailbox") {Write-Host "Exchange cmdlets already present"}

Else {

$CallEMS = ". '$env:ExchangeInstallPath\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell "

Invoke-Expression $CallEMS


$stopwatch.Stop()
$msg = "`n`nThe script took $([math]::round($($StopWatch.Elapsed.TotalSeconds),2)) seconds to execute..."
Write-Host $msg
$msg = $null
$StopWatch = $null

}

Posts navigation

← SFP vs SFP+ vs SFP28
Paul Cunningham’s Test-ExchangeServerHealth.ps1 →
  • Recent Posts

    • Change the RDS “Work Resources”
    • Create SG for folders
    • Enable inheritance on all AD user
    • MSGraph Powershell module
    • Folder Permissions Groups
  • Categories

    • Active Directory
    • Apps
    • Azure
    • Azure Active Directory
    • Backup Exec
    • Command Line
    • Data Center
    • DHCP
    • DNS
    • DNS
    • Exchange
    • Hyperv
    • Networking
    • Offfice 365
    • OneNote
    • Patching
    • PowerCLI
    • Powershell
    • RemoteApps
    • Shortcuts
    • Single
    • Splunk
    • Uncategorized
    • Veeam
    • VMware
    • Windows
    • Workstation
  • Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
Proudly powered by WordPress Theme: Parament by Automattic.