Friday, 23 April 2021

How to get list of items with linked items using Sitecore PowerShell script ?

I was trying to get list of items with directly linked items using PowerShell script.
Since from Sitecore content editor at a time can see linked items only for individual items, so thought to share with all.

Below is the script hope, this will help

    
$allImages = Get - ChildItem - Path 'master:/sitecore/media library/Images' - recurse
$results = @();
$allImages | ForEach - Object {
    $sproperties = @{
        SID = $_.ID
    }

    $referer = Get - ItemReferrer - ID  $sproperties.SID
    $properties = @{
        Name = $_.Name
       ID = $_.ID
       Path = $_.ItemPath
       LinkedItemIds = $referer.ID
    }
    $results += New - Object psobject - Property $properties
}

$results | Select - Object - Property Name, Path, LinkedItemIds

Wednesday, 10 March 2021

Sorry, there was an error : unauthorized_client Sitecore

Issue

Sometimes, after fresh instance setup maybe getting error on the login screen


sitecore-login-issue


Fix

1. go to C:\inetpub\wwwroot\<identityServer Instance Name>\Config\production\Sitecore.IdentityServer.Host.xml

2. update AllowedCorsOriginsGroupN values from http to https

3. AppPool recycle



Now check, hope this will work.