SharePoint Automation Gary Lapointe – Founding Partner, Aptillon, Inc.

Downloads

You can get to the index of all my STSADM commands and PowerShell cmdlets here.

SharePoint Online Custom Cmdlets + Source Code
STSADM/Cmdlets Source Code
Download SourceSharePoint 2007 STSADM Extensions and PowerShell Cmdlets Source Code
The source code contains four projects and requires Visual Studio 2008:
  • Lapointe.SharePoint.STSADM.Commands
  • Lapointe.SharePoint.PowerShell.Commands
  • Lapointe.SharePoint.PowerShell.Commands.Setup
  • Lapointe.SharePoint.PowerShell.Commands.Setup64

Download SourceSharePoint 2010 + 2013 STSADM Extensions and PowerShell Cmdlets Source Code

The source code contains three projects and requires Visual Studio 2010:
  • Lapointe.PowerShell.MamlGenerator
  • Lapointe.SharePoint2010.PowerShell
  • Lapointe.SharePoint2013.PowerShell
SharePoint 2010 STSADM Commands and PowerShell Cmdlets WSP Files
SharePoint 2010 Server Cmdlets (x86, x64)
To install for the first time run the following commands (make sure you are in the directory where you downloaded the file):
  1. Add-SPSolution Lapointe.SharePoint.PowerShell.wsp
  2. Install-SPSolution -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment

To upgrade if previously installed run the following commands (make sure you are in the directory where you downloaded the file):

  1. Update-SPSolution -LiteralPath Lapointe.SharePoint.PowerShell.wsp -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment

SharePoint 2010 Foundation Only Cmdlets (x86, x64)

To install for the first time run the following commands (make sure you are in the directory where you downloaded the file):
  1. Add-SPSolution $pwd\Lapointe.SharePoint.PowerShell.wsp
  2. Install-SPSolution -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment

To upgrade if previously installed run the following commands (make sure you are in the directory where you downloaded the file):

  1. Update-SPSolution -LiteralPath $pwd\Lapointe.SharePoint.PowerShell.wsp -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment
SharePoint 2013 STSADM Commands and PowerShell Cmdlets WSP Files
SharePoint 2013 Server Cmdlets (x86, x64)
To install for the first time run the following commands (make sure you are in the directory where you downloaded the file):
  1. Add-SPSolution $pwd\Lapointe.SharePoint.PowerShell.wsp
  2. Install-SPSolution -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment

To upgrade if previously installed run the following commands (make sure you are in the directory where you downloaded the file):

  1. Update-SPSolution -LiteralPath $pwd\Lapointe.SharePoint.PowerShell.wsp -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment

SharePoint 2013 Foundation Only Cmdlets (x86, x64)

To install for the first time run the following commands (make sure you are in the directory where you downloaded the file):
  1. Add-SPSolution $pwd\Lapointe.SharePoint.PowerShell.wsp
  2. Install-SPSolution -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment

To upgrade if previously installed run the following commands (make sure you are in the directory where you downloaded the file):

  1. Update-SPSolution -LiteralPath $pwd\Lapointe.SharePoint.PowerShell.wsp -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment
SharePoint 2007 STSADM Extension WSP Files (SP2 is Recommended)
MOSS Only STSADM Extensions (x86, x64)
To install for the first time run the following commands (make sure you are in the directory where you downloaded the file):
  1. stsadm -o addsolution -filename Lapointe.SharePoint.STSADM.Commands.wsp
  2. stsadm -o deploysolution -name Lapointe.SharePoint.STSADM.Commands.wsp -immediate -allowgacdeployment
  3. stsadm -o execadmsvcjobs

To upgrade if previously installed run the following commands (make sure you are in the directory where you downloaded the file):

  1. stsadm -o upgradesolution -filename Lapointe.SharePoint.STSADM.Commands.wsp -name Lapointe.SharePoint.STSADM.Commands.wsp -immediate -allowgacdeployment
  2. stsadm -o execadmsvcjobs

WSS Only STSADM Extensions (x86, x64)

To install for the first time run the following commands (make sure you are in the directory where you downloaded the file):
  1. stsadm -o addsolution -filename Lapointe.SharePoint.STSADM.Commands.WSS.wsp
  2. stsadm -o deploysolution -name Lapointe.SharePoint.STSADM.Commands.WSS.wsp -immediate -allowgacdeployment
  3. stsadm -o execadmsvcjobs

To upgrade if previously installed run the following commands (make sure you are in the directory where you downloaded the file):

  1. stsadm -o upgradesolution -filename Lapointe.SharePoint.STSADM.Commands.WSS.wsp -name Lapointe.SharePoint.STSADM.Commands.WSS.wsp -immediate -allowgacdeployment
  2. stsadm -o execadmsvcjobs
SharePoint 2007 PowerShell Cmdlet Installers
Sample SharePoint 2007 Scripts
Windows PowerShell MAML (Help) Generator
Windows PowerShell ISE V3 Copy as HTML Add-on
  • Falchion.PowerShell.CopyAsHtmlAddOn.zip
    This is an add-on for Windows PowerShell ISE V3 which allows you to copy text as HTML for pasting into applications such as Windows Live Writer. You can find more details here.
CodePlex / Demo Projects
Go to CodePlex projectWeb Part Page History (SharePoint 2007) 
SharePoint 2007 has made great improvements over previous versions in the handling of item versioning. However, many have noticed that web part pages did not benefit from the versioning changes. While page fields and associated meta data is properly versioned, web part changes are not. This is true of publishing pages as well as standard web part pages within a document library. The purpose of this project is to capture these changes and allow a seamless integration with the out of the box restore mechanisms.

