Tuesday, December 25, 2012

FBA Cookie getting expired only in Safari and Chrome.

Hi Reader,

This blog is for all those guys who have tried their level best to solve this unique issue and still couldnt get the root cause why the Form Based Authentication Cookie getting expired daily ( almost after some hours ) ONLY on Safari and Chrome browser.

I have spend lot many days finding the root cause of this issue and yes also solve it for clients.
Applicaiton that use hosted Safari inside of UIWebView ( which is also Chrome) or Apps that host a website in PhoneGap usually face this issue. If its FBA then Google Chrome for iOS might switch FormsAuth to Cookieless mode.

This has been fixed in .NET 4.5 and you wont see this issue if you have .NET 4.5 installed, even uf you're running .NET 4 application. Since now you are facing this trouble then here are following steps to follow and immediately get rid of this issue.

Thanks to blogger: Scott

STEP 1:  Modify your web.config file.

<authentication mode="Forms" >
  <forms loginUrl="~/Account/SignIn" timeout="2880" cookieless="UseCookies" />
</authentication>


STEP 2:  Once you explore your Sharepoint hosted site in IIS you will notice the app_browser folder.
Create a "generic.browser" named file in that folder and paste the exact code in it.


<browsers>
  <browser refID="GenericDownlevel"> 
    <capabilities> 
      <capability name="cookies" value="true" /> 
    </capabilities>
  </browser>
</browsers>



STEP 3: Generate a New MachineKey.

“Machine key a unique key that differentiates one computer from others. And this key is used to create unique identifier when cookie is created in the client machine from a server side code. This key is generally present in the machine.config file when you install .NET framework that is generally not visible to the user as it remains in the .NET Framework installation directory. When you specify the same key in your web.config, the value of machine key specified in the machine.config is overridden by the one you have specified in the web.config file. “
Once the key is generated, they are converted into a string of hexadecimal characters.
Created a 256-bit decryption key and a 512-bit validation key, with Rijndael as the data validation algorithm.
You need to include this newly created machine key in your web.config file.




Hope my above solution will surely save lot of efforts and time.






Thursday, December 20, 2012

SharePoint Fields Internal Names List


