OfficeDev/PnP – PowerShell for Office365 Administrators.

We all know the big gap between PowerShell Cmdlets available for SharePoint Server (On-Premises) and SharePoint Online (Office365), which made things bit difficult for administrators as they had to use or understand Client Side Object Model (CSOM) to get very basic task done on SharePoint Online ¹ . But now thanks to OfficeDev/PnP we have got lot more powerful and useful cmdlets to add in our arsenal.

To get started you have two setups available PnPPowerShellCommands15.msi and PnPPowerShellCommands16.msi, which you can download from here. If you are wondering what it means by 15 and 16 refer to this, basically 15 is more supported towards Server (On-Premises) version of SharePoint and 16 is more targeted toward SharePoint Online version of CSOM SDK ².

After completing the installation, you will find OfficeDev/PnP-PowerShell Module added when you do Get-Module -ListAvailable

OfficeDevPnPPSAs you can see here there is a clear distinction in the Namespace used to differentiate Module available thru Microsoft and OfficeDevPnP, though Noun prefix is kept same “SPO”, as they might be merged moving ahead? I hope.

To get the list of all the cmdlets available in OfficeDevPnP.PowerShell.Commands use following,

Finally I would like to thank all the contributors and PnP Team working on this project for all their efforts. Hope this list keeps on growing.

References :
[1] Using CSOM in PowerShell scripts with Office 365
[2] How do I run the Office 365 Developer Patterns and Practices against SharePoint 2013 On Premises?

Dev is a SharePoint Infrastructure Consultant working with Zevenseas from last 4+ years. Helping various organizations to execute projects around On-Premises or Cloud Hosted SharePoint Infrastructure. He also love spending time working for PUG by organizing events, delivering session and conducting HOLs on latest Microsoft Infrastructure Technologies.

4 Comments

  1. Great article, Dev. I’m having a problem in that the module is not getting loaded. Get-Command -Module OfficeDevPnP.PowerShell.Commands returns nothing. When I try to execute specific commands I get some thing like

    Export-SPOTaxonomy : The ‘Export-SPOTaxonomy’ command was found in the module ‘OfficeDevPnP.PowerShell.Commands’, but the module could not be
    loaded. For more information, run ‘Import-Module OfficeDevPnP.PowerShell.Commands’.

    However, when I try to import the module I get

    import-module : The specified module ‘OfficeDevPnP.PowerShell.Commands’ was not loaded because no valid module file was found in any module
    directory.
    At line:1 char:1
    + import-module OfficeDevPnP.PowerShell.Commands
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ResourceUnavailable: (OfficeDevPnP.PowerShell.Commands:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

    I installed the PnPPowerShellCommands16.msi.

    Any thoughts?

    Thanks,
    -Haniel

  2. Make sure your PSModulePath environment variable contains the parent folder of the “OfficeDevPnP.PowerShell.Commands” Folder. I edited this variable both for my user and the System and voilà! it worked.

Leave a Reply