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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<powershell> | |
<services> | |
<remoting> | |
<patch:attribute name="enabled">true</patch:attribute> | |
<authorization> | |
<add Permission="Allow" IdentityType="User" Identity="sitecore\admin" /> | |
</authorization> | |
</remoting> |
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
# Michael West | |
# Example adding environment variables for use with Sitecore XP 9.3+ and the Publishing Service. | |
# Be sure to restart IIS every time you make changes. | |
$appsettingsPrefix = "SITECORE_APPSETTINGS_" | |
$connectionPrefix = "SITECORE_CONNECTIONSTRINGS_" | |
$publishingConnectionPrefix = "SITECORE_SITECORE__PUBLISHING__CONNECTIONSTRINGS__" | |
$databaseServerName = "{REPLACE_WITH_DATABASE_SERVER_NAME}" | |
$searchServerName = "{REPLACE_WITH_SEARCH_SERVER_NAME}" |
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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" | |
xmlns:set="http://www.sitecore.net/xmlconfig/set/" | |
xmlns:role="http://www.sitecore.net/xmlconfig/role/" | |
xmlns:environment="http://www.sitecore.net/xmlconfig/environment/"> | |
<sitecore role:require="Standalone or ContentManagement"> | |
</sitecore> | |
</configuration> |
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
Import-Function -Name Invoke-SqlCommand | |
$connection = [Sitecore.Configuration.Settings]::GetConnectionString("core") | |
$query = @" | |
SELECT TOP (10) * | |
FROM [dbo].[aspnet_Membership] | |
WHERE [IsLockedOut] = '1' | |
"@ | |
Invoke-SqlCommand -Connection $connection -Query $query |
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
# Converted from this answer: https://stackoverflow.com/a/44318312/1277533 | |
class AverageCalculator { | |
[System.Collections.Queue]$Queue | |
[long]$Total | |
[int]$Size | |
AverageCalculator([int]$Size) { | |
$this.Queue = New-Object System.Collections.Queue | |
$this.Size = [Math]::Max($Size, 1) |
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
$selectedForm = Get-Item -Path "master:" -ID ([Sitecore.ExperienceForms.Client.Constants.GeneralConstants]::FormsFolderId) | |
$props = @{ | |
Parameters = @( | |
@{Name="selectedForm"; Value=$null; Title="Choose a form to filter out the results"; Tooltip=""; Editor="treelist"; Source="DataSource=$($selectedForm.ItemPath)&DatabaseName=master&IncludeTemplatesForDisplay=Folder,Form&IncludeTemplatesForSelection=Form"; }, | |
@{ Name = "startDate"; Value=[System.DateTime]::Now.AddDays(-30); Title="Start Date"; Tooltip="Earliest submitted entries to return"; Editor="date"; Columns=6; }, | |
@{ Name = "endDate"; Value=[System.DateTime]::Now; Title="End Date"; Tooltip="Latest submitted entries to return"; Editor="date"; Columns=6; } | |
) | |
Title = "Forms Report" |
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 make your items inherit from /sitecore/templates/System/Geospatial/Coordinate | |
# Leave the existing IPoi there until after Go Live otherwise the data will be lost (or you have to run the import again) | |
# TODO : Update the import script to use the new field | |
# Change to the root ID for items which use the IPoi template | |
# Careers | |
#$rootId = "{B8208D4B-C25E-4381-A183-4177E47A9310}" | |
# POIs | |
$rootId = "{60365D59-F2F2-4C49-91DA-9C7B046178CF}" |
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
$device = Get-LayoutDevice -Default | |
$sites = [Sitecore.Configuration.Factory]::GetSiteInfoList() | |
foreach($site in $sites) { | |
$isTrackingEnabled = [Sitecore.MainUtil]::GetBool($site.Properties["enableTracking"], $true) | |
if($isTrackingEnabled -or [string]::IsNullOrEmpty($site.TargetHostName)) { continue } | |
$homeItem = Get-Item -Path "$($site.RootPath)/$($site.StartItem)".Replace("/sitecore", "master:") | |
Write-Host "Checking $($homeItem.ItemPath)" | |
foreach($rendering in $homeItem.Visualization.GetRenderings($device, $false)) { | |
if($rendering.Settings.Rules.Count -le 0) { continue } | |
$rendering |
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
# https://exiftool.org/TagNames/EXIF.html | |
# https://stackoverflow.com/questions/27835064/get-image-orientation-and-rotate-as-per-orientation | |
# http://fredericiana.com/2013/05/23/imagetwist-exif-rotation-addon/ | |
# https://www.cyotek.com/blog/handling-the-orientation-exif-tag-in-images-using-csharp | |
enum ExifOrientation { | |
RotateNoneFlipNone = 1 | |
Rotate90FlipX = 5 | |
Rotate90FlipNone = 6 | |
} | |
#[System.Drawing.RotateFlipType]::Rotate90FlipNone |
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
Import-Function -Name Invoke-SqlCommand | |
$connection = [Sitecore.Configuration.Settings]::GetConnectionString("master") | |
$query = @" | |
SELECT | |
a.[ID], | |
a.[Name], | |
a.[ParentID] | |
FROM [dbo].[Items] a |