Much used reprinting of list of fields with internal names for easy reference:
Document Library fields
Display NameInternal NameGUIDType
IDID{1d22ea11-1e32-424e-89ab-9fedbadb6ce1}Counter
Content Type IDContentTypeId{03e45e84-1992-4d42-9116-26f756012634}ContentTypeId
Content TypeContentType{c042a256-787d-4a6f-8a8a-cf6ab767f12d}Text
CreatedCreated{8c06beca-0777-48f7-91c7-6da68bc07b69}DateTime
Created ByAuthor{1df5e554-ec7e-46a6-901d-d85a3881cb18}User
ModifiedModified{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}DateTime
Modified ByEditor{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}User
Has Copy Destinations_HasCopyDestinations{26d0756c-986a-48a7-af35-bf18ab85ff4a}Boolean
Copy Source_CopySource{6b4e226d-3d88-4a36-808d-a129bf52bccf}Text
Approval Status_ModerationStatus{fdc3b2ed-5bf2-4835-a4bc-b885f3396a61}ModStat
Approver Comments_ModerationComments{34ad21eb-75bd-4544-8c73-0e08330291fe}Note
URL PathFileRef{94f89715-e097-4e8b-ba79-ea02aa8b7adb}Lookup
PathFileDirRef{56605df6-8fa1-47e4-a04c-5b384d59609f}Lookup
ModifiedLast_x0020_Modified{173f76c8-aebd-446a-9bc9-769a2bd2c18f}Lookup
CreatedCreated_x0020_Date{998b5cff-4a35-47a7-92f3-3914aa6aa4a2}Lookup
File SizeFile_x0020_Size{8fca95c0-9b7d-456f-8dae-b41ee2728b85}Lookup
Item TypeFSObjType{30bb605f-5bae-48fe-b4e3-1f81d9772af9}Lookup
Effective Permissions MaskPermMask{ba3c27ee-4791-4867-8821-ff99000bac98}Computed
ID of the User who has the item Checked OutCheckedOutUserId{a7b731a3-1df1-4d74-a5c6-e2efba617ae2}Lookup
Is Checked out to localIsCheckedoutToLocal{cfaabd0f-bdbd-4bc2-b375-1e779e2cad08}Lookup
Checked Out ToCheckoutUser{3881510a-4e4a-4ee8-b102-8ee8e2d0dd4b}User
NameFileLeafRef{8553196d-ec8d-4564-9861-3dbe931050c8}File
Unique IdUniqueId{4b7403de-8d94-43e8-9f0f-137a3e298126}Lookup
ProgIdProgId{c5c4b81c-f1d9-4b43-a6a2-090df32ebb68}Lookup
ScopeIdScopeId{dddd2420-b270-4735-93b5-92b713d0944d}Lookup
Virus StatusVirusStatus{4a389cb9-54dd-4287-a71a-90ff362028bc}Lookup
Checked Out ToCheckedOutTitle{9d4adc35-7cc8-498c-8424-ee5fd541e43a}Lookup
Check In Comment_CheckinComment{58014f77-5463-437b-ab67-eec79532da67}Lookup
Checked Out ToLinkCheckedOutTitle{e2a15dfd-6ab8-4aec-91ab-02f6b64045b0}Computed
Document Modified ByModified_x0020_By{822c78e3-1ea9-4943-b449-57863ad33ca9}Text
Document Created ByCreated_x0020_By{4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb}Text
File TypeFile_x0020_Type{39360f11-34cf-4356-9945-25c44e68dade}Text
HTML File TypeHTML_x0020_File_x0020_Type{0c5e0085-eb30-494b-9cdd-ece1d3c649a2}Text
Source Url_SourceUrl{c63a459d-54ba-4ab7-933a-dcf1c6fadec2}Text
Shared File Index_SharedFileIndex{034998e9-bf1c-4288-bbbd-00eacfc64410}Text
Edit Menu Table Start_EditMenuTableStart{3c6303be-e21f-4366-80d7-d6d0a3b22c7a}Computed
Edit Menu Table End_EditMenuTableEnd{2ea78cef-1bf9-4019-960a-02c41636cb47}Computed
NameLinkFilenameNoMenu{9d30f126-ba48-446b-b8f9-83745f322ebe}Computed
NameLinkFilename{5cc6dc79-3710-4374-b433-61cb4a686c12}Computed
TypeDocIcon{081c6e4c-5c14-4f20-b23e-1a71ceb6a67c}Computed
Server Relative URLServerUrl{105f76ce-724a-4bba-aece-f81f2fce58f5}Computed
Encoded Absolute URLEncodedAbsUrl{7177cfc7-f399-4d4d-905d-37dd51bc90bf}Computed
NameBaseName{7615464b-559e-4302-b8e2-8f440b913101}Computed
File SizeFileSizeDisplay{78a07ba4-bda8-4357-9e0f-580d64487583}Computed
Property BagMetaInfo{687c7f94-686a-42d3-9b67-2782eac4b4f8}Lookup
Level_Level{43bdd51b-3c5b-4e78-90a8-fb2087f71e70}Integer
Is Current Version_IsCurrentVersion{c101c3e7-122d-4d4d-bc34-58e94a38c816}Boolean
SelectSelectTitle{b1f7969b-ea65-42e1-8b54-b588292635f2}Computed
SelectSelectFilename{5f47e085-2150-41dc-b661-442f3027f552}Computed
EditEdit{503f1caa-358e-4918-9094-4a2cdc4bc034}Computed
owshiddenversionowshiddenversion{d4e44a66-ee3a-4d02-88c9-4ec5ff3f4cd5}Integer
UI Version_UIVersion{7841bf41-43d0-4434-9f50-a673baef7631}Integer
Version_UIVersionString{dce8262a-3ae9-45aa-aab4-83bd75fb738a}Text
Instance IDInstanceID{50a54da4-1528-4e67-954a-e2d24f1e9efb}Integer
OrderOrder{ca4addac-796f-4b23-b093-d2a3f65c0774}Number
GUIDGUID{ae069f25-3ac2-4256-b9c3-15dbc15da0e0}Guid
Workflow VersionWorkflowVersion{f1e020bc-ba26-443f-bf2f-b68715017bbc}Integer
Workflow Instance IDWorkflowInstanceID{de8beacf-5505-47cd-80a6-aa44e7ffe2f4}Guid
Source Version (Converted Document)ParentVersionString{bc1a8efb-0f4c-49f8-a38f-7fe22af3d3e0}Lookup
Source Name (Converted Document)ParentLeafName{774eab3a-855f-4a34-99da-69dc21043bec}Lookup
TitleTitle{fa564e0f-0c70-4ab9-b863-0177e6ddd247}Text
Template LinkTemplateUrl{4b1bf6c6-4f39-45ac-acd5-16fe7a214e5e}Text
Html File Linkxd_ProgID{cd1ecb9f-dd4e-4f29-ab9e-e9ff40048d64}Text
Is Signedxd_Signature{fbf29b2d-cae5-49aa-8e0a-29955b540122}Boolean
MergeCombine{e52012a0-51eb-4c0c-8dfb-9b8a0ebedcb6}Computed
RelinkRepairDocument{5d36727b-bcb2-47d2-a231-1f0bc63b7439}Computed

 Custom list fields 
