Hi GithendraPerera-1991,
I believe you are trying to change home page banner image programmatically. You can use PnP Powershell to do that. Follow below steps:
- Connect your site using
Connect-PnPOnline -Url $siteUrl -Credential $credential - Get Client Side Page
$myHomePage = Get-PnPClientSidePage -Identity Home.aspx - Set custom page header:
$myHomePage.SetCustomPageHeader('<Server relative Image URL>') - Save the page:
$myHomePage.Save() - Publish:
$myHome.Publish()
----------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--