Hot answers tagged user
13
Immediate Alerts timer job "Sends out immediate and scheduled alerts." the documentation says. However, immediate is controlled by a timer job which runs every five minutes by default. So in your case - the possible series of actions is:
Create folder
Create alert
Now these two actions happened within the same 5 minute period, and when the timer job ...
6
There is this SP.UI.ModalDialog class (MSDN doku). With dialogOptions you can specify, how will your page behave after the user closes the dialog.
function OpenMasterdataDialog(strPageURL) {
var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.url = yourPageWithDialogContent;
dialogOptions.width = 750;
dialogOptions.height = ...
5
You can try this if I understand you correct?
Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.LoginName;
or
HttpContext.Current.User.Identity.Name
and
Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.ID;
hope this helps :)
5
Last year, Microsoft launched a dedicated site for SharePoint user adoption which can be a good place for you to start with.
With addition to the above, I believe your prime concern should be planning a collaboration roadmap on SharePoint.
This will essentially include high level areas like
Current use of Office 2010 products within your organization and ...
5
There is a special element which is intended for use with multiple lookup fields:
http://msdn.microsoft.com/en-us/library/ff630172.aspx
Includes Element (Query)
If the specified field is a Lookup field that allows multiple values,
specifies that the Value element is included in the list item for the
field that is specified by the FieldRef ...
4
You can retrieve the system account by SPSite property
SPContext.Current.Site.SystemAccount
Basicaly EnsureUser method uses logon name (Domain\User_Alias) of the user.
4
SharePoint is complex but the average user never even has to know what a web part is, so focus on the biggest bang for your buck. If 95% of the user base is just looking for a place to create lists or store documents, you can explain that in under 10 minutes. There are countless videos on the web that show this and there are even third party solutions that ...
4
Why don't you use a SPAlertHandler to change how alerts work for this list? Then you can decide when an alert is sent or not in C# code.
http://msdn.microsoft.com/en-us/library/bb897791(v=office.14).aspx
public override bool OnNotification(SPAlertHandlerParams ahp)
{
try
{
using (SPSite site = new SPSite(ahp.siteUrl + ahp.webUrl))
...
3
Assuming your pages reside in a document library typically named as 'Pages' or 'Site Pages' what you need to do is go to manage permissions for the custom page and stop inheriting permissions.
You need to give unique permissions to those pages and just grant users/groups whom you wish to make these pages accessible. That ways you can exclude group or a ...
3
You also can use the SPUser and SPUserCollection Object to iterate through all user profiles
using Microsoft.SharePoint;
using Microsoft.Office.Server.UserProfiles;
using Microsoft.Office.Server;
using System.Web;
here is the code:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite siteCollection = new ...
3
You will need to load it from the User Profiles and not the SPUser object.
SPServiceContext svcContext = SPServiceContext.GetContext(site);
UserProfileManager profileManager = new UserProfileManager(svcContext);
UserProfile profile = profileManager.GetUserProfile(accountname);
string department = profile["department"].Value;
3
The closest you can get with default functionality is to impersonate a user and make a search with the user whose "linked" files you're interested in listing.
Considering it is practically not possible to impersonate as each user, I would start off from this blog article and modify the code to be cross site collection and across all web apps.
You could ...
3
According to How to set people and group column programmatically using Client Object Model this is how you set single user fields:
SP.User _newUser = _ctx.Web.EnsureUser("domain\\username");
_ctx.Load(_newUser);
_ctx.ExecuteQuery();
SP.FieldUserValue _userValue = new SP.FieldUserValue();
_userValue.LookupId = _newUser.Id;
_listItem["userfield"] = ...
3
I guess the most easiest way I know is to show it by JavaScript using SPServices. Look to SPServices documentation and examples for getting current user. This way allows to do that without extra server side codding.
Sample:
var thisUserName = $().SPServices.SPGetCurrentUser({
fieldName: "Title",
debug: false
});
Then put thisUserName where you need.
3
No, in my opinion it is not, unless you are using Form Based Authentication.
In FBA, you could even have people themselves create their own users: anonymous user clicks Register, fills in a form with some essential information, a working e-mail address, and that's it. Basically, like you register yourself on most of the websites on the WWW.
But if you are ...
3
You should uninherit the permissions for that library.
Go to that library.
Go to the Library Tools highlighted section at the top and click the Library tab
Click Library Permissions.
Click the Uninherit button. This will uninherit the permission from the site but copy over what it has already.
Delete the users you don't want to see the library. Add the ...
3
Warning
Depending on the number of documents you expect your users to store in SharePoint it sounds as if you're heading in the direction of disaster, by storing everything in the same Site in the same Site Collection.
Answer to asked question
You want to create an AD-Group for each department.
You should then add all departments to the guest/visitors ...
3
How about using the following function,
Microsoft.SharePoint.Utilities.SPUtility.ResolveWindowsPrincipal()?
It has the following parameters:-
webAppType: Microsoft.SharePoint.Administration.SPWebApplication
inputType: System.String
scopesType: Microsoft.SharePoint.Utilities.SPPrincipalType
inputIsEmailOnlyType: System.Boolean
There are two overloads, ...
2
Both Get-SPDatabase or Get-SPContentDatabase powershell cmdlets retrun database GUID (among other attributes), if called without parameters, try to use it.
2
As far as I know you will have to parse the XML. Its very easy to do
string xml = @"<pc:Person xmlns:pc=""http://schemas.microsoft.com/office/infopath/2007/PartnerControls"">
<pc:DisplayName>John Dodo</pc:DisplayName>
<pc:AccountId>DOMAIN\john.dodo</pc:AccountId>
...
2
Allow invitations into specific groups: Instead of just being able to invite users to the Visitors or Members groups, is there any way I can specify other groups already setup?
I've worked this one out: If you go into Site Actions > Site Settings > People and Groups and click the group you would like to invite people into, you can then click Settings > ...
2
I echo the site mentioned http://www.harbar.net/articles/sp2010ups.aspx for what you need to do to sort out the UPS issues.
I have recently undertaken 2 migrations in the space of 2 weeks and have been finding that if I don't get everything right and unable to start the FIM services the first time the only way I seem to resolve the problem is to apply the ...
2
I've managed to make this work by using the InfoPath userName() function then passing the value back to my workflow with the extended properties of the task the opened form is associated to.
Not sure if this is the best (only?) way, but it works.
Just one thing to be aware of. Some fields in the external properties are GUIDs so you might need the ...
2
NOTE: This solution doesn't work for Site workflows
You can use this code snippet (Get current user in workflow sharepoint context (C#))
public static SPUser GetCurrentUserInWorkflow(Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties workflowProperties)
{
string ModifiedbyUserName = ...
2
I use UserProfile to access this type of data. http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofile.aspx
here's some sample code of using it with people picker
private UserProfile GetExistingEmployee(string CurrentWebSiteURL)
{
UserProfile profile = null;
using (SPSite site = new SPSite(CurrentWebSiteURL))
{
...
2
There is no event receiver for users or user groups. So you'll have to create a timer job and do the checking for new groups yourselvers.
Or you can add some javascript to a delegate control (AdditionalPageHead) which checks for the current page being _layouts/newgrp.aspx and if it is hooks the clicked event of ctl00_PlaceHolderMain_ctl06_RptControls_btnOK ...
2
You'll have to develop or use a custom solution to accomplish this, e.g. a component that inspects the logged-in user and does the forward.
If you want to build one yourself:
http://blog.furuknap.net/redirecting-users-based-on-group-membership
An example of a third-party webpart:
http://store.bamboosolutions.com/pfi-14-group-redirect-web-part.aspx
2
To my knowledge you do not add User to an Audience, but rather build rules that would include the respective user to an audience.
Creating rule based Audiences is available here http://msdn.microsoft.com/en-us/library/ms498178
Then you could check is user is part of an Audience in a particular Web, see here http://msdn.microsoft.com/en-us/library/ms500775
2
SharePoint can certainly handle that many users, also concurrently. I've built an SP 2010 solution that handled around 150,000 user profiles with tens of thousands of active users (although the definition of 'concurrent' may vary).
This definitely sounds like a bad configuration or underperforming hardware. Because you're getting a connection error to the ...
2
The Multiple User field is internally just a LookUp Field. The following code should work:
var users = new Array();
users.push(SP.FieldUserValue.fromUser("userName1"));
users.push(SP.FieldUserValue.fromUser("userName2"));
item.set_item(fieldName, users);
item.update();
Instead of SP.FieldUserValue.fromUser("userName1") you can use your existing ...
Only top voted, non community-wiki answers of a minimum length are eligible