Display NameInternal NameGUIDType
IDID{1d22ea11-1e32-424e-89ab-9fedbadb6ce1}Counter
Content Type IDContentTypeId{03e45e84-1992-4d42-9116-26f756012634}ContentTypeId
Content TypeContentType{c042a256-787d-4a6f-8a8a-cf6ab767f12d}Text
TitleTitle{fa564e0f-0c70-4ab9-b863-0177e6ddd247}Text
ModifiedModified{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}DateTime
CreatedCreated{8c06beca-0777-48f7-91c7-6da68bc07b69}DateTime
Created ByAuthor{1df5e554-ec7e-46a6-901d-d85a3881cb18}User
Modified ByEditor{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}User
Has Copy Destinations_HasCopyDestinations{26d0756c-986a-48a7-af35-bf18ab85ff4a}Boolean
Copy Source_CopySource{6b4e226d-3d88-4a36-808d-a129bf52bccf}Text
owshiddenversionowshiddenversion{d4e44a66-ee3a-4d02-88c9-4ec5ff3f4cd5}Integer
Workflow VersionWorkflowVersion{f1e020bc-ba26-443f-bf2f-b68715017bbc}Integer
UI Version_UIVersion{7841bf41-43d0-4434-9f50-a673baef7631}Integer
Version_UIVersionString{dce8262a-3ae9-45aa-aab4-83bd75fb738a}Text
AttachmentsAttachments{67df98f4-9dec-48ff-a553-29bece9c5bf4}Attachments
Approval Status_ModerationStatus{fdc3b2ed-5bf2-4835-a4bc-b885f3396a61}ModStat
Approver Comments_ModerationComments{34ad21eb-75bd-4544-8c73-0e08330291fe}Note
EditEdit{503f1caa-358e-4918-9094-4a2cdc4bc034}Computed
TitleLinkTitleNoMenu{bc91a437-52e7-49e1-8c4e-4698904b2b6d}Computed
LinkFilenameNoMenu
TitleLinkTitle{82642ec8-ef9b-478f-acf9-31f7d45fbc31}Computed
SelectSelectTitle{b1f7969b-ea65-42e1-8b54-b588292635f2}Computed
Instance IDInstanceID{50a54da4-1528-4e67-954a-e2d24f1e9efb}Integer
OrderOrder{ca4addac-796f-4b23-b093-d2a3f65c0774}Number
GUIDGUID{ae069f25-3ac2-4256-b9c3-15dbc15da0e0}Guid
Workflow Instance IDWorkflowInstanceID{de8beacf-5505-47cd-80a6-aa44e7ffe2f4}Guid
URL PathFileRef{94f89715-e097-4e8b-ba79-ea02aa8b7adb}Lookup
PathFileDirRef{56605df6-8fa1-47e4-a04c-5b384d59609f}Lookup
ModifiedLast_x0020_Modified{173f76c8-aebd-446a-9bc9-769a2bd2c18f}Lookup
CreatedCreated_x0020_Date{998b5cff-4a35-47a7-92f3-3914aa6aa4a2}Lookup
Item TypeFSObjType{30bb605f-5bae-48fe-b4e3-1f81d9772af9}Lookup
Effective Permissions MaskPermMask{ba3c27ee-4791-4867-8821-ff99000bac98}Computed
NameFileLeafRef{8553196d-ec8d-4564-9861-3dbe931050c8}File
Unique IdUniqueId{4b7403de-8d94-43e8-9f0f-137a3e298126}Lookup
ProgIdProgId{c5c4b81c-f1d9-4b43-a6a2-090df32ebb68}Lookup
ScopeIdScopeId{dddd2420-b270-4735-93b5-92b713d0944d}Lookup
File TypeFile_x0020_Type{39360f11-34cf-4356-9945-25c44e68dade}Text
HTML File TypeHTML_x0020_File_x0020_Type{4ef1b78f-fdba-48dc-b8ab-3fa06a0c9804}Computed
Edit Menu Table Start_EditMenuTableStart{3c6303be-e21f-4366-80d7-d6d0a3b22c7a}Computed
Edit Menu Table End_EditMenuTableEnd{2ea78cef-1bf9-4019-960a-02c41636cb47}Computed
NameLinkFilenameNoMenu{9d30f126-ba48-446b-b8f9-83745f322ebe}Computed
NameLinkFilename{5cc6dc79-3710-4374-b433-61cb4a686c12}Computed
TypeDocIcon{081c6e4c-5c14-4f20-b23e-1a71ceb6a67c}Computed
Server Relative URLServerUrl{105f76ce-724a-4bba-aece-f81f2fce58f5}Computed
Encoded Absolute URLEncodedAbsUrl{7177cfc7-f399-4d4d-905d-37dd51bc90bf}Computed
File NameBaseName{7615464b-559e-4302-b8e2-8f440b913101}Computed
Property BagMetaInfo{687c7f94-686a-42d3-9b67-2782eac4b4f8}Lookup
Level_Level{43bdd51b-3c5b-4e78-90a8-fb2087f71e70}Integer
Is Current Version_IsCurrentVersion{c101c3e7-122d-4d4d-bc34-58e94a38c816}Boolean

