Microsoft est plus rapide que les organisations dans son changement de stratégie et le passage de toute la solution SharePoint à la sauce Moderne entraine quelques soucis.
En effet, de nombreuses organisations ont créées des Sites Intranet Corporate basés sur la technologie des Publishing Site qui n’est pas supportée par les automatismes actuellement implémentés par Microsoft.
Ce type de page est basé sur la technologies des pages Modernes utilisant un Layout spécifique.
Cette logiques est d’ailleurs visible dans les Communication Hub Sites qui permettent d’aggéger les “News” de plusieurs sites dans un seul endroit et ceci sans aucune action du content manager (on retrouve la logique du “Retweet”).
Pour créer un Repost page manuallement, on peut aller dans un site modern et cliquer sur “Add > News Link”
Ce lien peut pointer vers n’importe quoi, même une page publique Bing News par exemple.
On doit fournir à cet instant l’adresse Web de la page à lier, puis un titre, une description et une image associée
Lorsque le formulaire est complété, la page repost apparait comme n’importe quelle News dans la WebPart des News du site (ou Hubsite)
Vous pouvez donc simplement dédier une personne en charge de la création de ces “Repost Pages”, mais cela sera vraiment peu passionant pour cette personne.
La seconde option est d’adapter et d’utiliser le script PowerShell pour cela.
[string]$SitePagesURL ="
[string]$PageLibPublicName = "Site Pages"
[DateTime]$MyCSVPublishingDate = Get-Date
[DateTime]$PortalPublishingDate = Get-Date
[string]$MyCSVPublisher = ""
[string]$MyCSVTitle = ""
[string]$MyCSVNewsURL = ""
[string]$MyCSVNewsPictureURL = ""
[string]$MyCSVNewsDescription = ""
[string]$CSVFileName = "ExportGlobalNewsItems.csv"
[string]$NewsPageFileName = ""
[string]$queryText = "ContentTypeId:0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00DAB155038B062847A409F1E450E9E5E3* Path:https://yourTenant.sharepoint.com/yourintranet "
[string]$srcrpattern = '(?i)src="(.*?)"'
[string]$outputline = ""
[int]$TempUserID = 0
# ---------------------------------------------------------------------------------------------------------------
function Load-DLLandAssemblies
{
[string]$defaultDLLPath = ""
# Load assemblies to PowerShell session
$defaultDLLPath = "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll"
[System.Reflection.Assembly]::LoadFile($defaultDLLPath)
$defaultDLLPath = "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.Runtime.dll"
[System.Reflection.Assembly]::LoadFile($defaultDLLPath)
$defaultDLLPath = "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll"
[System.Reflection.Assembly]::LoadFile($defaultDLLPath)
$defaultDLLPath = "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Search\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Search.dll"
#$defaultDLLPath = "D:\TOOLS\SHAREPOINT\SP_ONLINE\sharepointclientcomponents\microsoft.sharepointonline.csom.16.1.8119.1200\lib\net40-full\Microsoft.SharePoint.Client.Search.dll"
[System.Reflection.Assembly]::LoadFile($defaultDLLPath)
}
# ---------------------------------------------------------------------------------------------------------------
Function Get-All-Intranet-News-Published-ExportCSV($MyctxTemp, $MyspoRootwebTemp)
{
# add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
$keywordQuery = New-Object Microsoft.SharePoint.Client.Search.Query.KeywordQuery($MyctxTemp)
$keywordQuery.QueryText = $queryText
$keywordQuery.RowLimit = 50
$keywordQuery.TrimDuplicates=$false
$keywordQuery.SelectProperties.Add("LastModifiedTime")
$keywordQuery.SelectProperties.Add("Modified")
$keywordQuery.SelectProperties.Add("ModifiedBy")
$keywordQuery.SelectProperties.Add("IntranetPublisher")
$keywordQuery.SelectProperties.Add("DescriptionResumeOWSTEXT")
$keywordQuery.SelectProperties.Add("PublishingImage")
$keywordQuery.SortList.Add("Modified","Desc")
$searchExecutor = New-Object Microsoft.SharePoint.Client.Search.Query.SearchExecutor($MyctxTemp)
$results = $searchExecutor.ExecuteQuery($keywordQuery)
$MyctxTemp.ExecuteQuery()
Write-Host $results.Value[0].ResultRows.Count
Clear-Content $CSVFileName
$outputline = '"NewsTitle";"PublisherEmail";"PublicationDate";"NewsURL";"NewsPictureURL";"NewsDescription";'
Add-Content -Encoding UTF8 -Force $CSVFileName $outputline
foreach($result in $results.Value[0].ResultRows)
{
$TempString = $result["Modified"].split(';')[0]
$ImageURLsrc = ([regex]$srcrpattern ).Matches($result["PublishingImage"]) | ForEach-Object { $_.Groups[1].Value }
$ImageURLsrc = $SitePagesURL + $ImageURLsrc.split('?')[0] +"?RenditionID=9"
$PortalPublishingDate=[datetime]::ParseExact([string]$TempString, 'M/d/yyyy h:mm:ss tt', [CultureInfo]::InvariantCulture)
$PublisherDetails = $result["IntranetPublisher"].split('|')
#Write-Host " ------>>> TempString:", $TempString
#Write-Host " ------>>> PublisherDetails:", $PublisherDetails.Count, "- LastField:", $PublisherDetails[4].Trim()
#Write-Host " ------>>> PublishingImage:", $result["PublishingImage"]
#Write-Host " ------>>> Modified:", $result["Modified"]
Write-Host " ---------------------------------------- "
Write-Host " ------>>> NewsPath:", $result["Path"]
Write-Host " ------>>> Title:", $result["Title"]
Write-Host " ------>>> PublicationDate:", $PortalPublishingDate
Write-Host " ------>>> IntranetPublisherEmail:", $PublisherDetails[4].Trim()
Write-Host " ------>>> ImageURLsrc:", $ImageURLsrc
Write-Host " ------>>> DescriptionResumeOWSTEXT:", $result["DescriptionResumeOWSTEXT"]
Write-Host " ---------------------------------------- "
#CSV file location, to store the result
$outputline = '"'+ $result["Title"] +'";"'+ $PublisherDetails[4].Trim() +'";"'+ $PortalPublishingDate.ToString("dd.MM.yyyy hh:mm:ss") +'";"'+ $result["Path"] +'";"'+ $ImageURLsrc +'";"'+ $result["DescriptionResumeOWSTEXT"] +'";'
Add-Content -Encoding UTF8 -Force $CSVFileName $outputline
}
}
# ---------------------------------------------------------------------------------------------------------------
Function Get-All-News-PageList-ComparedToCSV($MyctxTemp, $MyspoRootwebTemp)
{
$GlobalNewsPageCSV = Import-Csv -encoding UTF8 $CSVFileName -delimiter ";"
$GlobalNewsPageCSV | Format-Table
$Alllists = $MyspoRootwebTemp.Lists
$MyPagelist = $Alllists.GetByTitle($PageLibPublicName)
$MyPagelistItems = $MyPagelist.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery(9999))
$MyctxTemp.load($MyPagelistItems)
$MyctxTemp.executeQuery()
foreach($PageItem in $MyPagelistItems)
{
Write-Host ""
Write-Host ""
Write-Host " --------------------------------------------------------- "
foreach($MyFieldval in $PageItem.FieldValues)
{
Write-Host " >>> FieldName:", $MyFieldval
}
#>
$ModifiedByuser = $PageItem["Editor"]
$CreatedByuser = $PageItem["Author"]
Write-Host "ID:", $PageItem["ID"], "- Title:", $PageItem["Title"], "- Original Publication Date:", $PageItem["Modified"]
Write-Host " ==>>> PromotedState:", $PageItem["PromotedState"], "- PageLayoutType:", $PageItem["PageLayoutType"] -ForegroundColor red
Write-Host " ===> Modified by:", $ModifiedByuser.LookupValue, "[", $ModifiedByuser.LookupId, "] - Created by:", $CreatedByuser.LookupValue, "[", $CreatedByuser.LookupId, "]"
Write-Host " >> _OriginalSourceUrl:", $PageItem["_OriginalSourceUrl"] -ForegroundColor magenta
Write-Host " >> Description:", $PageItem["Description"]
Write-Host " >> BannerImageUrl:", $PageItem["BannerImageUrl"].URL, "- URLDesc:", $PageItem["BannerImageUrl"].Description #[BannerImageUrl, Microsoft.SharePoint.Client.FieldUrlValue]
Write-Host " >> ContentTypeId:", $PageItem["ContentTypeId"] # [ContentTypeId, 0x0101009D1CB255DA76424F860D91F20E6C4118002A50BFCFB7614729B56886FADA02339B00FB61AB42CC88E741A501DF164E1EDB74]
$searchTerm = $PageItem["_OriginalSourceUrl"]
$MyCSVPublishingDate = Get-Date
$GlobalNewsPageCSV |Where-Object {$_.NewsURL -match $searchTerm} |foreach-object{ $MyCSVTitle=$_.NewsTitle; $MyCSVNewsURL=$_.NewsURL; $MyCSVPublisher=$_.PublisherEmail; $MyCSVPublishingDate=[datetime]::ParseExact($_.PublicationDate,'dd.MM.yyyy hh:mm:ss',$null) }
if ($PageItem["_OriginalSourceUrl"] -eq $MyCSVNewsURL)
{
Write-Host " >>> CSV Title found:", $MyCSVTitle, "- CSV Publication Date:", $MyCSVPublishingDate, "- Publisher:", $MyCSVPublisher -ForegroundColor Yellow
Write-Host " >> CSV NewsURL:", $MyCSVNewsURL -ForegroundColor magenta
#Load Context for the target link page $PageItem["_OriginalSourceUrl"]
$TempUri = new-object Uri($MyCSVNewsURL)
[string]$TempserverRelativeURL = $TempUri.AbsolutePath
[string]$MyTempSubWebURL = $MyCSVNewsURL.substring(0, $MyCSVNewsURL.IndexOf('Pages'))
Write-Host " === >> MyTempSubWebURL:", $MyTempSubWebURL -ForegroundColor Yellow
Write-Host " === >> TempserverRelativeURL:", $TempserverRelativeURL -ForegroundColor Yellow
$MyDestinationPagectx = New-Object Microsoft.SharePoint.Client.ClientContext($MyTempSubWebURL)
$MyDestinationPagectx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.UserName,$cred.Password)
$MyDestinationPagectx.RequestTimeout = 1000000 # milliseconds
$MyDestinationPageweb = $MyDestinationPagectx.Web
$MyDestinationPageSiteColl = $MyDestinationPagectx.Site
$MyDestinationPagelist = $MyDestinationPageweb.Lists.GetByTitle("Pages")
$MyDestinationPageFile = $MyDestinationPageweb.GetFileByServerRelativeUrl($TempserverRelativeURL);
$MyDestinationPageFileitem = $MyDestinationPageFile.ListItemAllFields;
$MyDestinationPagectx.Load($MyDestinationPageweb)
$MyDestinationPagectx.Load($MyDestinationPageSiteColl)
$MyDestinationPagectx.Load($MyDestinationPagelist)
$MyDestinationPagectx.Load($MyDestinationPageFileitem)
$MyDestinationPagectx.ExecuteQuery()
Write-Host " === >> DestinationPage Site URL:", $MyDestinationPageSiteColl.Url, "- ID:", $MyDestinationPageSiteColl.ID -ForegroundColor white
Write-Host " === >> DestinationPage Web URL:", $MyDestinationPageweb.Url, "- ID:", $MyDestinationPageweb.ID -ForegroundColor white
Write-Host " === >> DestinationPage PageList Title:", $MyDestinationPagelist.Title, "- ID:", $MyDestinationPagelist.ID -ForegroundColor white
Write-Host " === >> DestinationPage PageFile Title:", $MyDestinationPageFileitem["Title"].ToString(), "- ID:", $MyDestinationPageFileitem["UniqueId"].ToString()
$MyEditoruserAccount = $MyspoRootwebTemp.EnsureUser("i:0#.f|membership|$($MyCSVPublisher)");
$MyctxTemp.load($MyEditoruserAccount)
$MyctxTemp.executeQuery()
Write-Host " ===> Modified Account Login:", $MyEditoruserAccount.LoginName -ForegroundColor Magenta
$PageItem["Created_x0020_By"] = $MyEditoruserAccount.LoginName
$PageItem["Modified_x0020_By"] = $MyEditoruserAccount.LoginName
$PageItem["PromotedState"] = "2"
$PageItem["PageLayoutType"] = "RepostPage"
$PageItem["ClientSideApplicationId"] = "b6917cb1-93a0-4b97-a84d-7cf49975d4ec"
$PageItem["_OriginalSourceSiteId"] = $MyDestinationPageSiteColl.ID
$PageItem["_OriginalSourceWebId"] = $MyDestinationPageweb.ID
$PageItem["_OriginalSourceListId"] = $MyDestinationPagelist.ID
$PageItem["_OriginalSourceItemId"] = $MyDestinationPageFileitem["UniqueId"].ToString()
$PageItem["Modified"] = $MyCSVPublishingDate;
$PageItem["Created"] = $MyCSVPublishingDate;
$PageItem["FirstPublishedDate"] = $MyCSVPublishingDate;
$PageItem["Editor"] = $MyEditoruserAccount.Id;
$PageItem["Author"] = $MyEditoruserAccount.Id
$PageItem.Update()
$MyctxTemp.ExecuteQuery()
}
else
{
Write-Host " >>> CSV Title not found:", $MyCSVTitle, "- Date:", $MyCSVPublishingDate, "- Publisher:", $MyCSVPublisher -ForegroundColor Red
Write-Host " >> CSV NewsURL:", $MyCSVNewsURL -ForegroundColor Red
}
Write-Host " --------------------------------------------------------- "
}
}
Function Get-All-CSVNews-ComparedToPageList($MyctxTemp, $MyspoRootwebTemp)
{
$GlobalNewsPageCSV = Import-Csv -encoding UTF8 $CSVFileName -delimiter ";"
$GlobalNewsPageCSV | Format-Table
foreach($CSVItem in $GlobalNewsPageCSV)
{
Write-Host " --------------------------------------------------------- "
Write-Host " >> CSV NewsTitle:", $CSVItem.NewsTitle
Write-Host " >> CSV NewsURL:", $CSVItem.NewsURL
Write-Host " >> CSV PublisherEmail:", $CSVItem.PublisherEmail
Write-Host " >> CSV PublicationDate:", $CSVItem.PublicationDate
Write-Host " >> CSV NewsPictureURL:", $CSVItem.NewsPictureURL
Write-Host " >> CSV NewsDescription:", $CSVItem.NewsDescription
$MyCSVTitle = $CSVItem.NewsTitle
$MyCSVNewsURL = $CSVItem.NewsURL
$MyCSVPublisher = $CSVItem.PublisherEmail
$MyCSVPublishingDate = [datetime]::ParseExact($CSVItem.PublicationDate,'dd.MM.yyyy hh:mm:ss',$null)
$MyCSVNewsPictureURL = $CSVItem.NewsPictureURL
$MyCSVNewsDescription = $CSVItem.NewsDescription
#Load Context for the target link page $PageItem["_OriginalSourceUrl"]
$TempUri = new-object Uri($MyCSVNewsURL)
[string]$TempserverRelativeURL = $TempUri.AbsolutePath
[string]$MyTempSubWebURL = $MyCSVNewsURL.substring(0, $MyCSVNewsURL.IndexOf('Pages'))
Write-Host " === >> MyTempSubWebURL:", $MyTempSubWebURL -ForegroundColor Yellow
Write-Host " === >> TempserverRelativeURL:", $TempserverRelativeURL -ForegroundColor Yellow
$MyDestinationPagectx = New-Object Microsoft.SharePoint.Client.ClientContext($MyTempSubWebURL)
$MyDestinationPagectx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.UserName,$cred.Password)
$MyDestinationPagectx.RequestTimeout = 1000000 # milliseconds
$MyDestinationPageweb = $MyDestinationPagectx.Web
$MyDestinationPageSiteColl = $MyDestinationPagectx.Site
$MyDestinationPagelist = $MyDestinationPageweb.Lists.GetByTitle("Pages")
$MyDestinationPageFile = $MyDestinationPageweb.GetFileByServerRelativeUrl($TempserverRelativeURL);
$MyDestinationPageFileitem = $MyDestinationPageFile.ListItemAllFields;
$MyDestinationPagectx.Load($MyDestinationPageweb)
$MyDestinationPagectx.Load($MyDestinationPageSiteColl)
$MyDestinationPagectx.Load($MyDestinationPagelist)
$MyDestinationPagectx.Load($MyDestinationPageFileitem)
$MyDestinationPagectx.ExecuteQuery()
Write-Host " === >> DestinationPage Site URL:", $MyDestinationPageSiteColl.Url, "- ID:", $MyDestinationPageSiteColl.ID -ForegroundColor white
Write-Host " === >> DestinationPage Web URL:", $MyDestinationPageweb.Url, "- ID:", $MyDestinationPageweb.ID -ForegroundColor white
Write-Host " === >> DestinationPage PageList Title:", $MyDestinationPagelist.Title, "- ID:", $MyDestinationPagelist.ID -ForegroundColor white
Write-Host " === >> DestinationPage PageFile Title:", $MyDestinationPageFileitem["Title"].ToString(), "- ID:", $MyDestinationPageFileitem["UniqueId"].ToString()
$MyEditoruserAccount = $MyspoRootwebTemp.EnsureUser("i:0#.f|membership|$($MyCSVPublisher)");
$MyctxTemp.load($MyEditoruserAccount)
$MyctxTemp.executeQuery()
$MyPagelist = $MyspoRootwebTemp.Lists.GetByTitle($PageLibPublicName)
$MyQuery = New-Object Microsoft.SharePoint.Client.CamlQuery;
$MyQuery.ViewXml = "$MyCSVNewsURL"
$MyPagelistItems = $MyPagelist.GetItems($MyQuery);
$MyctxTemp.Load($MyPagelistItems)
$MyctxTemp.ExecuteQuery()
if($MyPagelistItems.Count -lt 1)
{
[string]$NewsPageFileName = "/yourintranet/SitePages/"+ $MyCSVPublishingDate.ToString("yyyyMMdd") +'-'+ $CSVItem.NewsURL.Substring($CSVItem.NewsURL.LastIndexOf("/") + 1)
Write-Host " >> $($MyPagelistItems.Count) PageList Item Found, Need to be created [ $NewsPageFileName ]" -ForegroundColor Red # TO CREATE !!!
$NewPageitem = $MyPagelist.RootFolder.Files.AddTemplateFile($NewsPageFileName, [Microsoft.SharePoint.Client.TemplateFileType]::ClientSidePage).ListItemAllFields
# Make this page a "modern" page
$NewPageitem["ContentTypeId"] = "0x0101009D1CB255DA76424F860D91F20E6C4118002A50BFCFB7614729B56886FADA02339B00874A802FBA36B64BAB7A47514EAAB232";
$NewPageitem["PageLayoutType"] = "RepostPage"
$NewPageitem["PromotedState"] = "2"
$NewPageitem["Title"] = $CSVItem.NewsTitle
$NewPageitem["ClientSideApplicationId"] = "b6917cb1-93a0-4b97-a84d-7cf49975d4ec"
$NewPageitem["_OriginalSourceSiteId"] = $MyDestinationPageSiteColl.ID
$NewPageitem["_OriginalSourceWebId"] = $MyDestinationPageweb.ID
$NewPageitem["_OriginalSourceListId"] = $MyDestinationPagelist.ID
$NewPageitem["_OriginalSourceItemId"] = $MyDestinationPageFileitem["UniqueId"].ToString()
$NewPageitem["_OriginalSourceUrl"] = $MyCSVNewsURL
$NewPageitem["Editor"] = $MyEditoruserAccount.Id
$NewPageitem["Author"] = $MyEditoruserAccount.Id
$NewPageitem["Description"] = $MyCSVNewsDescription
$NewPageitem["BannerImageUrl"] = $MyCSVNewsPictureURL;
$NewPageitem["Modified"] = $MyCSVPublishingDate;
$NewPageitem["Created"] = $MyCSVPublishingDate;
$NewPageitem["Created_x0020_By"] = $MyEditoruserAccount.LoginName
$NewPageitem["Modified_x0020_By"] = $MyEditoruserAccount.LoginName
$NewPageitem["FirstPublishedDate"] = $MyCSVPublishingDate;
$NewPageitem.Update();
$MyctxTemp.Load($NewPageitem);
$MyctxTemp.ExecuteQuery();
}
elseif($MyPagelistItems.Count -eq 1)
{
Write-Host " >> $($MyPagelistItems.Count) Page Item Found, Case OK !!!" -ForegroundColor Yellow # TO CHECK AND UPDATE VIA SCRIPT !!!
#Loop through each item (only one if that is OK)
$MyPagelistItems | ForEach-Object {
#Get the Title field value
Write-Host " >> PageList NewsTitle:", $_["Title"] -ForegroundColor Yellow
Write-Host " >> PageList NewsUrl:", $_["_OriginalSourceUrl"] -ForegroundColor Yellow
if($MyCSVNewsPictureURL -ne $_["BannerImageUrl"].URL)
{
$_["BannerImageUrl"].URL = $MyCSVNewsPictureURL
$_["BannerImageUrl"].Description = $MyCSVNewsPictureURL
}
$_["PromotedState"] = "2"
$_["Modified"] = $MyCSVPublishingDate;
$_["Created"] = $MyCSVPublishingDate;
$_["FirstPublishedDate"] = $MyCSVPublishingDate;
$_["_OriginalSourceSiteId"] = $MyDestinationPageSiteColl.ID
$_["_OriginalSourceWebId"] = $MyDestinationPageweb.ID
$_["_OriginalSourceListId"] = $MyDestinationPagelist.ID
$_["_OriginalSourceItemId"] = $MyDestinationPageFileitem["UniqueId"].ToString()
$_["Editor"] = $MyEditoruserAccount.Id;
$_["Author"] = $MyEditoruserAccount.Id
$_["Created_x0020_By"] = $MyEditoruserAccount.LoginName
$_["Modified_x0020_By"] = $MyEditoruserAccount.LoginName
$_.Update()
$MyctxTemp.ExecuteQuery()
}
}
else
{
Write-Host " >> $($MyPagelistItems.Count) PageList Item Found, Need to be fixed !!!" -ForegroundColor Red # TO CHECK AND CONTROL MANUALLY !!!
$MyPagelistItems | ForEach-Object {
#Get the Title field value
Write-Host " >> PageList NewsTitle:", $_["Title"] -ForegroundColor Yellow
Write-Host " >> PageList NewsUrl:", $_["_OriginalSourceUrl"] -ForegroundColor Yellow
}
}
}
}
# ---------------------------------------------------------------------------------------------------------------
Load-DLLandAssemblies
#get and save your O365 credentials
[string]$username = "AdminAccount@Yourtenant.onmicrosoft.com"
[string]$PwdTXTPath = "C:\SECUREDPWD\ExportedPWD-$($username).txt"
$secureStringPwd = ConvertTo-SecureString -string (Get-Content $PwdTXTPath)
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $secureStringPwd
#connect to the web site using the stored credentials
Write-host " "
Write-host " -------------------------------------------------------------------------------------------- " -ForegroundColor green
Write-host " ---- CONNECT THE SITE --- " -ForegroundColor green
Write-host " CONNECTED SITE:", $SitePagesURL -ForegroundColor Yellow
$Myctx = New-Object Microsoft.SharePoint.Client.ClientContext($SitePagesURL +"/yourintranet")
$Myctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.UserName,$cred.Password)
$Myctx.RequestTimeout = 1000000 # milliseconds
$MyspoRootweb = $Myctx.Web
$Myctx.Load($MyspoRootweb)
$Myctx.ExecuteQuery()
Write-Host " "
Write-Host " ---------------------------------------------------------"
Write-Host " >>>> # Server Version:" $Myctx.ServerVersion " # <<<<<<" -ForegroundColor Green
Write-Host " ---------------------------------------------------------"
Write-Host " "
Write-host " -------------------------------------------------------- "
Write-host " -->> RootSite:", $MyspoRootweb.URL -ForegroundColor green
Write-host " "
Get-All-Intranet-News-Published-ExportCSV $Myctx $MyspoRootweb
Get-All-CSVNews-ComparedToPageList $Myctx $MyspoRootweb
Get-All-News-PageList-ComparedToCSV $Myctx $MyspoRootweb
Vous pouvez facilement reprendre ce script et l’adapter à vos propres besoins, mais celui-ci a été validé en chargeant les 500 dernières News globales publiées sur notre Intranet Corporate sans aucun soucis.