{"id":4897,"date":"2014-09-26T10:26:01","date_gmt":"2014-09-26T18:26:01","guid":{"rendered":"https:\/\/www.zubairalexander.com\/stage\/?p=4897"},"modified":"2014-09-14T19:27:20","modified_gmt":"2014-09-15T03:27:20","slug":"how-to-permanently-add-exchange-2013-powershell-cmdlets-to-powershell-ise","status":"publish","type":"post","link":"https:\/\/www.zubairalexander.com\/blog\/how-to-permanently-add-exchange-2013-powershell-cmdlets-to-powershell-ise\/","title":{"rendered":"How to Permanently Add Exchange 2013 PowerShell Cmdlets to PowerShell ISE"},"content":{"rendered":"<p>You can permanently register the Exchange PowerShell commands into PowerShell ISE so you don\u2019t always have to manually add the command\u00a0<em>Add-PSsnapin *Exchange* -ErrorAction SilentlyContinue<\/em> every time you start PowerShell ISE. Here\u2019s the step-by-step procedure.<\/p>\n<ol>\n<li>Activate PowerShell Integrated Scripting Environment (ISE). By default, PowerShell ISE is installed in Windows Server 2008\/R2 but not activated. To activate it you can use the Add Features wizard in Server Manager. In Windows Server 2012\/R2 it is already installed and activated. The reason I prefer PowerShell ISE over PowerShell is because it is a much nicer interface and offers a multi-line editor plus additional help for scripting.<\/li>\n<li>Start PowerShell ISE with an account that has administrative privileges.<span style=\"color: #ff0000;\"><strong>CAUTION<\/strong>:<span style=\"color: #000000;\"> <em>Make sure that you start Windows PowerShell ISE, which is 64-bit, rather than Windows PowerShell ISE (x86) which is 32-bit.\n<p><img decoding=\"async\" class=\"alignnone size-medium wp-image-4913\" src=\"https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PowerShell_ISE_64bit.png\" alt=\"PowerShell_ISE_64bit\" width=\"230\" height=\"140\" \/><\/p>\n<p><a href=\"https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PowerShellStartingScreen.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-4912\" src=\"https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PowerShellStartingScreen-300x161.png\" alt=\"PowerShellStartingScreen\" width=\"300\" height=\"161\" srcset=\"https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PowerShellStartingScreen-300x161.png 300w, https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PowerShellStartingScreen.png 415w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\u00a0<\/em><\/span> <\/span><\/li>\n<\/ol>\n<ol>\n<li>Enter the command <strong>test-path $profile<\/strong>. This will either return a True or a False.<\/li>\n<li>If it returns <strong>False<\/strong> then you can create a profile for yourself using the following command.<br \/>\n<strong>if (!(test-path $profile)) {new-item -type file -path $profile -force}<\/strong><\/li>\n<li>The path to the profile is provided, e.g. <strong>C:\\Users\\SP_Admin\\Documents\\WindowsPowerShell<\/strong>. The name of the file is also provided, e.g. <strong>Microsoft.PowerShellISE_profile.ps1<\/strong>.<a href=\"https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PS_profile_info.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-4911\" src=\"https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PS_profile_info-300x91.png\" alt=\"PS_profile_info\" width=\"300\" height=\"91\" \/><\/a><\/li>\n<li>Open the .ps1 file in Notepad. The file will be blank. Enter the following command and then save the file (File, Save). Make sure that the file is saved with the original .PS1 extension and not .txt.<br \/>\n<strong>Add-PSsnapin *Exchange* -ErrorAction SilentlyContinue<br \/>\n<\/strong><\/li>\n<li>Close and restart the PowerShell ISE. Your Exchange PowerShell cmdlets should now be available to you. Verify this by typing any Exchange PowerShell cmdlet. For example type the following command.<br \/>\n<strong> Get-ExchangeServer | fl name,edition,admindisplayversion<\/strong><\/li>\n<\/ol>\n<hr \/>\n<p><span style=\"font-size: xx-small; font-family: Verdana;\">Copyright \u00a92014 Zubair Alexander. All rights reserved.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can permanently register the Exchange PowerShell commands into PowerShell ISE so you don\u2019t always have to manually add the command\u00a0Add-PSsnapin *Exchange* -ErrorAction SilentlyContinue every time you start PowerShell ISE. Here\u2019s the step-by-step procedure. Activate PowerShell Integrated Scripting Environment (ISE). By default, PowerShell ISE is installed in Windows Server 2008\/R2 but not activated. To activate [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":4912,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[43,3,57,11,30,65],"tags":[],"class_list":["post-4897","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","category-exchange-outlook","category-scripting","category-tips-tricks","category-longhorn-server","category-windows-2012"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/www.zubairalexander.com\/blog\/wp-content\/uploads\/2014\/09\/PowerShellStartingScreen.png","_links":{"self":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/posts\/4897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/comments?post=4897"}],"version-history":[{"count":0,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/posts\/4897\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/media\/4912"}],"wp:attachment":[{"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/media?parent=4897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/categories?post=4897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zubairalexander.com\/blog\/wp-json\/wp\/v2\/tags?post=4897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}