Wednesday, November 28, 2012

How to extract metadata or details of a DLL IN GAC using Powershell

Hi,
 Recently I came across an issue to fetch the details of the DLL in GAC Folder.
Detail are like, Name , Version Number and TimeStamp using powershell.

I searched a lot in google and blogs and also in MSDN but didnt found any fruitful result.
Finally after too much to working on this  I finally came up with a simple solution.

Here is the script:



set-variable -option constant -name out -value "dllInventory.csv"
"Name, Version, Time" | Out-File $out -Append



Foreach( $file in Get-ChildItem C:\windows\assembly  -Recurse -filter "*.dll" )
{
if ($file -match "(.*dll)$")
{

 #$temp =  $file.Name, $file.VersionInfo.FileVersion, $file.lastwritetime
     $file.Name + ", " + $file.VersionInfo.FileVersion + ", " + $file.lastwritetime | Out-File $out -append
}
else
{write-host "Not Found"}
}
}
Hope this is help !!

Friday, November 23, 2012

Iterate in Resource File and fetch value of the matching String

Hi Reader,

Recently I came across a requirement where I need to iterate in a resource file added in my ASP.NET Project and fetch the matching value of a specific string.
Exact requirement goes like this, I have to return a Token Key ( Value ) of a Domain Name ( String Name) in a resx file. If the URL contains the Domain Name which is added in resx file then respective Token Key is fetched.
So we need to loop in the resx file, look for the containing string and if it matches then returns the value.
Code goes like this :


ResourceManager resourceManager = new ResourceManager("Resources.SiteUrl", System.Reflection.Assembly.Load("App_GlobalResources"));
                        
                        ResourceSet resourceSet = resourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
                        foreach (DictionaryEntry entry in resourceSet)
                        {
                            object resourceKey = entry.Key;
                            object resource = entry.Value;
                            if (returnUrl.Contains(resourceKey.ToString()))
                            {
                                DomainName = resourceKey.ToString();
                                Token = resource.ToString();
                            }
                        }
                        if (DomainName != null)
                        {
                            if (returnUrl.Contains(DomainName))
                            {
                                returnUrl = string.Format("{0}/_layouts/Authenticate.aspx?{1}={2}", returnUrl, Token, authCookie);
                            }
                        }


In Above code , ResourceManager Object is created to that looks up resources contained in files with the specified root name in the given assembly. 
ResourceSet Stores all the resources localized for one particular culture, ignoring all other cultures, including any fallback rules.

DictonaryEntry will get the key value pair of each item in the resource file.

Hope this helps !!



Saturday, November 10, 2012

How to Remove Site Template from Custom Tab

Hi All,