Go to CodePlex projectCustom SharePoint STSADM Commands Template (SharePoint 2007)

A simple template Visual Studio project that can be used as a starting place for creating your own custom SharePoint 2007 STSADM extensions. The project includes utilities and classes to help declare and work with parameters as well as build a WSP solution to deploy your new extensions.

Download projectCustom Site Collection Creation Page (SharePoint 2007)

A complete custom site collection provisioning application with source code and deployable WSP package. More information can be found here: http://blog.falchionconsulting.com/index.php/2009/07/custom-sharepoint-2007-site-collection-creation-page/
Presentations

Download PowerPointSharePoint 2010 & PowerShell: Tips, Tricks, and Random Goodness

I presented this at the November 2011 SharePoint Saturday Denver conference.

Download PowerPointTaxonomy Based Content Targeting for a SharePoint 2010 Internet Site

I presented this at the November 2011 SharePoint Saturday Denver conference.

Download PowerPointWindows PowerShell for SharePoint 2010 Administrators

I presented this at the European Best Practices Conference in London, April 2011. There's really not much going on in the deck as the bulk of the presentation was walking through various PowerShell examples.

Download PowerPointWindows PowerShell for SharePoint 2010 Developers

I presented this at the European Best Practices Conference in London, April 2011. There's really not much going on in the deck as the bulk of the presentation was walking through various PowerShell examples.

Download PowerPointVariations and the MUI in SharePoint 2010

I presented this at the June Colorado Springs SharePoint User Group Meeting and will be doing it again at the October 2010 SPTechCon Event in Boston.

Download PowerPointPowerShell with SharePoint 2010

I've presented this deck at several events including SharePoint Saturday Denver and Atlanta as well as TEC2010. The PowerShell demo code I used can be found in the notes section of the first slide.

Download PowerPointUpgrading to SharePoint 2010

I recently presented this deck at the Colorado Springs SharePoint User Group Meeting and did a trimmed down version of it for a live webcast in March. There's also a recording of the demo (~21MB) which I used during the presentation (the recording does not contain any audio but will help you see what the upgrade experience looks like).

Download PowerPointUsing Content Types to Improve Discoverability (SharePoint 2007)

I presented this deck at the Best Practices Conference in February of 2009. The content is specific to SharePoint 2007 (lots has changed with 2010).

Download PowerPointSub-site or Site Collection: Best Practice Approaches, Considerations, and Lessons Learned (SharePoint 2007)

I presented this deck at the Best Practices Conference in February of 2009. The content is specific to SharePoint 2007 (not a lot has changed with 2010 but there are new considerations).

Use of any downloads is at your own risk. Gary Lapointe cannot be held liable for any damage done to your environment.

You may not repackage or sell any of the downloads or associated source code. Downloading implies that you acknowledge these restrictions.

