Tag Info

Hot answers tagged

15

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 ...


9

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"] = ...


8

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 ...


7

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 = ...


6

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 ...


6

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

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 ...


5

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)) ...


4

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 ...


4

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;


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

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 ...


4

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 ...


4

You can filter folders from alerts, but it's a little tricky. Here's how I've managed to accomplish it. First, create a custom content type based on the Folder content type (I named it "Managed Folder" in this case). Add that to any lists you want to be affected and make sure it is visible in the "New" button. Remove folder creation from the list in its ...


4

Yes _spUserId is deprecated in SP2013. Use _spPageContextInfo.userId instead.


4

This should return the current user: (Works for me here) Web web = clientContext.Web; clientContext.Load(web); clientContext.ExecuteQuery(); clientContext.Load(web.CurrentUser); clientContext.ExecuteQuery(); currentUser = clientContext.Web.CurrentUser.LoginName;


3

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 ...


3

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 = ...


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

Both Get-SPDatabase or Get-SPContentDatabase powershell cmdlets retrun database GUID (among other attributes), if called without parameters, try to use it.


3

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> ...


3

Was this windows account the same one with which SharePoint was installed? In that case, you could try to create a new user in AD and then login using the new user credentials.


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

In case any other internet wayfarers come by this problem; it's highly likely that this is due to the app-pool user being given the "Act as system" privilege in the Central Admin User Policy for the webapplication.


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

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

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, ...


3

Sharepoint\System is actually the account used by application pool of your SharePoint web application in IIS. This account anyway has full permissions on your site and hence adding or removing this account from a group does not make any difference.


3

Users who are added as Site Collection Administrators are added in one of two ways: 1) They are the Owner or Secondary Owner on the Site Collection. You can set those from Central Administration or PowerShell. 2) They are added by going to the Site Collection Administrators button on the ribbon when viewing the Permissions page on the Root Web of the Site ...


3

SP.Web.siteUsers property gets the collection of all users that belong to the site collection: var value = SP.Web.get_siteUsers () How to get User client Object by email function getUser(userName,Success,Error) { var context = new SP.ClientContext.get_current(); var web = context.get_web(); var user = web.get_siteUsers().getByEmail(userName); ...



Only top voted, non community-wiki answers of a minimum length are eligible