I have created test site template with name MyTestTemplate and MyTestTemplate2. Since this site is used by many developers and designers.
Later I found that in the Solution Galllary does not have any such solution with name MyTestTemplate and MyTestTemplate2 but it was still showing in Custom TAB of Site Template.





After those templates were deleted in the Solutions Gallery, they were still listed in the Custom group of new site templates, and could still be used - maybe because they were still available in the Recycle Bin.
To hide them from the Create Site options, I restored them from the Recycle Bin, then chose Deactivate from each item's drop-down menu, and then deleted them again. That solved the problem.

Friday, November 9, 2012

HOW TO ADD A CALENDAR LIST VIEW WEB PART TO ONET.XML

Hi All,

My requirement was to add a calendar in a provisioned page so I found there is a way to set web part properties inside a CDATA section of the view. The Views are generated from the Microsoft.SharePoint.WebPartPages.ListViewWebPart.

I hope this code will help your requirements as well.


<View List="Lists/PluginCalendar" BaseViewID="2" Type="CALENDAR"
       Scope="Recursive" RecurrenceRowset="TRUE" WebPartZoneID="TopWebZone"
       WebPartOrder="0">
       <![CDATA[
         <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
             <Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral,
                       PublicKeyToken=71e9bce111e9429c</Assembly>
             <TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart
                       </TypeName>
             <Title>Calendar of Events</Title>
             <FrameType>None</FrameType>
         </WebPart>
       ]]>
 </View>

Cannot recognize the XML namespace of this Web Part

Hi All,


When provisioning pages (e.g. default.aspx) using a feature, you can add default webparts using <AllUsersWebPart>
Keep in mind you have two types of webparts, v2 en v3. When provisioning v2: you should use the following syntax:
<AllUsersWebPart WebPartZoneID="FooterLeft" WebPartOrder="2">                
<![CDATA[                             
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">                  
...
</WebPart>                
]]>            
</AllUsersWebPart>
and with v3:
<AllUsersWebPart WebPartZoneID="FooterLeft" WebPartOrder="5">                
<![CDATA[                    
<webParts>                      
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">   ... 
</webPart>                    
</webParts>                
]]>            
</AllUsersWebPart>
Look at the difference in attributes of WebPart-tag AND the extra <webParts> tag in the v3-version. If you add <webParts> around the <webPart>-declaration in the v2-version, you could receive the error: Cannot recognize the XML namespace of this Web Part.

Tuesday, October 23, 2012

How to Detach SQL Database if DB is in Single User Mode


Hi Readers,

I came across a scenario where I need to detach the SQL Database and then take backup of .ldf and .mdf files.
Copy is not possible unless we do not detach the DB. This single user mode is set by SQL Server inorder to prevent corruption of database tables.

You can set the database back to online mode or say multi user mode by executing following commands.

exec sp_dboption 'your db name', 'single user', 'FALSE'

If error still persists, then you need to check which your is having connection with the database and find the particular spid

Inorder to find the connected users execute following command.

select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame from sysprocesses p inner join sysdatabases d on p.dbid = d.dbid  where d.name = 'your db name'

This will fetch the users with their $spid. Kill the spids you see using following command.

Kill <spid>  : Here <spid> will be some numeric id like 125, so write Kill 125

again run the 1st command and you will be back to Multi User Mode.

Wednesday, October 17, 2012

10 common difficulties when upgrading/migrating to SharePoint 2010 : Part 1


Hi Readers,
This is the first time I dealt with SP Migration from MOSS 2007 to SharePoint 2010 and have faced lot of issues while working. As per my experience and knowledge, I suggest 10 important points to remember and the difficulties you face while dealing with SP Migration.
1.To Upgrade, or to Migrate ??
2. Migrating Data
3. Migrating from Older Versions of SharePoint
4. Dealing with an Oversized Content Database
5. Wrong Site Template or Site Definition
6. Dealing with Unwanted Data
7. Migrating Content Types
8. Populating Metadata
9. Migrating Files from Outside SharePoint
10. Migrating Data from Exchange Public Folders.

Set the Custom 404 Error Page