Comments (137) Trackbacks (0)
  1. When I try to install the STSADM extensions, I get an error:

    Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass
    embly ‘Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7
    1e9bce111e9429c’ or one of its dependencies. The system cannot find the file spe
    cified.
    File name: ‘Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyTo
    ken=71e9bce111e9429c’
    at Microsoft.SharePoint.StsAdmin.SPStsAdmin.Main(String[] args)

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\M
    icrosoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure lo
    gging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus
    ion!EnableLog].

    Now, I know that it should be referencing version 12. Am I doing something wrong

  2. Well that’s a new one – I honestly don’t know what’s up with that (my stuff is obviously built to the 12.* dlls and not the 11.* dlls.

  3. Hi Gary

    You have popped a link to my 64 bit MSI blog posting. However, I have now moved my blog so the post is now here : http://www.collaboris.co.uk/blogs/mark/09-04-21/Building_an_MSI_in_Visual_Studio_2005_2008_to_work_on_a_SharePoint_64_bit_installation_with_a_Custom_Action.aspx

    Cheers
    Mark

  4. I’m trying to install the powershell and I’m getting an error Error 1001 Unable to get installer types in the c:\program files\Gary Lapointe\PowerShell Commands for Sharepoint. PowerShell.Commands.dll assembly -> Unable to load one or more of the rquested types. Retrieve the LoaderExceptions property for more information. Any ideas?

  5. Make sure you have PowerShell 1.0 installed and that you downloaded the right version for your environment (x86 or x64).

  6. Hi Gary,

    I have downloaded the STSADM Commands template to create my own operations. It was working fine until recently that my team wants to sign the assembly with another key with password protected. (Default used: key.snk)

    When I build the program and tries to list down the operation in the Command Prompt, I received an error.

    Unhandled Exception: System.ArgumentNullException: Value cannot be null.

    What should I do to change the key file?

    - Jin

  7. If you change the key then you need to update the xml files with the new public key token.

  8. Thanks Gary… I got it. =)
    - Jin

  9. Do I need Powershell installed to run the commands. I downloaded the Moss only .wsp and tried running the first command as per instructions in the same directory. Gets the ‘stsamd is not recognized error’.
    am i missing anything

  10. You don’t need powershell for stsadm. You just need navigate to the 12 hive’s bin folder and run from there (or add that path to the path environment variable).

  11. When I try to install the STSADM extensions for MOSS, I get:
    “Object reference not set to an instance of an object.”
    During the addsolution step. Any advice?

  12. Make sure you are running as a farm admin.

  13. Is there a way to use your commands to set or create a new site collection role? Example: I have been asked to create a new role called “Author” and grant all permissions except Create subsites. This is not a web app policy but rather created under each site colleciton, of which we have over 50 :(

  14. Unfortunately I don’t have any commands that support this directly. You could do using PowerShell though.

  15. Great set of tools. They saved me a bunch of time and hassle migrating from WSS 3.0 to MOSS 2007.

  16. Bringing Site Columns for document metadata from 2003 to Moss….not sure how. Any ides or canned material?

  17. I installed the MOSS commands withoout a problem. However when i install the WSS commands I get the following error:
    A solution with the same name “lapointe.sharepoint.stsadm.commands.wsp” or id “
    2625fbe6-4884-4666-a1ae-6b06f0db8a6f” already exists in the solution store.
    Lapointe.SharePoint.STSADM.Commands.WSS.wsp: The Solution installation failed.

  18. You only need the one matching your environment – not both.

  19. Hi Gary
    I have 5 different master pages which needs to be applied to the site on daily basis. I dont have powershell and would like to make a .bat file and use windows scheduler to apply the masterpage. How can I go about this?? Thanks..

  20. You can use my gl-setmasterpage command but honestly your requirement seems a bit odd – why do you need to reapply your masterpage every night?

  21. We have got 5 masterpages with different color schemes so need to apply different color on different day… So would like to do it automatically…. I tried what you explained in your blog… but getting an error on these lines:

    “parameters.Add(new SPParam(“url”, “url”, true, null, new SPUrlValidator(), “Please specify the web url.”)); 23: parameters.Add(new SPParam(“sitemaster”, “sitemp”, false, null, new SPNonEmptyValidator())); 24: parameters.Add(new SPParam(“systemmaster”, “sysmp”, false, null, new SPNonEmptyValidator())); 25: parameters.Add(new SPParam(“resetsubsites”, “reset”)); 26: parameters.Add(new SPParam(“systemsource”, “syssrc”, false, null, new SPUrlValidator())); 27: parameters.Add(new SPParam(“sitesource”, “sitesrc”, false, null, new SPUrlValidator()));”

    the error msg is missing name space for SPUrlValidator…. I have referenced the Lapointe.sharepoint.stsadm.commands in the project still its not building… can you please help… Thanks Cheers

  22. You should just deploy the WSP and call the command rather than trying to call my assembly directly from code (it’s not really intended to be used by code). If I were you though I’d change my master page so that it dynamically loads a css file based on the day rather than trying to swap the master page every day (1 masterpage, 5 css files) – changing the masterpage daily is a very unusual way to solve the problem you’ve identified.

  23. Hi Gary,
    I am looking for STSADM command that change the authentication type of site to FBA and set FBAProvider and RoleProvider is there any command available for that please let me know.

    Many many thanks,
    Jay

  24. Gary,
    Can I download an older version of stsadm extension somewhere?

    The SP1 (or maybe older) version. Thanks,
    Sanjay

  25. Unfortunately I don’t maintain older versions – what’s the specific issue you are having with the current version?

  26. I don’t have any FBA related commands – not sure if anyone else has published anything.

  27. I’m attempting to install the PowerShell commands Setup64.msi on a 64-bit OS (W2K3 R2) with MOSS 2007 SP2 and get the following error: “Error 1001: An exception occured in the OnAfterInstall event handler of Lapointe.SharePoint.PowerShell.Commands.SnapIn -> The SPFarm object cannot be null”.

    BTW – The .wsp loaded fine ;o)

    – JC

  28. Currently the cmdlets only install on PowerShell V1 – if you have V2 installed it will give that error.

  29. Thanks for the awesome post!!! Very good information and it will save us a lot time writing scripts for site creation. I live in Colorado Springs too, so that makes it all the better!

    – Jeremy

  30. Hi Gary ,
    I have just spend some hours trying to use garys stsadm cmd here
    http://blog.falchionconsulting.com/index.php/stsadmpowershell-commands/

    I have a list on a Subsite A that i need to export.(http://myserver:4040/sites/Test/Misc/Lists/SC/AllItem.aspx)
    And then import it to another subsite B .(http://myserver2:4040/sites/CCC/Misc/Lists/SC/AllItem.aspx)

    I did create the subsite MISC intentionally on site subsite B so that the URL could be the same

    But i have some questionns regarding the command:
    I used C:\>stsadm -o gl-exportlist

    but i noticed in the log file it also did export all other lists and documents lib under the MISC Subsite A:(.

    So when i do
    stsadm –o gl-importlist
    it cmd stops and complain that those lists and document libs don’t exist in SUBSITE B which is true.

    Later i tried using
    C:\>stsadm -o gl-exportlistitem and
    C:\>stsadm -o gl-importlistitem

    But it did the same.
    How can i just export all items in a specific list.
    THanks in Advance

  31. Hi Gary,

    First of all congratulations for this set of tools. Unfortunately, I can’t use them and dunno why.
    I’m using WSS 3.0 and I installed the WSS tools version without problems.
    I can see the new commands just executing stsadmn. However, when I try to use them or run the help with any of your commands, it’s like if it were a wrong command what was specified.

    Any idea about this?

    Thank you in advance.

    Akuma

  32. Not sure they are not working for you. I know there are sometimes issues when people copy and paste the command and the hyphen gets changed to a unicode hyphen.

  33. Patrick – try playing with some of the include and exclude parameters (can’t remember what I named them but do a help on the commands and you’ll see them) – you should be able to exclude all dependencies and children on the export.

  34. Hey Gary.

    I am unable to download any of the files. I jsut get a Page cannot be displayed error from every computer I am trying this from. I’m not the smartest guy in the world but I am usually pretty good at downloading stuff. Any chance you could help me with this? The tools sound great and could make my life much easier.

    Jonathan

  35. My site might have been down for a bit – seems to be working now so you might just want to try again.

  36. Hi Gary,

    First of all thanks for the wonderful article.I ran this command on Widows 2003 OS with SP1 on dev server and everything worked fine. I want to run the comand on productio server which has Win 2008 server with SP1. Is it okay to run the stsadm command with SP1 on Win 2008 OS. Thanks for your help.

    Regards,
    -Reetu

  37. Server OS doesn’t matter.

  38. Gary, Im getting an Object reference not set to an instance of an object error. I am logged on as the farm admin. I have SP1 installed and not SP2, would this cause this error?

  39. What command are you running?

  40. Sorry, just trying to install the solution

    stsadm -o addsolution -filename ….

  41. That sounds like there’s something wrong with your farm. I’m assuming you’re using an account that has farm admin rights and that you have the path to the WSP file path correct and that your farm is actually built (you’d probably get a different error otherwise). You might want to check the ULS logs to see if you can get a stack trace – that might help to narrow down the issue.

  42. I am very interested in using these, but since I’m on Windows 7 I’m kind of stuck. Are there any plans to make this v2 compatible?

  43. I’m working on the 2010 version which should be released soon.

  44. Is there a way to change the ID of this solution? Some must have created a solution with the same name. I get A solution with the same name “duke.sharepoint.stsadm.comands.wsp” or id “2625fbe6-4884-4666-a1ae-6b06f0db8a6f” already exists in the solution store.

  45. Looks like someone used my source and modified it – you’ll want to retract the other solution and change the solution ID.

  46. Hi,
    I’m trying to install the commandlets on a 64-bit OS with MOSS 2007, but, like John, I see the following error:
    “Error 1001: An exception occured in the OnAfterInstall event handler of Lapointe.SharePoint.PowerShell.Commands.SnapIn -> The SPFarm object cannot be null”
    You responded by saying this could be because PowerShell v2 was installed instead of v1. My machine definitely has v1. Are there any other causes for this error?
    Thanks

  47. When I install OServer2010, after the MOSS configuration is done, there is a “configuration wizard” just on the left bottom of the central administration. (for 1m Farm)

    Is there a command line to done the function as the “configuration wizard”? (so all the servics will be done?)

    I am realy need the command line version of the script, for I have not use the powershell of other part of the batch file.

    Any suggestion?
    Big thanks in advance.

  48. Scripting all the service applications is possible but very complex. There are some scripts that have been posted (by myself and others) – I’ll eventually post for all of them but I’m not quite ready to do that (and may delay for quite a while as I’m writing a book which will cover this and don’t want to blog all my content).

  49. Hi, Gary

    Thanks for your blogs, and also looking for the book.

    aah, maybe I can help to translate it to Chinese version:)

    I am a vendor tester working for Office14 from beijing, and I need install OServer again and again, your scripts help me a lot.

    When is your book going to published?

  50. After installed, in powershell I get an error;
    There were errors in loading the format data file:Lapointe.SharePoint.PowerShell.Commands, C:\Program Files\Gary Lapointe\PowerShell Commands for SharePoint\Console.psc1 Commands for Sharepoint\Lapointe.SharePoint.Format.pslxml : File skipped because of validation exception: “File C:\Program Files\Gary Lapointe\PowerShell Commands for SharePoint\Lapointe.SharePoint.Format.ps1xml cannot be loaded because the execution of scripts is disabled on this system

  51. You need to enable script execution.

    set-executionpolicy remotesigned

  52. Would I be able to install/use the STSADM extensions on MOSS 2003?

  53. Sean – unfortunately no – the architecture for stsadm (and indeed just about everything else) changed drastically between 2003 and 2007 so none of the stuff I’ve put together will work on 2003 – time to upgrade :)

  54. Hi Gary,

    Do you know how to read core.resx file programmatically in a similar way you read files located under App_GlobalResources?
    Because I’m a having a hard time trying to do that. No doc found on it.

    Great code & great blog!

  55. Lucas – Here’s an example showing how to do it:

    SPUtility.GetLocalizedString(“$Resources:core,Folder”, null, (uint)web.Locale.LCID));

  56. Thank you for creating and publishing the cmdlets. They are extremely beneficial and save me a ton of work and aggravation.

  57. We just upgraded to a newer version of your great tools (MOSS 2007, SP2, CU August 2010). Now the “gl-copylistsecurity” command does not longer work:

    Start Time: 16.09.2010 09:33:56.
    Progress: Added “xyz” role definition to target role assignment
    “zyx”.

    Error Type: System.InvalidOperationException
    Error Message: Der Vorgang ist für ein Objekt, das Berechtigungen erbt, nicht
    zulässig.
    Error Source: Microsoft.SharePoint
    Error TargetSite:Void UpdateAssignment(Int32, Microsoft.SharePoint.SPRoleDefinit
    ionBindingCollection, Boolean)
    Error Stack Trace:
    bei Microsoft.SharePoint.SPRoleAssignmentCollection.UpdateAssignment(Int32 pr
    incipalId, SPRoleDefinitionBindingCollection bindings, Boolean addOnly)
    bei Microsoft.SharePoint.SPRoleAssignment.Update()
    bei Lapointe.SharePoint.STSADM.Commands.Lists.CopyListSecurity.CopyRoleDefini
    tionBindings(SPWeb targetWeb, SPRoleAssignment sourceRoleAssignment, SPRoleAssig
    nment targetRoleAssignment, Boolean quiet)
    bei Lapointe.SharePoint.STSADM.Commands.Lists.CopyListSecurity.SetObjectSecur
    ity(SPWeb targetWeb, SPWeb sourceWeb, ISecurableObject sourceObject, ISecurableO
    bject targetObject, Boolean quiet, String itemName)
    bei Lapointe.SharePoint.STSADM.Commands.Lists.CopyListSecurity.CopySecurity(S
    PList sourceList, SPList targetList, SPWeb targetWeb, Boolean includeItemSecurit
    y, Boolean quiet)
    Finish Time: 16.09.2010 09:33:56.

    Any ideas?
    The old version still works very well after installation of CU august 2010.

    We have been able to replicate this problem on two different servers.

    Thanks a lot.

    Kind regards,

    Christian

  58. Hi Gary,

    I have been trying to use the CopyList and Import/Export commands and while it claims i have been successful nothing is appearing in the target list – the log files record the list item ids being copied but nothing appears in the target list? any ideas

  59. Question on SP2010 cmdlets…I successfully installed the .wsp and can access the stsadm gl- commands but I don’t seem to have any visibility to the powershell cmdlets at all. Did I miss something?

    Bought the book – great read so far!

    – John

  60. Have to ask the obvious first: are you using the SP Management Shell or otherwise loading the snap-in (after installing the WSP)? If you’re in the same session as you were when you installed the WSP then you need to remove the snap-in and re-add it.

  61. I just upgraded to SharePoint 2010 Foundation on Small Business Server 2010. I’m missing your excellent gl-backupsites extension. I tried to install your SharePoint 2010 Server Cmdlets (x86, x64) but Powershell 2.0 doesn’t include the Add-SPSolution cmdlet. Am I stuck?

  62. If you load the SharePoint 2010 Management Shell then that will have the SharePoint PowerShell snap-in loaded which includes the Add-SPSolution cmdlet. You can then install my 2010 cmdlets and you’ll have the Backup-SPSite cmdlet that replaces the gl-backupsites stsadm command.

  63. I’ve found that the sp2010 commandlets install into the GAC but I can’t use Add-PSSnapin to include them into the command shell (either a new one or the existing one). Also, an entry for the snapin doesn’t show up in the registry here:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns

  64. I now notice that the commands are added automatically…but it is still strange that I can’t use Add-PSSnapin

  65. No idea why Add-PSSnapin isn’t working for you as that’s actually been around since PowerShell 1.0 so there’s nothing new there.

  66. Mark – just saw your first comment so now your statement about add-pssnapin makes more sense to me :) (downside of reading email from most recent first).

    So – my PowerShell commands don’t are not a standalone snap-in – they are registered by the Microsoft.SharePoint.PowerShell snapin so there’s nothing you need to do other than deploy the WSP. This adds the appropriate registration files that are needed by the SharePoint Snapin so that the cmdlets are registered just as though it were part of the built in snap-in.

    Hope this clarifies.

  67. If you load the SharePoint 2010 Management Shell then that will have the SharePoint PowerShell snap-in loaded which includes the Add-SPSolution cmdlet. You can then install my 2010 cmdlets and you’ll have the Backup-SPSite cmdlet that replaces the gl-backupsites stsadm command.

    OK, I figured out how to load the SharePoint snap-in, but I still can’t install your cmdlets. See http://i2.photobucket.com/albums/y10/JonF/Install.png.

  68. OK, I figured out why add-spsolution didn’t work. It requires the full pathname of the file even though the file is in the current directory. I’m an old-timey command-line guy, but I gotta ask … who really thinks PowerShell and Exchange Management Shell and SharePoint 2010 shell are better?

  69. :)
    PowerSehll as a technology is better but it’s up to the cmdlet authors to test their stuff properly – and in the case of SharePoint, testing was not exactly optimal. In this case they should have accounted for a relative path but they didn’t test that scenario. One way you can get around it is to use the Resolve-Path cmdlet.

  70. FYI – cannot download the WSS v3 WSP file – getting a javascript error when I click the “I Agree” button. Using IE 8 on Windows 7

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; FDM; InfoPath.3; MS-RTC LM 8)
    Timestamp: Tue, 4 Jan 2011 02:12:39 UTC

    Message: Object expected
    Line: 8
    Char: 2
    Code: 0
    URI: http://www.thelapointes.com/blog/license.js

    Message: Object expected
    Line: 8
    Char: 2
    Code: 0
    URI: http://www.thelapointes.com/blog/license.js

    Message: Object expected
    Line: 8
    Char: 2
    Code: 0
    URI: http://www.thelapointes.com/blog/license.js

    Message: Object expected
    Line: 8
    Char: 2
    Code: 0
    URI: http://www.thelapointes.com/blog/license.js

    Message: Object expected
    Line: 8
    Char: 2
    Code: 0
    URI: http://www.thelapointes.com/blog/license.js

    Message: Object expected
    Line: 8
    Char: 2
    Code: 0
    URI: http://www.thelapointes.com/blog/license.js

    • Thanks Ivan! I had made a change to my analytics stuff and didn’t realize that Google made a breaking change with their updated page tagging. I reverted back to the old code and that seems to have fixed it.

  71. I am trying to download “MOSS Only STSADM Extensions (x86, x64)” and the link is not working. I am getting “Page cannot be found” message.

    • I’m working on it. I had only partially migrated the blog as the downloads were coming from the domain which also hosts my email and I wasn’t ready to move that. I’ve updated my DNS information this morning for that domain so eventually it will point to the new location.

  72. Hi gary,

    Since you moved your site it’s impossible to download the extension from this page
    http://www.thelapointes.com/blog/Lapointe.SharePoint.STSADM.Commands.wsp i get an error page not found :(

    • I’m working on it. I had only partially migrated the blog as the downloads were coming from the domain which also hosts my email and I wasn’t ready to move that. I’ve updated my DNS information this morning for that domain so eventually it will point to the new location.

  73. Your WSPs seems to be missing. And new site is very very slow compared to your blogspot site last year.

    Hopefully you can manage problems. And big thanks for great commands!

    • I’m working on it. I had only partially migrated the blog as the downloads were coming from the domain which also hosts my email and I wasn’t ready to move that. I’ve updated my DNS information this morning for that domain so eventually it will point to the new location. As for the speed – it was much slower on my old hosting provider but I feel it is running much faster now – at least it is from where I’m sitting.

  74. Hello, i read your site, and I think that is very good, I try to download your wsp, but not return 404 error, I want download foundation and server 2010 cmdlet.

    Thanks of all

  75. The MOSS Only PowerShell Cmdlets (x64) download link for the SharePoint 2007 PowerShell Cmdlet Installers seems down. The other three work correctly though. Thanks a bunch for publishing these.

  76. While importing Audiences in SP2010 with gl-importaudiences, it seems that predefined GUIDs (from MOSS) are overwritten by SP2010. Using the same trick from one MOSS environment to another works fine.

  77. Great tools Gary. I was just wondering if you have added to them, a way to export/import keywords, Best Bets, and Scopes…I know there’s a way to do it, but I’m certainly no programmer and not sure how to do it. I’ve found this blog, but it’s over my head.

    http://vspug.com/mingssn/2008/05/09/export-keywords-best-bet-for-sharepoint-2007/

    Have you added this functionality to your tools? If not, do you think you could? Thanks

  78. Hi Gary,
    I an trying to deploy SharePoint 2010 STSADM Commands and PowerShell Cmdlets WSP Files.I kept the file at 14/Bin folder.Now when I am trying to run the command
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>Add-
    SPSolution Lapointe.SharePoint2010.Automation.wsp, it is showing
    ‘Add-SPSolution’ is not recognized as an internal or external command,
    operable program or batch file.

    Please suggest a workaround for this.

  79. Gary, I am getting this error using the Save List Items and Files to Disk for 2007:

    Progress: Getting item data for item ’8′
    Value does not fall within the expected range.

    Any ideas?

    Thanks

  80. Gary, thanks for making these available. I’ve used these command line utilities quite a few times over the years. They’re great and have saved me some valuable time.

  81. Hi Gary, while i am trying to run stsadm –o gl-copycontenttypes –sourceurl “http://intranet/operations” -targeturl “http://intranet/hr” -nodoctemplate, i am getting the follwing error.”Missing operation name or the operation name is invalid”. The same error is also coming while i am doing for list import and export command. Please help me out.

    Regards
    Chandan Kumar

  82. Gary,

    I heard you talk today in Denver and enjoyed the session. I could not remember the PowerShell tool you liked over ISE. Can you tell me what it was?

    Scott Maser

  83. Gary,
    I really appreciate your presentation you gave in Denver this weekend. I looked for the PowerPont but none of those listed on your site are the one you used in the presentation. Could you send me a link to it? Thank you!

  84. Hi Gary, I’ve downloaded and successfully installed the SharePoint 2010 Server Cmdlets (x86, x64) on my sharepoint server. However, im not capable of running any of the cmdlets. Its like they dont exists. The WSp intalled properly. If I do a Get-Command your cmdlets are not listed. Have I missed any steps?

  85. Hi I am using sharpeoint2010 sp2 + Aug CU.
    I am getting below error and I validated that solution isntelled and DLL is GACed

    Value cannot be null.
    Parameter name: String

    Appreciate your help.

  86. Gary,

    Excellent Tools. I’m getting an error trying to convert a web to a site.

    ConvertTo-SPSite : Value cannot be null.
    Parameter name: uriString

    By looking at some of the blog entries it looks like you recommended to another getting the same error to download the source code and deploy the debug version so they can get the stack trace. I’ve downloaded the source code and have built it, but my question is how do I install it. I thought maybe there would be a new wsp file but I don’t see one. I just see the dlls. Do I need to put the dlls somewhere or register them?

    Thanks for any help.

    • Visual Studio 2010 has a deploy option in the context menu for the project. Just deploy the debug version, load powershell, attach the debugger to powershell and run the command.

      You can also just try running this after you get the error:
      $Error[0] | select *

      Copy that info here and I’ll see what I can do.

      • Hi Gary,

        I’m seeing the same issue using SharePoint 2013 Foundation. SPF has been patched to the March 2013 PU. The error output I get is:

        writeErrorStream : True
        PSMessageDetails :
        Exception : System.ArgumentNullException: Value cannot be null.
        Parameter name: uriString
        at System.Uri..ctor(String uriString)
        at Microsoft.SharePoint.SPSite..ctor(String
        requestUrl)
        at Lapointe.SharePoint.PowerShell.Common.SiteCollect
        ions.ConvertSubSiteToSiteCollection.ConvertWebToSite(St
        ring sourceurl, String targeturl, SPSiteSubscription
        siteSubscription, Boolean suppressAfterEvents, Boolean
        noFileCompression, String exportedFile, Boolean
        createSiteInDB, String databaseName, Boolean
        createManagedPath, Boolean haltOnWarning, Boolean
        haltOnFatalError, Boolean deleteSource, String title,
        String description, UInt32 nLCID, String ownerName,
        String ownerEmail, String ownerLogin, String
        secondaryContactName, String secondaryContactLogin,
        String secondaryContactEmail, String quota, Boolean
        useHostHeaderAsSiteName)
        TargetObject :
        CategoryInfo : NotSpecified: (:) [ConvertTo-SPSite],
        ArgumentNullException
        FullyQualifiedErrorId : Lapointe.SharePoint.PowerShell.Cmdlets.SiteCollections.
        SPCmdletConvertToSite
        ErrorDetails :
        InvocationInfo : System.Management.Automation.InvocationInfo
        ScriptStackTrace : at , : line 1
        PipelineIterationInfo : {0, 1, 1}

        I hope that helps.

  87. Hi Gary.

    I am wondering if you could help me. I am starting a new WSS 3.0 site and need to do the following.

    Map a web part to a NTFS share on a server, in the web part, I want it to be a tree view of all the sub directories that the users can click on

    When they click on the directory I want a second web part on the same page that would show only a filtered view of the directory to only show PDF files.

    I am pretty sure I have to custom code this, however I am not familiar with VS, C or any other programming language.

    I have tried the page viewer web part for the Folder view on NTFS, but it does not allow a connection to another web page part to display the files inside the folder.

    If you could give me a direction to look that would be great.

    Thanks

  88. Hi,

    We have a customized SharePoint 2010 web site that uses Publishing Infrastructure.

    We have a requirement to separate each sub site into a site collection. When we tried the standard steps to migrate a sub site to a site collection, we keep getting this error in the event log –> “This page is not using a valid page layout. To correct the problem, edit page settings and select a valid page layout”.

    Any advice.

  89. Hi Gary,

    Will your gl-copylist maintain the list item IDs from source list to target list? Thank you

  90. well I found your fantastic stsadm extensions and tried to move an web between 2 site collections but I get every time the same error and I don’t know why.

    Can you give me an advice on help me out with this error? I just created all permission roles on the new target collection and tried it again.

    The Error:

    [8/15/2012 6:13:35 PM] Progress: Importing Role Adding.
    [8/15/2012 6:13:35 PM] Progress: Importing Role Element in Liste hinzufügen.
    [8/15/2012 6:13:35 PM] FatalError: There is an error during importing the Roles tag
    [8/15/2012 6:13:35 PM] Debug: at Microsoft.SharePoint.Deployment.ReadAttribute.String(XmlReader xr, String strAttr, String& str, Boolean bRequired, String strDefault, String strError)
    at Microsoft.SharePoint.Deployment.RolesImport.ProcessSimpleElement(ImportStreamingContext context, XmlReader xr, SqlSession session, SqlCommand comm, Int32 iRow)
    at Microsoft.SharePoint.Deployment.SqlBatchImport.Run()
    at Microsoft.SharePoint.Deployment.SecurityObjectSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.CallSetObjectData(Object obj, SerializationInfo objectData, ISerializationSurrogate surrogate, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObjectDirect(Object objParent, Type objectType)
    at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
    at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
    at Microsoft.SharePoint.Deployment.SPImport.Run()
    [8/15/2012 6:13:35 PM] Progress: Import did not complete.
    [8/15/2012 6:13:35 PM] Finish Time: 8/15/2012 6:13:35 PM.
    [8/15/2012 6:13:35 PM] Duration: 00:02:39
    [8/15/2012 6:13:35 PM] Finished with 0 warnings.
    [8/15/2012 6:13:35 PM] Finished with 1 errors.

    • Check with SharePoint Manager 2010 if the “Description” propertie does exist inside the XML in Role propertie of the web, that you are going to export. In my case, some XML had no description attribute and it was the reason of such error. I`ve edited empty “Description” field of role definition in UI by simple editing (have added 1 sign in empty field and delete it) and saving after that. That was the solution.

  91. HI Gary, I have installed “MOSS Only STSADM Extensions (x86, x64)” on my 2010 farm but I am getting the error “Microsoft SharePoint Foundation Administration Tool has stopped working”. I get this error only when I execute the command
    stsadm -help gl-execadmsvcjobs

    Rest all the commands run fine.Please suggest.

    Also removed the first one and then deployed “SharePoint 2010 Foundation Only Cmdlets (x86, x64)
    ” but still get the same error for the same command.

    Plz suggest

  92. Hi Gary

    Duplicate command name “gl-execadmsvcjobs” found in the extended commands xml file “stsadmcommands.wss.lapointe.xml”
    08/14/2012 02:48:59.30 STSADM.EXE (0x07AC) 0x37A4 SharePoint Foundation General 7884 Critical

    this is the error i found in the ULS logs

    • Any chance you have both the wss and moss files deployed? Also, why are you using the 2007 commands on 2010 – you should be deploying the 2010 stuff (I haven’t touched the 2007 stuff in years).

  93. New User question, i have installed your SharePoint 2010 STSADM Commands and PowerShell Cmdlets WSP File, its added and deployed sucessfully (globally), but when i enter any of the commands, e.g. “Propagate-SPContentType” it says thats not the name of an existing cmdlet, please help. thank you!

  94. Hi,

    Thanks for providing this wonderful tool.

    I noticed that there is a bug in http://www.thelapointes.com/blog/WSPs/SP2010/Server/Lapointe.SharePoint.PowerShell.wsp : in “Lapointe.SharePoint.PowerShell.Cmdlets.xml”

    It is “”
    instead of “”

  95. This tool worked really well in the past, but for some unkown reason suddenly gets stuck on exporting site. Any ideas?

    • The export site code that I use just wraps the Microsoft content deployment API so I’m at its mercy. The API isn’t the most solid and there’s little I can do to fix issues it experiences.

  96. Hi,

    Wonderfull!!!

    I have tried ConvertTo-SPSite, and I always get the same error: “Target name is only supported for objects of type SPDeploymentObjectType.Web” anyone knows why???

    Regards,
    Óscar

  97. Getting the following error during import. Export was successful. Publishing feature is also activated.

    PS C:\> Get-SPSite “http://mwrlls.falconandassociates.ae/sites/dev” | Import-SPN
    avigation -InputFile “C:\a\nav.xml”

    Import-SPNavigation : Cannot find Web with Server Relative URL “/sites/Dev”.
    At line:1 char:82
    + Get-SPSite “http://mwrlls.falconandassociates.ae/sites/dev” | Import-SPNaviga
    tion <<<< -InputFile "C:\a\nav.xml"
    + CategoryInfo : InvalidData: (Lapointe.ShareP…mportNavigation:
    SPCmdletImportNavigation) [Import-SPNavigation], Exception
    + FullyQualifiedErrorId : Lapointe.SharePoint.PowerShell.Cmdlets.SiteColle
    ctions.SPCmdletImportNavigation

    • Are you sure the SPWeb exists?

    • Ali,
      I had the same issue. I believe it is due to either the fact I was copying navigation to a site where the same content and structure did not exist, or if it was because I was copying to a site with a managed path.
      I was able to get around the error by opening the xml file after the export completed, and modifying the second line as follows:

      Changed from serverRelativeUrl=”/” to serverRelativeUrl=”/mymanagedpath/mytargetsite”

      Hope this helps!
      ~Joel

  98. I’m having the exact same probelm as Ali above…
    Import-SPNavigation : Cannot find Web with Server Relative URL

    If I do just a normal Get-SPWeb it finds it without any problems.

  99. Gary, I attended “Automating SharePoint Administration with Windows PowerShell – 2013″ and would like your code if it is still available. I search your blog, but could not pinpoint it. It was a great class. I am still learning. Thanks.

    • I assume you’re talking about the webinar I did for penton media? I honestly don’t remember what code I referenced in that class. If you bing/google a function name that I used you should be able to find it on the blog (assuming I blogged about it). There’s no general download for that webinar.

  100. Hi,
    Used these with 2007 many times with great success, needing the gl-exportlistfolder operation on SharePoint 2010 Server.

    Installed – SharePoint 2010 Server Cmdlets (x86, x64) All ok but gl-exportlistfolder not in list (stsadm.exe |find “gl-”)
    Have I installed the correct wsp? If so is this only available for 2007?

    Any assistance most appreciated
    Regards

  101. Hi Gary,

    Great tools! I am trying to use the Repair SpPage layout URL. I have random 404 errors when I go to ‘shared with’ or ‘change a view column’. I found out it is still trying to use the WSS format.

    I added and deployed your cmdlets on our 2013 foundation farm but when I restart powershell it gives me:

    could not create a CmdletConfiguration for CmdletName New-SPWordConversionJob, CmldetClass , CmdletHelpFile C:\Program
    Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\PowerShell\Help\Lapointe.SharePoint.PowerShell.dll-h
    elp.xml.
    Cannot process argument because the value of argument “implementingType” is null. Change the value of argument “implemen
    tingType” to a non-null value.
    could not create a CmdletConfiguration for CmdletName Get-SPWordConversionJobStatus, CmldetClass , CmdletHelpFile C:\Pr
    ogram Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\PowerShell\Help\Lapointe.SharePoint.PowerShell
    .dll-help.xml.
    Cannot process argument because the value of argument “implementingType” is null. Change the value of argument “implemen
    tingType” to a non-null value.

    If I try to run the Repair cmdlt it does not exist.
    Any tips how to solve this?

    Thanks!

    Daniel

  102. Gary, Great set of tools, thank you for your efforts. Is it possible to use gl-exportlist from SP2010 and gl-importlist to SP2013. The export from 2010 went great but I am getting a mysterious “Command Line Error” when I run the gl-importlist command on the SP2013 side. I am wondering if anything can be manually edited to allow this type of migration. Thank s again.

    • Pretty sure going from 2010 to 2013 won’t work though not sure why you’re getting a command line error. Either way you should use the cmdlets and not the stsadm commands as I’ve not invested any time in making sure stsadm still works (they just kind of came along for the ride and I made sure they compiled and that was it – cmdlets are the way to go).

  103. I downloaded the “SharePoint 2010 Server Cmdlets (x86, x64)” onto my SharePoint 2010 development system. The instance is running SP 2010 version 14.0.7106.5002 and has Visual Studio 2013 version 12.0.30110.00 Update 1. The C:\Windows\Microsoft.NET\Framework64 folder shows v2.0.50727, v3.0, v3.5, and v4.0.30319 with Programs and Features showing .NET Framework 4.5 and 4.51.

    When I run the Add-SPSolution $pwd\Lapointe.SharePoint.PowerShell.wsp command I get the following exception

    Add-SPSolution : Could not load file or assembly ‘C:\Windows\Temp\solution-eb80f134-4905-4db4-a58e-a1babd20f154\Lapointe.SharePoint.PowerShell.dll’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
    At line:1 char:15
    + Add-SPSolution <<<< $pwd\Lapointe.SharePoint.PowerShell.wsp
    + CategoryInfo : InvalidData: (Microsoft.Share…dletAddSolution:SPCmdletAddSolution) [Add-SPSolution], BadImageFormatException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSolution

    Any ideas?

  104. I added and installed the solution for SharePoint 2010 server cmdlts, but they did not show when I entered Get-Command. Is there anything else involved in the installation to make these cmdlts available for use?


Leave a comment

CAPTCHA Image

*

Trackbacks are disabled.