.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

HttpWebRequest using SharePoint System account credentials

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :C#
 

I am working on some SharePoint 2010 server-side code, which uses the Client Object Model (to connect to remote farms)... I can use the impersonated user account easily enough, but in some cases I need to use the local farm's SYSTEM account... unfortunately, when I try to encapulate code within an SPSecurity.RunWithElevatedPrivileges block, I cannot find a way to impersonate the app pool service account.

How can I access the SYSTEM account's iCredentials? (whether for the SharePoint client API, an HttpWebRequest, or anything else)

 

The closest I seem to be able to get is within a RunWithElevatedPrivileges block, I can get the System.Security.Principal.WindowsIdentity.GetCurrent() which returns the SYSTEM account, but I'm not sure how to use that to obtain the iCredentials object.


 




View Complete Post


More Related Resource Links

Sharepoint site collections accessible only by system account

  
I I have setup a VM to start palying with SP development, everything running under administrator (sql, sharepoint services....). After succefully creating the root on port 80 and a couple of site collections, whenever I shoot IE http://mymoss or any othe site collection, I go right away to the web site without the usual authentification dialog box. On the right jand side, I see I am logged in as "System account". When I try to "sign in as a different user", enter domain\administrator, who is owner, the dialog box just keeps coming back and I can not log. . Thanks in advance