Hi,
Have you ever tried setting up the Custom Error Page in SharePoint 2010. For long time I was aware of only below such ways of setting up the Custom Error Page.
1.) Modify the web.cofig file and set the <customErrors> = "ON".
2.) Either you can set it from IIS.
3.) Programmatically set the custom 404 page.
But a another way is a much smarter way i.e. To configure SharePoint Foundation server or SharePoint Server 2010 to point to a custom 404 error Web page via File System.
  1. Log on to the computer that is running SharePoint Server 2010 by using an account that has administrative permissions.
  2. In Windows Explorer, locate the following folder:
    c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID
  3. Create the custom HTML file:
    1. On the computer that is running SharePoint Server 2010, copy the Sps404.html file to a temporary folder.
    2. Rename the Sps404.html file. For example, give the file the following name:
      Custom404.html
    3. Modify the Custom404.html file to suit your needs for a custom 404 error message using an HTML editor.
    Note : In sps404.html you will notice STSNavigate("/_layouts/spsredirect.aspx?oldUrl=" + requestedUrl). You need to modify the line as per you requirement , either create another .aspx page and save it in _layouts folder or can directly point to any .aspx file located on the sharepoint library. i.e. STSNavigate("http://www.mytestsite.com/about/pages/404notfound.aspx");
    4. Copy the Custom404.html file to the %systemdrive% \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\LangID folder.
    Run the following PowerShell commands from the SharePoint 2010 Management Shell:
    $webapp =Get-SPWebApplication http://<serverUrl>:<port>
    $webapp.FileNotFoundPage = "Custom404.html"
    $webapp.update()

How to get Public key token in Visual Studio 2010


I was developing a custom application for SharePoint and needed to assign it with strong name I assigned a strong name to my project. Now was the time to see the token generated for it. I went ahead and tried to drag that assembly to GAC but I got access denied.

Development machine is Windows Server 2008. Now I tried installing it using GACUTIL but I got the same result even being the administrator of the machine.

Challenge comes in when you want to know the public key token that has been generated for the project so that you can make modification in web.config file.

So here is a solution. We will create an external command that will get us the public key token of the project. So that when that command is clicked we get to see result in command window.

Follow these simple steps. Make sure about spacing and parameters shown here.

Go to Tools menu and then external tools.
Click Add button on which the dialog opens.

Set textbox values like this

Command text box value is

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\sn.exe

Click on OK.

Now when you again click on Tools menu, you get to see our command.

Click on it and we will get the result in output window and from there you get to know the public key token.

I hope this will help while you are developing any custom component in SharePoint.

Slideshow views in Picture Libraries are not allowing end users to delete images


Hello Readers,
Recently I came across an issue in my project where the end users are not able to delete pictures in Picture Library of a SharePoint site which is migrated from 2007 to 2010.
The problem is with the view for the library, not the library itself as the pictures are there and can be opened if I open the library in Windows Explorer.  If I create a new view for the library, the new view works correctly.  If I try to modify the view for the library and then return to the library, I can no longer navigate to subfolders the display only shows the root folder of the picture library.
Here are the steps of what we need to do.
  1. Clone the view "All Pictures" to a view called "Temp" and assigned Temp to be the default view.
  2. Delete the "All Pictures" view
  3. Clone the view "Temp" to "AllItems" assigning AllItems to be the default view.
  4. Delete the view "Temp"
  5. Set  the title fo the AllItems view to be "All Pictures"
Aside from the view GUID everything appears to be identical, but with the links functioning properly.
Here is the below script :
filter Get-Web {
$_.AllWebs
}
Filter get-List {
$_.Lists
}
$viewtitle = 'Slide show view'
$viewinternaltitle = 'Slidshow'
$listtitle
$lists = get-SpSite | Get-Web | Get-List | where-object{$_.basetemplate -eq 'PictureLibrary'} | where-object {$_.title -eq 'BannerImages'}
foreach ($list in $lists){
foreach($view in $list.views){
if($view.title -eq $viewtitle){
$view.clone('Temp',$view.RowLimit,$view.Paged,$view.DefaultView)
$viewid1 = $view.id
}
$list.views.Delete($viewid1)
$list.update()
}
}
foreach ($list in $lists){
foreach($view in $list.Views ){
if($view.title -eq 'Temp'){
$view.clone($viewinternaltitle, $view.rowlimit,$view.paged,$view.defaultview)
$viewid2= $view.id
}
}
$list.views.Delete($viewid2)
$list.update()
}
foreach ($list in $lists){
foreach($view in $list.views) {
if($view.title -eq $viewinternaltitle){
$view.title = $viewtitle
$view.update()
$view.title
break
}
}
}