{"id":2475,"date":"2021-11-07T17:03:11","date_gmt":"2021-11-08T01:03:11","guid":{"rendered":"https:\/\/doubleecpu.com\/?page_id=2475"},"modified":"2021-11-07T18:09:06","modified_gmt":"2021-11-08T02:09:06","slug":"sharepoint-online-powershell-module","status":"publish","type":"page","link":"https:\/\/doubleecpu.com\/index.php\/sharepoint-online-powershell-module\/","title":{"rendered":"Sharepoint Online Powershell Module"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Check<\/h2>\n\n\n\n<p>Check the version installed on the Host Computer<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Get-Module<\/code> <code>-Name<\/code> <code>Microsoft.Online.SharePoint.PowerShell<\/code> <code>-ListAvailable<\/code> <code>| Select Name,Version<\/code><\/pre>\n\n\n\n<p>Nothing will be printed if not installed<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install<\/h2>\n\n\n\n<p>Run PowerShell as Administrator<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Install-Module Microsoft.Online.SharePoint.PowerShell \n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/vg-1.com\/wp-content\/uploads\/2021\/10\/image.png\" alt=\"\" class=\"wp-image-2428\"\/><figcaption>If NuGet provider is not installed will ask to install  <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/vg-1.com\/wp-content\/uploads\/2021\/10\/image-1.png\" alt=\"\" class=\"wp-image-2429\"\/><\/figure>\n\n\n\n<p>After Confirming :Y the green installing message will appear for just a moment as package is only a few MB <br>*If Administrative Privileges are not granted on the system the module can be installed for current user<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">ReInstall<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Install-Module Microsoft.Online.SharePoint.PowerShell<\/code> <code>-force<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Update<\/h2>\n\n\n\n<p><code>Update-module<\/code> <code>microsoft.online.sharepoint.powershell<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Uninstall<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Uninstall-Module<\/code> <code>-Name<\/code> <code>Microsoft.Online.SharePoint.PowerShell<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Check Modules<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Get-command<\/code> <code>-Module<\/code> <code>Microsoft.Online.SharePoint.PowerShell<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Sample PowerShell Script<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">#Check if SharePoint Online PowerShell module has been installed\nTry {\n    Write-host \"Checking if SharePoint Online PowerShell Module is Installed...\" -f Yellow -NoNewline\n    $SharePointOnlineModule = Get-Module -ListAvailable \"Microsoft.Online.SharePoint.PowerShell\"\n \n    If(!$SharePointOnlineModule)\n    {\n        Write-host \"No!\" -f Green\n \n        #Check if script is executed under elevated permissions - Run as Administrator\n        If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] \"Administrator\"))\n        {  \n            Write-Host \"Please Run this script in elevated mode (Run as Administrator)! \" -NoNewline\n            Read-Host \"Press any key to continue\"\n            Exit\n        }\n \n        Write-host \"Installing SharePoint Online PowerShell Module...\" -f Yellow -NoNewline\n        Install-Module \"Microsoft.Online.SharePoint.PowerShell\" -Force -Confirm:$False\n        Write-host \"Done!\" -f Green\n    }\n    Else\n    {\n        Write-host \"Yes!\" -f Green\n        #sharepoint online powershell module import\n        Write-host \"Importing SharePoint Online PowerShell Module...\" -f Yellow  -NoNewline\n        Import-Module \"Microsoft.Online.SharePoint.PowerShell\" -DisableNameChecking\n        Write-host \"Done!\" -f Green\n    }\n}\nCatch{\n    write-host \"Error: $($_.Exception.Message)\" -foregroundcolor red\n}\n\n\nRead more:&nbsp;<a href=\"https:\/\/www.sharepointdiary.com\/2018\/12\/install-update-uninstall-sharepoint-online-powershell-module.html#ixzz7AHzuJAGZ\">https:\/\/www.sharepointdiary.com\/2018\/12\/install-update-uninstall-sharepoint-online-powershell-module.html#ixzz7AHzuJAGZ<\/a><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Check Check the version installed on the Host Computer Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version Nothing will be printed if not installed Install Run PowerShell as Administrator Install-Module Microsoft.Online.SharePoint.PowerShell After Confirming :Y the green installing message will appear for just a moment as package is only a few MB *If Administrative Privileges are not &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/doubleecpu.com\/index.php\/sharepoint-online-powershell-module\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Sharepoint Online Powershell Module&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2475","page","type-page","status-publish","hentry"],"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/2475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/comments?post=2475"}],"version-history":[{"count":3,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/2475\/revisions"}],"predecessor-version":[{"id":2481,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/2475\/revisions\/2481"}],"wp:attachment":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/media?parent=2475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}