How to change the System Account into Domain Administrator account in Sharepoint?

  
I'm attaching the captured image from the Central Admin of our Sharepoint Server. (http://www.experts-exchange.com/images/346242/Central-Admin.jpg) As you can see from the Central Admin image, the user account shown is "System Account", in whereas I logged in as our Domain Administrator. Then when you check it's info from My Settings, the details from the captured image System Account Info was shown. ( http://www.experts-exchange.com/images/346243/System-Account-Info.jpg) How can I change it as be DOMAIN\Administrator & not SHAREPOINT\system or System Account? Please advise...  

Sharepoint Designer worflow dont start due to infopath "system account" submission

  

After lot of search i was able to submit the browser enabled infopath form to sharepoint library as anonymous user using following link

http://blog.metrostarsystems.com/2009/06/04/anonymously-submit-infopath-form-to-sharepoint-library/

but the form submit as system account, which makes the sharepoint designer workflow not working on the forms library.

so can any body help me in resolving the code to impersonate user in the infopath submit button.

public void CTRL19_5_Clicked(object sender, ClickedEventArgs e)   
        {
            string siteStr = "http://sharepointwebapplication/";
            SPSite tempSite = new SPSite(siteStr);
            SPUserToken systoken = tempSite.SystemAccount.UserToken;
            using (SPSite site = new SPSite(siteStr, systoken))
       

Sharepoint Designer worflow wontstart due to infopath "system account" submission

  

After lot of search i was able to submit the browser enabled infopath form to sharepoint library as anonymous user using following link

http://blog.metrostarsystems.com/2009/06/04/anonymously-submit-infopath-form-to-sharepoint-library/

but the form submit as system account, which makes the sharepoint designer workflow not working on the forms library.

so can any body help me in resolving the code to impersonate user in the infopath submit button.

public void CTRL19_5_Clicked(object sender, ClickedEventArgs e)   
        {
            string siteStr = "http://sharepointwebapplication/";
            SPSite tempSite = new SPSite(siteStr);
            SPUserToken systoken = tempSite.SystemAccount.UserToken;
            using (SPSite site = new SPSite(siteStr, systoken))
            {
      &

sharepoint 2007 showing System Account instead of Username / full name

  
When i login with my username & password into sharepoint (2007) site, it displays as a "System Account" instead of my username or my full name on the top right corner of the website. What ever changes i make inside the site, for example upload a file, post a comment, sharepoint marks it as a System account instead of my name.

Can someone help me figure it out why ?

Thanks.

Sharepoint - Workflows deleted by System Account

  
Hello all:

We are running into a problem where our workflows as well as the file's version history are being deleted by the "System Account".  And what's more peculiar is that this issue only seems to be happening with .pdf files.  I have checked the "Workflow auto cleanup" timer service in Central Administrator and it is set to disable.  However, even if they were enabled, these workflows are fairly new and should not have been deleted.

I created an approval workflow based on the predesigned approval workflow template.  I had set the approval to allow it to be manually started by an authenticated user & to start the workflow when publishing a major version of the document.  The assigned tasks are serial (one participant at a time) and I assigned 2 approvers, both of whom have owner rights to the site.

I first noticed the problem when the workflow is started and gets approved by the first user.  The second approver wants a change to the .pdf file so he sends it back to the first approver.  The first approver checks out the document, makes a change, then checks it back in.  Then we notice that the workflow has disappeared and the version history is gone.  When the user checks the document in, it reverts back to a version .1 and the workflow has to be generated again.  When looking at the workflow history, it says that the task

Video: SharePoint 2010 File System

  
This video describes the SharePoint 2010 file system and integration with Visual Studio 2010. (Length: 3:23)

System.Data.SqlClient.SqlException: Login failed for user . Reason: The account is disable

  

Hi All,

Thank you for advance.

I created a widows service for mail schedule with c#.net and sql server 2005 and it is working fine for past one year.

now sometimes i am getting the "System.Data.SqlClient.SqlException: Login failed for user '<UserName>'. Reason: The account is disabled." error.

then i restarted the windows service manually and working.

what is the problem in my sql server connection and how to fix that issue?


Central Administration no longer accessible by any account after changing Farm Account in SharePoint

  
I have a problem, that I no longer can access Central Administration Website, only the Sharepoint itself. I was running installation of Sharepoint 2010 Server with administrative account ImTheAdmin, who is a Domain Admin in the MYDOMAIN domain. Using ImTheAdmin I installed Sharepoint 2010 on one of the Windows 2008 R2 member servers. Besides that, I made ImTheAdmin the primary administrator of the Sharepoint. ImTheAdmin became the only user of this Sharepoint 2010 server after installation.  I installed everything on one box with default installation settings. I used builtin SQL server, not Standard or Enterprise. What then happened is: Using ImTheAdmin account, I opened Central Administration Website, and it said, that I need to change the Farm Account, as the account for Farm was the default one (I think it was network service). So I created a regular domain user in AD Users and Computers called MYDOMAIN\SPFarmAccount. Then using IE, I went to the Central Administration Website page, which is meant for changing farm account usernames. I put in MYDOMAIN\SPFarmAccount down in to the form of Central Administration Website, added the check mark, that it would react to password changes, and pressed Change. Browser worked for a while, and after that nothing seemed to work. Neither my Sharepoint, nor Central Administration website. When going to Central Administra

Failed to change Farm Account in Sharepoint 2010 server, now Central Administration is not accessibl

  
Hello, I have a problem, that I no longer can access Central Administration Website, only the Sharepoint itself. I was running installation of Sharepoint 2010 Server with administrative account ImTheAdmin, who is a Domain Admin in the domain on one of the Windows 2008 R2 member servers. Besides that, I made ImTheAdmin the primary administrator of the Sharepoint. ImTheAdmin became the only user of this Sharepoint 2010 server after installation.  I installed everything on one box with default installation settings. I used builtin SQL server, not Standard or Enterprise. What then happened is: Using ImTheAdmin account, I opened Central Administration Website, and it said, that I need to change the Farm Account, for the account for Farm was the default one (I think it was network service). So I created a regular domain user MYDOMAIN\SharepointFarmAccount. The account name was too long to be as a Windows 2000 name, so it showed there without last 't', e.g. MYDOMAIN\SharepointFarmAccoun. I thought, Windows 2000 is long gone, so I didn't pay much attention, I think everywhere the account SID is important. I don't know if that is the real problem with my failure later, but it might be one of the reasons. I put MYDOMAIN\SharepointFarmAccount down in to the form of Central Administration Website, added the check mark, that it would react to password changes, and pre

SharePoint Capacity Planning Tool and system Center Capacity Planner

  
Hi, It seems like we cannot use the SharePoint Capacity Planning Tool anymore. I downloaded this SharePoint Capacity Planning Tool but its prerequisite system Center Capacity Planner(SCCP 2007) has been discontinued, as per this URL, http://technet.microsoft.com/en-us/systemcenter/ff575746.aspx  So when I try to install SharePoint Capacity Planning tool, it ask me to install SCCP V2 first. Please share if somebidy has a copy SCCP V2 or do we have any other alternate tool that can be used for SharePoint Capacity planning? Thanks, San      

Can't view the SharePoint Site. Explorer won't take domain account

  
Hi, I'm having issues viewing the SharePoint 2010 Site that I have deployed from any workstation. It seems that my permissions settings have broken - even though I haven't touched them. Whenever http://start/ is visited (the Intranet top site) it asks for credentials. They should have been taken from the User that was logged onto the machine. E.g. NATWIDE\UserA. After entering the credentials, it doesn't accept them, and asks for them again. And again. And then blank page. I'm not receiving the SharePoint "restricted access" page... HOWEVER, when I log into the website via Mozilla Firefox - it appears that the credentials are fine, and it works according to the permissions set for the site from within SharePoint. Does anyone have any idea why this would be happening. I'm completely stumped and I can't find a similar issue anywhere else. I have installed a Stand-alone installation of SharePoint 2010 Server Enterprise on Server 2008. The account that installed the SharePoint server and is a FARM Administrator, can't even log in to view the page. Cheers, Stu. I do not think much of a man who is not wiser today than he was yesterday. - Abraham Lincoln

change system account to username?

  
HI, I have created out-of-box workflow ,in the version history the modifiedby column  showing as system account instead of username. so want to display actual username instead of system account. help is appreciated. Thanks.

Can´t set up local system accounts as service accounts in sharepoint 2010

  
HI I made an inplace upgrade to sharepoint 2010. I want to setup performance point services. but it doesn´t allow me to set a local system account as the application pool account for performance point services application. It doesn´t allow me to register a new account it says The specified user account "domain\username" is a local account. Local accounts should only be used in stand alone mode. The application pool account for the site collection that I upgraded is a local system account so I don´t get it? I tried this http://sharepoint.microsoft.com/blogs/fromthefield/Lists/Posts/Post.aspx?ID=112 However the upgrade fails after this. Is there any way that I do the inplace upgrade and it would allow me to use local system accounts has service accounts? Without Active directory? Thanks      

Same server farm administrator domain account for both Intranet and Internet Sharepoint site?

  
Hello,   We are planning to setup 2 streams of architecture for both Intranet and Internet web sites. Just wondering whether there is any best practices/security concerns if we are using the same domain account as the Server Farm Administrator for both Intranet and Internet platform?   Thanks,

Sharepoint Designer repeatedly prompts for credentials

  
When I try to access SharePoint Designer 2010, I am repeatedly prompted to enter my credentials. I am running on a Windows 7 64 bit machine (in "Developer mode"). I select the designer from the home page from the site actions menu. I tried this solution, as this is exactly my problem, but it didn't work; http://support.microsoft.com/kb/982948 I have been searching for this issue but to no avail Thanks

file size increase when moving from file system to sharepoint 2007

  
Hi, While moving files from file system to Sharepoint 2007 via windows explorer view, why do file sizes increase? thanks, Burcu  
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend