FormsAuthentication.RedirectFromLoginPage(txtUserName.Text.Trim(), false);
string strUserUrl = "";
SPSecurity.RunWithElevatedPrivileges(delegate
{
SPSite oSite = SPContext.Current.Site;
SPWebCollection collWebs = oSite.OpenWeb().GetSubwebsForCurrentUser();
foreach (SPWeb oWebsite in collWebs)
{
SPUserCollection collUsers = oWebsite.AllUsers;
foreach (SPUser oUser in collUsers)
{
if (oUser.LoginName.ToUpper() == txtUserName.Text.Trim().ToUpper())
{
strUserUrl = oWebsite.ServerRelativeUrl.ToString();
}
}
oWebsite.Dispose();
}
});
Response.Redirect("http://portal/"+strUserUrl,true);
March 03, 2010
March 02, 2010
Backup - Restore - STSADM - SharePoint Site
Backups are useful when moving from one Environment to another.
It will bring all the Data,Users,Permissions etc.
1. Run-->Cmd --> cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
2. stsadm -o backup -filename TestNameWithDate.dat -url http://WorkingURL
3. stsadm -o restore -filename TestNameWithDate.dat -url http://TargetURL -overwrite
4. Usually all Safe Controls will come in Web.Config but if something is breaking, check the Web.Config for safe controls.
5. If Content Types are not visible, Refresh/Restart the Application Pool and Site
Different Ways:
1. From Server : stsadm -o backup -filename TestNameWithDate.dat -url http://SiteURL
2. From SharePoint Designer 2007 (Recommended)
Steps:
1. Open the site in SharePoint Designer
2. Go to the site which you want to take BackUp
3. Site Administartion BackUp Website ok Save to your desktop location or anywhere
4. It will generate a .CMP file and that’s our backup which we can restore in the same way.
3. From the Site itself.
Steps:
1. Go to any site.
2. Make sure you are inside the site.
3. Now, Go to SiteActions SiteSettings Modify All Site Settings
4. Once you are here, In the browser URL, instead of settings.aspx access savetmpl.aspx
5. This will give you to save site as a Template(.stp file saved in site galleries of the root level site)
It will bring all the Data,Users,Permissions etc.
1. Run-->Cmd --> cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
2. stsadm -o backup -filename TestNameWithDate.dat -url http://WorkingURL
3. stsadm -o restore -filename TestNameWithDate.dat -url http://TargetURL -overwrite
4. Usually all Safe Controls will come in Web.Config but if something is breaking, check the Web.Config for safe controls.
5. If Content Types are not visible, Refresh/Restart the Application Pool and Site
Different Ways:
1. From Server : stsadm -o backup -filename TestNameWithDate.dat -url http://SiteURL
2. From SharePoint Designer 2007 (Recommended)
Steps:
1. Open the site in SharePoint Designer
2. Go to the site which you want to take BackUp
3. Site Administartion BackUp Website ok Save to your desktop location or anywhere
4. It will generate a .CMP file and that’s our backup which we can restore in the same way.
3. From the Site itself.
Steps:
1. Go to any site.
2. Make sure you are inside the site.
3. Now, Go to SiteActions SiteSettings Modify All Site Settings
4. Once you are here, In the browser URL, instead of settings.aspx access savetmpl.aspx
5. This will give you to save site as a Template(.stp file saved in site galleries of the root level site)
Custom Permission Levels - For a Normal restricted User
First Check the Site Permissions:
1. View Usage Data - View reports on Web site usage.
2. Browse Directories - Enumerate files and folders in a Web site using SharePoint Designer and Web DAV interfaces.
3. View Pages - View pages in a Web site.
4. Enumerate Permissions - Enumerate permissions on the Web site, list, folder, document, or list item.
5. Browse User Information - View information about users of the Web site.
6. Use Remote Interfaces - Use SOAP, Web DAV, or SharePoint Designer interfaces to access the Web site.
7. Use Client Integration Features - Use features which launch client applications. Without this permission, users will have to work on documents locally and upload their changes.
8. Open - Allows users to open a Web site, list, or folder in order to access items inside that container.
9. Edit Personal User Information - Allows a user to change his or her own user information, such as adding a picture.
List Permissions:
1. Add Items - Add items to lists, add documents to document libraries, and add Web discussion comments.
2. Delete Items - Delete items from a list, documents from a document library, and Web discussion comments in documents.
3. View Items - View items in lists, documents in document libraries, and view Web discussion comments.
4. Open Items - View the source of documents with server-side file handlers.
5. View Versions - View past versions of a list item or document.
6. Delete Versions - Delete past versions of a list item or document.
7. View Application Pages - View forms, views, and application pages. Enumerate lists.
Notes:
1. Modify Shared Web Part will come when user has edit access.
2. Access denied can come when he doesn't have View Application Pages Permission.
3. Delete will show up but when clicked acces denied will come, this is due to the user doesn't have delete versions, view versions permission when versioning has been enabled.
1. View Usage Data - View reports on Web site usage.
2. Browse Directories - Enumerate files and folders in a Web site using SharePoint Designer and Web DAV interfaces.
3. View Pages - View pages in a Web site.
4. Enumerate Permissions - Enumerate permissions on the Web site, list, folder, document, or list item.
5. Browse User Information - View information about users of the Web site.
6. Use Remote Interfaces - Use SOAP, Web DAV, or SharePoint Designer interfaces to access the Web site.
7. Use Client Integration Features - Use features which launch client applications. Without this permission, users will have to work on documents locally and upload their changes.
8. Open - Allows users to open a Web site, list, or folder in order to access items inside that container.
9. Edit Personal User Information - Allows a user to change his or her own user information, such as adding a picture.
List Permissions:
1. Add Items - Add items to lists, add documents to document libraries, and add Web discussion comments.
2. Delete Items - Delete items from a list, documents from a document library, and Web discussion comments in documents.
3. View Items - View items in lists, documents in document libraries, and view Web discussion comments.
4. Open Items - View the source of documents with server-side file handlers.
5. View Versions - View past versions of a list item or document.
6. Delete Versions - Delete past versions of a list item or document.
7. View Application Pages - View forms, views, and application pages. Enumerate lists.
Notes:
1. Modify Shared Web Part will come when user has edit access.
2. Access denied can come when he doesn't have View Application Pages Permission.
3. Delete will show up but when clicked acces denied will come, this is due to the user doesn't have delete versions, view versions permission when versioning has been enabled.
February 26, 2010
Sharepoint Scope Rule for Folder or Particlular List
First Grasp the URL in Content Source where you ran the Crawl.
From Central Admin:
1. Create the Scope and add folder rule.
2. In folder rule..The URL should be
CrawlURL/Documents/FolderName.
Instead of CrawlURL/Documents/AllItems.apsx
3. For List CrawlURL/Lists/ListName
4. You can see item count, but total will be reflected upon updating the scope.
5. Start Update now [No Need to Re-Crawl]
6. The Total will be now same as Item Count.
7. If wanted, In Search core Results..set this scope for limiting results and thats all.
From Site Level
1. Create the Scope and add folder rule.
2. In folder rule..The URL should be
CrawlURL/Documents/FolderName.
Instead of CrawlURL/Documents/AllItems.apsx
3. For List CrawlURL/Lists/ListName
4. You will see item count = 0, Total=0
5. Start Update now [No Need to Re-Crawl]
6. Still Item Count = 0, Total =0 but in Central Admin, You will see Item count = Count and Total = error
7. If wanted, In Search core Results..set this scope for limiting results and thats all.
Note: If searh results are not coming up correctly, Stop Start the Application Pool of Both Application and SSP
From Central Admin:
1. Create the Scope and add folder rule.
2. In folder rule..The URL should be
CrawlURL/Documents/FolderName.
Instead of CrawlURL/Documents/AllItems.apsx
3. For List CrawlURL/Lists/ListName
4. You can see item count, but total will be reflected upon updating the scope.
5. Start Update now [No Need to Re-Crawl]
6. The Total will be now same as Item Count.
7. If wanted, In Search core Results..set this scope for limiting results and thats all.
From Site Level
1. Create the Scope and add folder rule.
2. In folder rule..The URL should be
CrawlURL/Documents/FolderName.
Instead of CrawlURL/Documents/AllItems.apsx
3. For List CrawlURL/Lists/ListName
4. You will see item count = 0, Total=0
5. Start Update now [No Need to Re-Crawl]
6. Still Item Count = 0, Total =0 but in Central Admin, You will see Item count = Count and Total = error
7. If wanted, In Search core Results..set this scope for limiting results and thats all.
Note: If searh results are not coming up correctly, Stop Start the Application Pool of Both Application and SSP
Sharepoint Designer Workflow LookUp Not Showing all the fields
When First Creating the Column, make it a single valued , not multiple values. It will show up in the Workflow Lokup. Deploy the Workflow to the list with Desired Logic. Then Change the Column to Multiple Values if needed and Test The Workflow.
February 22, 2010
Hide Site Actions for Normal Users
<SharePoint:SPSecurityTrimmedControl ID = "spstcSiteActions" runat = "server" PermissionsString = "ManageWeb" >
<span class="siteActionMenu">
<PublishingSiteAction:SiteActionMenu runat="server"/>
</span>
</SharePoint:SPSecurityTrimmedControl>
<span class="siteActionMenu">
<PublishingSiteAction:SiteActionMenu runat="server"/>
</span>
</SharePoint:SPSecurityTrimmedControl>
February 11, 2010
Open A Document in new Window from Document Library
If you want only documents in one document library to open to new windows, you can edit the document library in SharePoint Designer.
1. Open the site in SharePoint Designer and then open the document library allitems.aspx.
2. Right-click the document library web part and select “Convert to XSLT data view”.
3. Search for "Onlink" and you will see this tag “<xsl:otherwise ><A onfocus="OnLink(this)" HREF="{@FileRef}"….. </xsl:otherwise>”, .....add “target="_blank"” in <A> tag.
After this, the documents will be opened in a new window.
1. Open the site in SharePoint Designer and then open the document library allitems.aspx.
2. Right-click the document library web part and select “Convert to XSLT data view”.
3. Search for "Onlink" and you will see this tag “<xsl:otherwise ><A onfocus="OnLink(this)" HREF="{@FileRef}"….. </xsl:otherwise>”, .....add “target="_blank"” in <A> tag.
After this, the documents will be opened in a new window.
Subscribe to:
Posts (Atom)
SonarQube with Jenkins Setup using Docker Images
https://funnelgarden.com/sonarqube-jenkins-docker/ https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...
-
clear $site = Get-SPSite -Identity http://url $q = New-Object -TypeName microsoft.SharePoint.SPSiteDataQuery $q.Lists = "<List...
-
http://sharepointmagazine.net/articles/creating-documents-with-sharepoint-designer-2010-workflows Issue#1 : The workflow could not cr...
-
The competitive examination for the Indian Forest Service is conducted by Union Public Service Commission (UPSC). IFS exam is conducted ann...