Skip to main content

Posts

Showing posts from 2020

Powershell Script to get all SharePoint wsp solutions

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $dirName = "C:\WSP" if (!(Test-Path -path $dirName)) { New-Item $dirName -type directory } Write-Host Exporting solutions to $dirName foreach ($solution in Get-SPSolution) {     $id = $Solution.SolutionID     $title = $Solution.Name     $filename = $Solution.SolutionFile.Name     Write-Host "Exporting ‘$title’ to …\$filename" -nonewline     try {         $solution.SolutionFile.SaveAs("$dirName\$filename")         Write-Host " – done" -foreground green     }     catch     {         Write-Host " – error : $_" -foreground red     } } Note: If need any help please reach out to me at kamal_pandey@outlook.com.  I would be very happy to help. 

Powershell Script to Restrict Group Creation on Office 365

$GroupName = "<SecurityGroupName>" $AllowGroupCreation = "False" Connect-AzureAD $settingsObjectID = (Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ).id if(!$settingsObjectID) { $template = Get-AzureADDirectorySettingTemplate | Where-object {$_.displayname -eq "group.unified"}     $settingsCopy = $template.CreateDirectorySetting()     New-AzureADDirectorySetting -DirectorySetting $settingsCopy     $settingsObjectID = (Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ).id } $settingsCopy = Get-AzureADDirectorySetting -Id $settingsObjectID $settingsCopy["EnableGroupCreation"] = $AllowGroupCreation if($GroupName) { $settingsCopy["GroupCreationAllowedGroupId"] = (Get-AzureADGroup -SearchString $GroupName).objectid }  else { $settingsCopy["GroupCreationAllowedGroupId"] = $GroupName } Set-AzureADDirectorySetting -Id $

Solve Missing user profile picture in SharePoint 2019

Dear All,  Below is the Powershell script that will help you solve broken profile picture issue. $mySiteNewHostURL = "http://NewMySiteHostURL" $mySiteOldHostURL = "http://OldMySiteHostURL" $mySite = Get-SPSite $mySiteNewHostUrl $SPServiceContext = Get-SPServiceContext $mySite $userProfileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($SPServiceContext) $userProfiles = $userProfileManager.GetEnumerator() foreach ($userProfile in $userProfiles) { #check if the picture property contain image URL, then replace it with new my site host URL if ($userProfile["PictureURL"] -ne '') { $oldImageUrl = $userProfile["PictureURL"].toString() $newImageUrl = $oldImageUrl -Replace $mySiteOldHostURL, $mySiteNewHostURL write-host "Old Image Link = " $oldImageUrl " --> New Image Link = " $newImageUrl $userProfile["PictureURL"].Value = $newImageUrl $userP

Apply Branding on SharePoint 2019 without updating master page

Hello Everyone, I am pleased to inform you that, using blog code you will be able to apply branding on your SharePoint 2019 SharePoint Site without updating master page and layout page. Using this code you don’t have update or modify anything on you site just upload this code file to Style library and set css link to your site, supper easy.  Download this copy CSS and create css file. Upload css file to your SharePoint style library Go to Site setting > Look and Feel > Master page >click on Alternate CSS URL> select “Specify a CSS file to be used by this site and all sites that inherit from it:” > click on Browse > select your css file > Click OK You are done.  Enjoy  SharePointing  ********************************CODE******************************************** /* Left navigation(begin) */ .ms-core-listMenu-verticalBox UL.root > LI > .menu-item{     background-color:#f3f3f3;     color:#000;         min-height: