Instantly share code, notes, and snippets.
I help teams succeed with agile and the cloud | Start with Why | DevOps | Multi-cloud | Agile Coach
-
IAMPetro
- Melbourne, Australia
- https://www.iampetro.com
IAMPetro
/ SharePoint.ImportingLists.Example2.ps1
Created
December 12, 2016 02:08
SharePoint: Importing SharePoint Libraries & Lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example - We will Import the Library exported above into the "Organizational Reports" | |
# team site located in a different Site Collection called "Reporting" | |
# The destination URL is http://intranet.contoso.com/sites/Reporting/OrganizationalReports | |
Import-SPWeb -Identity http://intranet.contoso.com/sites/Reporting/OrganizationalReports -path "C:\Exports\FinanceDepartment_ReportsLibrary.cmp" |
IAMPetro
/ SharePoint.ImportingLists.Example1.ps1
Created
December 12, 2016 02:08
SharePoint: Importing SharePoint Libraries & Lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will Import a Library saved on the SharePoint Servers disk into a team site. | |
Import-SPWeb -Identity http://<SharePoint>/sites/<siteCollection>/<siteName> -path "<destinationFolder\fileName.cmp>" |
IAMPetro
/ SharePoint.GAC.Example6.ps1
Created
December 12, 2016 02:05
SharePoint: Recompiling a DLL from the GAC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Searches through the Directory specified above | |
dir <fileName> /s | |
# Heres what we could have used to search for the DLL initially | |
dir Microsoft.SharePoint.Powershell.dll /s |
IAMPetro
/ SharePoint.GAC.Example5.ps1
Created
December 12, 2016 02:04
SharePoint: Recompiling a DLL from the GAC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Changes the Directory to a folder I believe might contain what I'm looking for | |
cd \windows\ |
IAMPetro
/ SharePoint.GAC.Example4.ps1
Created
December 12, 2016 02:04
SharePoint: Recompiling a DLL from the GAC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export the DLL to the local drive | |
copy *.dll C:\<preferred folder>\ |
IAMPetro
/ SharePoint.GAC.Example3.ps1
Created
December 12, 2016 02:03
SharePoint: Recompiling a DLL from the GAC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the Change Directory command to enter the version folder | |
cd 14.0.0.0__71e9bce111e9429c |
IAMPetro
/ SharePoint.GAC.Example2.ps1
Created
December 12, 2016 02:03
SharePoint: Recompiling a DLL from the GAC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First locate the Microsoft.SharePoint.PowerShell DLLs directory | |
cd Microsoft.SharePoint.PowerShell | |
# Second we need to obtain the version + public token string | |
dir |
IAMPetro
/ SharePoint.GAC.Example1.ps1
Created
December 12, 2016 02:02
SharePoint: Recompiling a DLL from the GAC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This Changes the Directory to the GAC Assembly folder | |
cd \windows\assembly\GAC_MSIL |
IAMPetro
/ SharePoint.Kerberos.Example6.ps1
Created
December 12, 2016 02:00
SharePoint: Kerberos Authentication Part 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This command will delete all of the Kerberos tickets held by the logged in user | |
klist purge |
IAMPetro
/ SharePoint.Kerberos.Example5.ps1
Created
December 12, 2016 02:00
SharePoint: Kerberos Authentication Part 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This will list all of the Kerberos tickets held by the currently logged in user | |
klist |