Automate MSOCAF (SharePoint Online Code Analysis Framework) ?

Can I generate automated reports with MSOCAF ? (Without using the MSOCAF GUI)
Is there a way to control MSOCAF with PowerShell?

Since most of msocaf just runs fxcop, cat.net and spdisposechecker, it's pretty simple to integrate these into Visual Studio and TFS. I went a step further and re-targetted the rules to the FxCop 10.0 binaries, that way you can achieve complete TFS and Visual
Studio integration. I went the way of makign the rules compatible with FxCop 10, but you can also simply create a number of target files in msbuild that execute the fxcop, cat.net and spdisposechecker binaries on your project output. That will give you the
same result as running the wizard.
To find the actual binaries run MSOCAF, and then from the task manager rightclick the process and pick Open File Location. 
We try to make sure we're at 0 items found and with the Visual Studio integration you can simply add the proper SupressMessage attributes to suppress the warning in the actual MSOCAF tool.
Apart from my blog and my fxcopcontrib project, you might want to check out:
MsBuild Community Tasks (fxcop task)
CAT.NET msbuild task
Community TFS Build Extensions (fxcop disposechecker, cat.net (even 2.0)). through build process template customization
Since the integration into FxCop gives the best integration in both Visual Studio and Team Build, I went in that way. If you need help or want to give feedback, please contact me through my
google+ or
twitter.
What these solutions don't do is create the actual MSOCAF report, but it makes it a lot easier to stay on a low number (or zero) of warnings.
My blog: blog.jessehouwing.nl

Similar Messages

  • RSS feed subscription in a semi-automatic way (SharePoint online)

    I have a site with a lot of subsites. I want to user to be able to subscribe to RSS feed in a more automatic way.
    If possible I would add a button or link to a subsite. When the user clicks this he/she is subscribed to (my pre-defined) set of RSS feeds, at once (that will be about 50 lists and document libraries).
    Is this possible?
    Thanks, Mike

    Check out Waldek's post on the subject here http://blog.mastykarz.nl/creating-rss-feeds-sharepoint-2010-content-query-web-part/
    (Edit: By request of the blog author the content should be linked instead of copied in its entirety)

  • How to upload local files to Offices365 SharePoint Online Site by C# Code?

    Hi all,
    I've some requirement needs to upload files from local to Office365 Sharepoint Online Site Document Library using C# code?
                   public static void upload()
    Uri uri = new Uri("siteurl");
                    ClientContext context = new ClientContext(uri);
                    var passWord = new SecureString();
                    foreach (var c in "password") passWord.AppendChar(c);
                    context.Credentials = new SharePointOnlineCredentials("email", passWord);
    Web web = context.Web;
                   FileCreationInformation newFile = new FileCreationInformation();
                    newFile.Content = System.IO.File.ReadAllBytes(@"C:\myfile.txt");
                    newFile.Url = "file uploaded via client OM.txt";
                    List docs = web.Lists.GetByTitle("Documents");
                    Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
                    context.ExecuteQuery();
    I don't know whether this method works and I'm always get issue for getting the ClientContext.
    Thanks for your reply.

    Please try below.
    public void SaveFileToSharePoint(string fileName)
    using (var context = new ClientContext("https://mydomain.com/"))
    var passWord = new SecureString();
    foreach (var c in "MyPassword") passWord.AppendChar(c);
    context.Credentials = new SharePointOnlineCredentials("[email protected]", passWord);
    var web = context.Web;
    var newFile = new FileCreationInformation {Content = File.ReadAllBytes(fileName), Url = Path.GetFileName(fileName)};
    var docs = web.Lists.GetByTitle("Documents");
    docs.RootFolder.Folders.GetByUrl("Test").Files.Add(newFile);
    context.ExecuteQuery();
    Bala

  • Security flaw-To use CSOM/Javascript code for Custom Office365(Sharepoint Online) application

    Hi,
    I've developed custom application in Office365(Sharepoint Online) using CSOM/Javascript. Security team from client side has been reported one major issue to the our application that any end user can comment our CSOM/Javascript code and bypass the validation
     or can update / insert into sharepoint list item using developer tool/ Console in Google Chrome(F12 Key).
    Also end user can write his own separate code in console of Google Chrome (Developer Tool / F12) and can update / insert  into Sharepoint List.
    Note:- End user has Add, Edit, View permission on all Sharepoint List.
    This is one major security flaw of the Sharepoint/Office365 to use CSOM /Javascript for writing code, to overcome this issue could you please provide me some solution.
    Your help would be greatly appreciated!!!  
    Looking for reply.
    Thanks,
    Mahesh Sherkar
    Web: http://Mahesh-Sherkar.com
    Email: [email protected]

    Hello Paras, 
    Did you get any solution for this? I think your website was implemented this form. Can you please tell me the way how I can achieve it? I am also facing same problem. Please reply me as early as possible.
    Thanks,
    Mihir

  • Access SharePoint Online Data through code/powershell

    Hi All,<o:p></o:p>
    I need to access SharePoint Online site to upload documents from local machine to the doc libraries on the site.. (100s of docs)
    I am trying to see if I can use PowerShell script for this..  However, I see that SharePoint Online Management Shell cmdlets are not robust enough to do such operations..  Is there a way I can use CSOM / .net console app / any other way.. I am drawing
    blank here.. L<o:p></o:p>
    Any help is much appreciated.<o:p></o:p>
    Charan

    You can start from here
    http://blogs.technet.com/b/fromthefield/archive/2014/02/19/office365-script-to-upload-files-to-a-document-library-using-csom.aspx
    Regards Chen V [MCTS SharePoint 2010]

  • Help please .. Automatic code analysis tool

    Hi,
    I have written some action script for my project and i am
    required to do a static code analysis on it.
    I do not know any source code analyzers that support
    actionscript particularly like fortify and ounce labs which
    support Java script but not action script.Please suggest me
    an tool that can do analysis for me.
    Regards
    Mallik.

    Hi Ross,
    Thank you very much for your reply, i think i should rephrase
    my question to make it even clear.
    I am looking for a tool to detect Buffer overflows, memory
    leaks, security vulnerabilities, string vulnerabilities, Race
    conditions. I am sorry i think by mentioning security i gave the
    impression of protection my application from external intrusion.
    But this is what i meant. For example, My project also includes C#
    usage and i have options like fortifysoftware, ouncelabs
    ,parasoft's .TEST, FxCop (microsoft) to help me do static analysis
    on my C# code. I need some tool like these for action
    scripts.Please let me know if you need more explanation.
    Regards
    Mallik

  • SharePoint online 2013 event receiver error

    I am currently working on a SharePoint online project. My code generates 6 documents in 6 different document libraries along with other metadata. When I save data to a List, the event receiver fires and creates all the 6 documents. But sometimes it stops creating
    the 6 documents and left with 1 or 2 documents. Sometimes documents has been created but without any metadata.
    The same code is working fine in my on-premises environment, but it sometimes breaks in the Office 365 environment. I also created a log list to track the issue as we cannot debug in Office 365. In the log list I found a error message saying "Thread was
    being aborted." Below is my code. please help it is happening only in Office 365 environment.
    namespace ExcelGen.ExcelGenReceiver
    using System;
    using Microsoft.SharePoint;
    /// <summary>
    /// List Item Events
    /// </summary>
    public class ExcelGenReceiver : SPItemEventReceiver
    /// <summary>
    /// The template URL
    /// </summary>
    private const string TemplateUrl = "/Quotation Analysis Electrical/Forms/Quotation Analysis Sheet ELEC_Blank.xlsm";
    /// <summary>
    /// The template url1
    /// </summary>
    private const string TemplateUrl1 = "/Quotation Analysis Mechanical/Forms/Quotation Analysis Sheet MECH_Blank.xlsm";
    /// <summary>
    /// The template url2
    /// </summary>
    private const string TemplateUrl2 = "/TenderSummaryLib/Forms/TenderSummaryBlankMaster1.xlsm";
    /// <summary>
    /// The RFI template URL
    /// </summary>
    private const string RfiTemplateUrl = "/EstimatingRFI/Forms/RFI Schedule MASTER.docx";
    /// <summary>
    /// The drawing template URL
    /// </summary>
    private const string DrawingTemplateUrl = "/Tender and Drawing Schedule/Forms/Tender Document Drawing Schedule.docx";
    /// <summary>
    /// The tender return template URL
    /// </summary>
    private const string TenderReturnTemplateUrl = "/Est_Tender_Pricing_Document/Forms/Tender Pricing Document blank.xlsm";
    /// <summary>
    /// The project number
    /// </summary>
    private string projectNumber = string.Empty;
    /// <summary>
    /// The project name
    /// </summary>
    private string projectName = string.Empty;
    /// <summary>
    /// The no bid
    /// </summary>
    private string noBid;
    /// <summary>
    /// The team
    /// </summary>
    private string team;
    /// <summary>
    /// The description
    /// </summary>
    private string description;
    /// <summary>
    /// The status
    /// </summary>
    private string status;
    /// <summary>
    /// The electrical
    /// </summary>
    private SPUser electrical;
    /// <summary>
    /// The mechanical
    /// </summary>
    private SPUser mechanical;
    /// <summary>
    /// The document date
    /// </summary>
    private DateTime? docDate;
    /// <summary>
    /// The tender received
    /// </summary>
    private DateTime? tenderReceived;
    /// <summary>
    /// The tender return
    /// </summary>
    private DateTime? tenderReturn;
    /// <summary>
    /// The pre construction program start date
    /// </summary>
    private DateTime? preConstructionProgramStart;
    /// <summary>
    /// The pre construction program end date
    /// </summary>
    private DateTime? preConstructionProgramEnd;
    /// <summary>
    /// The sector
    /// </summary>
    private string sector;
    /// <summary>
    /// The design build
    /// </summary>
    private string designBuild;
    /// <summary>
    /// The build type
    /// </summary>
    private string buildType;
    /// <summary>
    /// The service program start date
    /// </summary>
    private DateTime? serviceProgramStart;
    /// <summary>
    /// The service program completion date
    /// </summary>
    private DateTime? serviceProgramCompletion;
    /// <summary>
    /// The client1
    /// </summary>
    private string client1;
    /// <summary>
    /// The client2
    /// </summary>
    private string client2;
    /// <summary>
    /// The client3
    /// </summary>
    private string client3;
    /// <summary>
    /// The client4
    /// </summary>
    private string client4;
    /// <summary>
    /// The consultant
    /// </summary>
    private string consultant;
    /// <summary>
    /// An item is being added.
    /// </summary>
    /// <param name="properties">The Item Event properties</param>
    public override void ItemAdded(SPItemEventProperties properties)
    //this.EventFiringEnabled = false;
    var web = properties.Web;
    var listItem = properties.ListItem;
    try
    LogIssue(web, null, "Item Added", "List Item Id {0}", listItem.ID);
    if (!this.AttemptCopyProcess(listItem))
    LogIssue(web, null, "List Id : " + listItem.ID, "AttemptCopyProcess failed.");
    catch (Exception ex)
    LogIssue(web, ex, "List Id : " + listItem.ID, "AttemptCopyProcess failed.");
    finally
    //this.EventFiringEnabled = true;
    LogIssue(web, null, "List Id : " + listItem.ID, "Event Receiver completed sucessfully.");
    /// <summary>
    /// Logs any issues found
    /// </summary>
    /// <param name="webContext">The web context.</param>
    /// <param name="exception">The exception, if null not exception details are written</param>
    /// <param name="contextId">The context identifier, a unique identifier that allows us to know where the call originated, i.e. a List and ListItem Id, or a Page Url</param>
    /// <param name="comment">The comment.</param>
    /// <param name="args">The arguments.</param>
    private static void LogIssue(SPWeb webContext, Exception exception, string contextId, string comment, params object[] args)
    //// if (webContext.AllProperties.ContainsKey("EnableLogging"))
    var list = webContext.Lists.TryGetList("ErrorIssues");
    if (list != null)
    var item = list.AddItem();
    item["Title"] = contextId;
    if (exception != null)
    item["Message"] = exception.Message;
    item["InnerException"] = exception.InnerException ?? (object)string.Empty;
    item["StackTrace"] = exception.StackTrace;
    if (!string.IsNullOrEmpty(comment))
    item["Comment"] = string.Format(comment, args);
    item.Update();
    /// <summary>
    /// Assigns the field.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="fieldName">Name of the field.</param>
    /// <param name="contextId">The context identifier.</param>
    /// <returns>The fields string value if present, otherwise string.empty.</returns>
    private static string AssignField(SPListItem listItem, string fieldName, string contextId)
    var fieldValue = string.Empty;
    if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
    fieldValue = listItem[fieldName].ToString();
    else
    LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
    return fieldValue;
    /// <summary>
    /// Assigns the field as a DateTime
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="fieldName">Name of the field.</param>
    /// <param name="contextId">The context identifier.</param>
    /// <returns>Returns the date if found, otherwise returns DateTime.MinValue</returns>
    private static DateTime? AssignDateField(SPListItem listItem, string fieldName, string contextId)
    DateTime? fieldValue = null;
    if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
    fieldValue = Convert.ToDateTime(listItem[fieldName].ToString());
    else
    LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
    return fieldValue;
    /// <summary>
    /// Creates the folder.
    /// </summary>
    /// <param name="listdoc">The list.</param>
    /// <param name="folderName">Name of the folder.</param>
    private static void CreateFolder(SPList listdoc, string folderName)
    LogIssue(listdoc.ParentWeb, null, "List Id : " + listdoc.ID, "Creating folder {0} in {1}", folderName, listdoc.RootFolder.ServerRelativeUrl);
    // Updated by Indusnet
    SPListItem folder1 = listdoc.Items.Add(listdoc.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder);
    folder1["Name"] = folderName;
    folder1.Update();
    listdoc.Update();
    // End Updated
    /// <summary>
    /// Assigns the user field.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="fieldName">Name of the field.</param>
    /// <param name="contextId">The context identifier.</param>
    /// <returns>Returns the user if found, otherwise null.</returns>
    private static SPUser AssignUserField(SPListItem listItem, string fieldName, string contextId)
    SPUser user = null;
    if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
    var userField = (SPFieldUser)listItem.Fields.GetField(fieldName);
    var fieldValue = (SPFieldUserValue)userField.GetFieldValue(listItem["electrical_proj_manager"].ToString());
    user = fieldValue.User;
    else
    LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
    return user;
    /// <summary>
    /// Attempts the copy process.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <returns>True if it successfully processed, false otherwise.</returns>
    private bool AttemptCopyProcess(SPListItem listItem)
    if (listItem.ParentList.Title != "Enquiry_Template")
    LogIssue(listItem.Web, null, "List Id : " + listItem.ID, "ListItem titles is not Enquiry_Template, aborting.");
    return false;
    var finalNum = "15-" + new Random().Next(0, 9999).ToString("D4");
    this.Initialize(listItem, finalNum);
    if (this.noBid != "Yes")
    LogIssue(listItem.Web, null, "List Id : " + listItem.ID, "The noBid field does not equal Yes, aborting.");
    return false;
    this.CopyFiles(listItem.Web, finalNum);
    this.CreateFolders(listItem.Web);
    return true;
    /// <summary>
    /// Copies the files.
    /// </summary>
    /// <param name="web">The web.</param>
    /// <param name="finalNum">The final number.</param>
    private void CopyFiles(SPWeb web, string finalNum)
    LogIssue(web, null, "Web Id : " + web.ID, "Setting the copying of files ...");
    var mechanicalQuoteList = web.Lists["Quotation Analysis Mechanical"];
    var electricalQuoteList = web.Lists["Quotation Analysis Electrical"];
    var tenderSummarList = web.Lists["TenderSummaryLib"];
    var estimatingList = web.Lists["EstimatingRFI"];
    var tenderSheduleList = web.Lists["Tender and Drawing Schedule"];
    var tenderPricingList = web.Lists["Est_Tender_Pricing_Document"];
    var url1 = mechanicalQuoteList.RootFolder.ServerRelativeUrl;
    var url = electricalQuoteList.RootFolder.ServerRelativeUrl;
    var url2 = tenderSummarList.RootFolder.ServerRelativeUrl;
    var urlA = estimatingList.RootFolder.ServerRelativeUrl;
    var urlB = tenderSheduleList.RootFolder.ServerRelativeUrl;
    var urlC = tenderPricingList.RootFolder.ServerRelativeUrl;
    var foldername1 = string.Empty;
    var foldername = string.Empty;
    var foldername2 = string.Empty;
    var foldernameA = string.Empty;
    var foldernameB = string.Empty;
    var foldernameC = string.Empty;
    var folder1 = web.Folders[url1 + "/" + foldername1];
    var folder = web.Folders[url + "/" + foldername];
    var folder2 = web.Folders[url2 + "/" + foldername2];
    var folderA = web.Folders[urlA + "/" + foldernameA];
    var folderB = web.Folders[urlB + "/" + foldernameB];
    var folderC = web.Folders[urlC + "/" + foldernameC];
    if (!folder1.Exists && !folder.Exists && !folder2.Exists && !folderA.Exists && !folderB.Exists && !folderC.Exists)
    var folders1 = web.GetFolder(url1).SubFolders;
    var folders = web.GetFolder(url).SubFolders;
    var folders2 = web.GetFolder(url2).SubFolders;
    var foldersA = web.GetFolder(urlA).SubFolders;
    var foldersB = web.GetFolder(urlB).SubFolders;
    var foldersC = web.GetFolder(urlC).SubFolders;
    folders1.Add(foldername1);
    folders.Add(foldername);
    folders2.Add(foldername2);
    foldersA.Add(foldernameA);
    foldersB.Add(foldernameB);
    foldersC.Add(foldernameC);
    var file1 = web.GetFile(web.Site.Url + TemplateUrl1);
    var file = web.GetFile(web.Site.Url + TemplateUrl);
    var file2 = web.GetFile(web.Site.Url + TemplateUrl2);
    var fileA = web.GetFile(web.Site.Url + RfiTemplateUrl);
    var fileB = web.GetFile(web.Site.Url + DrawingTemplateUrl);
    var fileC = web.GetFile(web.Site.Url + TenderReturnTemplateUrl);
    if (file1 != null && file != null && file2 != null && fileA != null && fileB != null && fileC != null)
    var fileName = string.Format("{0}/{1}{2}", folder1.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 1 {0} to {1}...", file1.Name, fileName);
    var byteArray1 = file1.OpenBinary();
    var uploadedFile1 = folder1.Files.Add(fileName, byteArray1, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 1 Uploaded with new ID of {0}", uploadedFile1.Item.ID);
    this.EventFiringEnabled = false;
    var listitem1 = uploadedFile1.Item;
    listitem1["Name"] = this.projectName;
    listitem1["EnquiryNo"] = finalNum;
    listitem1["Project_Name"] = this.projectName;
    listitem1["Tender_Received"] = this.tenderReceived;
    listitem1["Tender_Return"] = this.tenderReturn;
    listitem1["Quotation_Analysis_Mech_Url"] = "https://my site url/Quotation%20Analysis%20Mechanical/Forms/DispForm.aspx?ID=" + listitem1.ID;
    listitem1.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 1.");
    fileName = string.Format("{0}/{1}{2}", folder.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 2 {0} to {1}...", file.Name, fileName);
    var byteArray = file.OpenBinary();
    var uploadedFile = folder.Files.Add(fileName, byteArray, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 2 Uploaded with new ID of {0}", uploadedFile.Item.ID);
    this.EventFiringEnabled = false;
    var listitem = uploadedFile.Item;
    listitem["Name"] = this.projectName;
    listitem["EnquiryNo"] = finalNum;
    listitem["Project_Name"] = this.projectName;
    listitem["Tender_Received"] = this.tenderReceived;
    listitem["Tender_Return"] = this.tenderReturn;
    listitem["Quotation_Analysis_Elec_Url"] = "https://my site url/Quotation%20Analysis%20Electrical/Forms/DispForm.aspx?ID=" + listitem.ID;
    listitem.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 2.");
    fileName = string.Format("{0}/{1}{2}", folderA.ServerRelativeUrl, this.projectName, ".docx");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 3 {0} to {1}...", fileA.Name, fileName);
    var byteArrayA = fileA.OpenBinary();
    var uploadedFileA = folderA.Files.Add(fileName, byteArrayA, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 3 Uploaded with new ID of {0}", uploadedFileA.Item.ID);
    this.EventFiringEnabled = false;
    var listitemA = uploadedFileA.Item;
    listitemA["Name"] = this.projectName;
    listitemA["EnquiryNo"] = finalNum;
    listitemA["Project_Name"] = this.projectName;
    listitemA["Date"] = this.docDate;
    listitemA["Description"] = this.description;
    listitemA["ProjectNo"] = this.projectNumber;
    listitemA["RFIUrl"] = "https://my site url/EstimatingRFI/Forms/DispForm.aspx?ID=" + listitemA.ID;
    listitemA.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 3.");
    fileName = string.Format("{0}/{1}{2}", folderB.ServerRelativeUrl, this.projectName, ".docx");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 4 {0} to {1}...", fileB.Name, fileName);
    var byteArrayB = fileB.OpenBinary();
    var uploadedFileB = folderB.Files.Add(fileName, byteArrayB, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 4 Uploaded with new ID of {0}", uploadedFileB.Item.ID);
    this.EventFiringEnabled = false;
    var listitemB = uploadedFileB.Item;
    listitemB["Name"] = this.projectName;
    listitemB["EnquiryNo"] = finalNum;
    listitemB["Project_Name"] = this.projectName;
    listitemB["Date"] = this.docDate;
    listitemB["Description"] = this.description;
    listitemB["ProjectNo"] = this.projectNumber;
    listitemB["DrawingURL"] = "https://my site url/Tender%20and%20Drawing%20Schedule/Forms/DispForm.aspx?ID=" + listitemB.ID;
    listitemB.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 4.");
    fileName = string.Format("{0}/{1}{2}", folderC.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 5 {0} to {1}...", fileC.Name, fileName);
    var byteArrayC = fileC.OpenBinary();
    var uploadedFileC = folderC.Files.Add(fileName, byteArrayC, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 5 Uploaded with new ID of {0}", uploadedFileC.Item.ID);
    this.EventFiringEnabled = false;
    var listitemC = uploadedFileC.Item;
    listitemC["Name"] = this.projectName;
    listitemC["EnquiryNo"] = finalNum;
    listitemC["Project_Name"] = this.projectName;
    listitemC["Date"] = this.docDate;
    listitemC["Description"] = this.description;
    listitemC["ProjectNo"] = this.projectNumber;
    listitemC["PricingURL"] = "https://my site url/Est_Tender_Pricing_Document/Forms/DispForm.aspx?ID=" + listitemC.ID;
    listitemC.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 5.");
    fileName = string.Format("{0}/{1}{2}", folder2.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 5 {0} to {1}...", file2.Name, fileName);
    var byteArray2 = file2.OpenBinary();
    var uploadedFile2 = folder2.Files.Add(fileName, byteArray2, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 6 Uploaded with new ID of {0}", uploadedFile2.Item.ID);
    this.EventFiringEnabled = false;
    var listitem2 = uploadedFile2.Item;
    listitem2["Name"] = this.projectName;
    listitem2["EnquiryNo"] = finalNum;
    listitem2["Project_Name"] = this.projectName;
    listitem2["Date"] = this.docDate;
    listitem2["Team"] = this.team;
    listitem2["Estimator_Electrical"] = this.electrical;
    listitem2["Estimator_Mechanical"] = this.mechanical;
    listitem2["Status"] = this.status;
    listitem2["Tender_Received"] = this.tenderReceived;
    listitem2["Tender_Return"] = this.tenderReturn;
    listitem2["Sector"] = this.sector;
    listitem2["Design_Build"] = this.designBuild;
    listitem2["Build_Type"] = this.buildType;
    listitem2["Service_Prog_Start"] = this.serviceProgramStart;
    listitem2["Service_Prog_Completion"] = this.serviceProgramCompletion;
    listitem2["Client_1"] = this.client1;
    listitem2["Client_2"] = this.client2;
    listitem2["Client_3"] = this.client3;
    listitem2["Client_4"] = this.client4;
    listitem2["Consultant"] = this.consultant;
    listitem2["Pre-construction_Prog_Start"] = this.preConstructionProgramStart;
    listitem2["Pre-construction_Prog_End"] = this.preConstructionProgramEnd;
    listitem2["Tender_Summary_Url"] = "https://my site url/TenderSummaryLib/Forms/DispForm.aspx?ID=" + listitem2.ID;
    listitem2.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 6.");
    /// <summary>
    /// Creates the folders.
    /// </summary>
    /// <param name="web">The web.</param>
    private void CreateFolders(SPWeb web)
    var projectListId = web.Lists.Add(this.projectName.Replace(' ', '_'), string.Empty, SPListTemplateType.DocumentLibrary);
    var projectList = web.Lists[projectListId];
    projectList.OnQuickLaunch = true; // The document library will appear in Quick Launch bar.
    CreateFolder(projectList, "1.Tender Documents");
    CreateFolder(projectList, "2. Electrical");
    CreateFolder(projectList, "3. Mechanical");
    CreateFolder(projectList, "4. Correspondance");
    CreateFolder(projectList, "5. Settlement Meeting Docs");
    CreateFolder(projectList, "6. Tender Return Docs");
    CreateFolder(projectList, "7. Tender Handover");
    projectList.Update();
    /// <summary>
    /// Initializes the specified list item.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="finalNum">The final number.</param>
    private void Initialize(SPListItem listItem, string finalNum)
    var contextId = string.Format("List:{0}, Id:{1}", listItem.ParentList.Title, listItem.ID);
    this.noBid = AssignField(listItem, "Bid", contextId);
    this.projectName = AssignField(listItem, "Project_Name", contextId);
    var teamlookup = AssignField(listItem, "Team", contextId);
    var lookupParts = teamlookup.Split(new[] { ";#" }, StringSplitOptions.None);
    this.team = lookupParts[1];
    this.description = AssignField(listItem, "Description", contextId);
    this.status = AssignField(listItem, "enquiry_status", contextId);
    this.electrical = AssignUserField(listItem, "electrical_proj_manager", contextId);
    this.mechanical = AssignUserField(listItem, "mechanical_proj_manager", contextId);
    this.docDate = AssignDateField(listItem, "Date", contextId);
    this.tenderReceived = AssignDateField(listItem, "Tender_Received", contextId);
    this.tenderReturn = AssignDateField(listItem, "Tender_Return", contextId);
    this.preConstructionProgramStart = AssignDateField(listItem, "Pre-construction_Prog_Start", contextId);
    this.preConstructionProgramEnd = AssignDateField(listItem, "Pre-construction_Prog_End", contextId);
    this.sector = AssignField(listItem, "Sector", contextId);
    this.designBuild = AssignField(listItem, "Design_Build", contextId);
    this.buildType = AssignField(listItem, "Build_Type", contextId);
    this.serviceProgramStart = AssignDateField(listItem, "Service_Prog_Start", contextId);
    this.serviceProgramCompletion = AssignDateField(listItem, "Service_Prog_Completion", contextId);
    this.client1 = AssignField(listItem, "Client_1", contextId);
    this.client2 = AssignField(listItem, "Client_2", contextId);
    this.client3 = AssignField(listItem, "Client_3", contextId);
    this.client4 = AssignField(listItem, "Client_4", contextId);
    this.consultant = AssignField(listItem, "Consultant", contextId);
    if (this.status == "Won")
    this.projectNumber = string.Format("15-{0}-{1}", this.team, new Random().Next(0, 9999).ToString("D4"));
    if (this.status == "Active" || this.status == "Closed")
    this.projectNumber = "No Project No";
    listItem["ProjectNo"] = this.projectNumber;
    listItem["EnquiryNo"] = finalNum;
    listItem.Web.AllowUnsafeUpdates = true;
    listItem.SystemUpdate(false);

    Hi,
    In this forum we mainly discuss questions and feedbacks about Office client products, as your question is about SharePoint 2013, I suggest you post this thread in SharePoint forum:
    https://social.technet.microsoft.com/Forums/office/en-US/home?category=sharepoint
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Add Right Side Column and Web Parts to custom Master page in SharePoint Online

    Hello everyone, 
    I hope this is a simple question, however I was fighting the issue it presents for a while. I am in the process of customizing SharePoint Online Look-and-feel with a new layout.
    The site collection was created as a
    Team Site before I got involved with the project, and populated with numerous sub-sites and pages. I activated required
    publishing features, created html with corresponding styles and graphics, and used the Design Manager to convert the html file to the custom Master page. While SharePoint automatically assigned “ContentPlaceHolderMain” div area, I
    also used default Oslo page as example to copy sections of the code for dynamic components (left column and navigation, recent items, the ribbon, etc.) from it and placed them in my new master page, pointed all CSS references to
    my custom style sheets, etc. Everything works great, however I need to make one last addition -
    my task is to make changes to display web parts such as Calendar and Recent Documents in the right column in the Master page.
    My custom layout has a header, footer, main pan and two side columns. Most of the default master templates come with the LEFT column already embedded and populated with several placeholder
    to serve dynamic content (PlaceHolderLeftNavBarTop, PlaceHolderQuickLaunchTop, PlaceHolderLeftNavBarDataSource, PlaceHolderLeftActions, so on).
    My challenge is that I have the RIGHT side column as well, for which I don’t think the default placeholder exists. I need to add a small Calendar box and Recent Documents parts to it, so they
    display across the entire site governed by this master page.
    The issue is –
    even after activating Publishing features (enabled SharePoint Server Publishing Infrastructure under Site Collection Level, and SharePoint Server Publishing under the Site
    Level), there is no Snippet feature (usually available under the generic Publishing Site); this customization of the Team Site allows using Designer and apply custom templates, themes, so on, just like you would under the Publishing collection, but not the
    Snippet utility I could use as the solution to embed the web parts on the master page.
    Recreating the entire site under Publishing Collection is not an option due to the directions I was given, I am to use this existing one, and need to see if
    there is a workaround to either activate the Snippet feature or use another solution to display the web parts inside of the column in the Master page.
    If the only solution is to use Web Part Zone, what are the steps to add it AND populate it with the abovementioned apps?
    Can anyone suggest how to create a workaround and add this feature? The environment is role-based so both elements need to be dynamically rendered based on the user’s role and activities.
    I am more of a front end designer than developer, so if any custom coding and set up required, please kindly provide some basic steps, if possible?..
    I greatly appreciate any help and suggestions!
    Thank You!
    Jeff
    Jeff V.

    Updating your Master Page to also include a right rail should be sraight forward enough with a new div or divs in your master page and then the proper styles to make room for this column as well as position the column.
    I have not seen why you cannot find the snippet gallery link when previewing a HTML Master Page in the browser. Have you tried loading the snippet gallery by its url? As an example, for my tenant on SPO, I can load the Snippet Gallery for the olso.master
    with the following url:
    https://pixelmill.sharepoint.com/_layouts/15/ComponentConfigureControls.aspx?ComponentName=TopNavigationNoFlyoutWithStartNode&Url=%2F_catalogs%2Fmasterpage%2Foslo.master
    Change the domain to match yours as well as update the "Url" querystring var to point to your master page. See if that loads the snippet gallery.
    Eric Overfield - PixelMill -
    ericoverfield.com -
    @EricOverfield

  • VBA to pull from Financial Reporting Studio/Reporting and Analysis Framework

    Hi all,
    I just started using Financial Reporting Studio, and I did a lot of research online to try to answer the questions I have below but to no avail, so I'm hoping I can get answers from the experts here.
    1. I was wondering if it's possible to use SmartView VBA to pull a report from the "Reporting and Analysis Framework" onto Excel? If yes, how?
    2. When I tried to pull lots of data from "Reporting and Analysis Framework" onto Excel using SmartView, it keeps getting the error message "New report failed to insert properly". Is there a way around this? Essentially, what I'm trying to do is pull the Expense data (Actuals, Budget, Forecast) from year 2011 to 2015 (by month) for every department (with each department being on its own worksheet using the split feature). If I reduce the number of departments or columns, it'll work, but when I try to keep everything, it fails.
    Thanks for your guys' help!

    Hi there,
    There is VBA manual for smartiview application however I am not sure that you will be able to automate the retrieve of a report.
    Check chapter 19 of http://docs.oracle.com/cd/E12825_01/epm.111/sv_user.pdf
    Regards,
    Thanos

  • JavaScript error under Sp.ribbon.js on SharePoint Online

    Hi everyone,
    I'm trying to add a custom button on my ribbon for easier approval process, I use JavaScript to do this in a Script Editor web part on a task list view. The script works fine but when he tries to access the ribbon to actually add the button the ribbon crashes
    so I don't even have the usual ribbon.
    I used the IE JavaScript editor and I have an error on the sp.ribbon.js the "funny" part is that I only use that library I made no modification (also because I'm using SharePoint Online so I don't have access to it).
    there is the error that I get with IE:
    and there is the code I use to add the ribbon:
    $this.ExecuteOrDelayUntilScriptLoaded(init_addButton, "sp.ribbon.js");
    function init_addButton(){
    setTimeout(function(){
    var defaultWP = document.getElementById("MSOZoneCell_WebPartWPQ1");
    WpClick({target:defaultWP,srcElement:defaultWP});
    },100);
    setInterval(function(){
    if($("#RibbonContainer_activeTabId").val()==="Ribbon.ITEMS" || $("#RibbonContainer_activeTabId").val()==="Ribbon.ListItem"){
    addRibbomButton();
    },1000);
    alert("test");
    function addRibbomButton(){
    if($("#ribbonApproveAll").length===0){
    var b = [];
    b.push("<li id='ribbonApproveAll' class=ms-cui-group unselectable='on'>");
    b.push("<SPAN class='ms-cui-groupContainer' unselectable='on'>");
    b.push("<SPAN class='ms-cui-groupBody' unselectable='on'>");
    b.push("<SPAN class='ms-cui-layout' unselectable='on'>");
    b.push("<SPAN class=ms-cui-section unselectable='on'>");
    b.push("<SPAN class=ms-cui-row-onerow unselectable='on'>");
    b.push("<A id='approveAllButton' class='ms-cui-ctl-large ms-cui-disabled' role=button onclick='approveSelected();return false;' href='javascript:;' unselectable='on' mscui:controltype='Button'>");
    b.push("<SPAN class='ms-cui-ctl-largeIconContainer' unselectable='on'>");
    b.push("<SPAN class=' ms-cui-img-32by32 ms-cui-img-cont-float' unselectable='on'>");
    b.push("<IMG style='TOP: -129px; LEFT: -255px' alt='' src='/_layouts/1033/images/formatmap32x32.png' unselectable='on'>");
    b.push("</SPAN>");
    b.push("</SPAN>");
    b.push("<SPAN class=ms-cui-ctl-largelabel unselectable='on'>"+tabBtn.btnLabel+"</SPAN>");
    b.push("</A>");
    b.push("</SPAN>");
    b.push("</SPAN>");
    b.push("</SPAN>");
    b.push("</SPAN>");
    b.push("<SPAN class='ms-cui-groupTitle' title='"+tabBtn.groupLabel+"' unselectable='on'>"+tabBtn.groupLabel+"</SPAN>");
    b.push("</SPAN>");
    b.push("<SPAN class='ms-cui-groupSeparator' unselectable='on'></SPAN>");
    b.push("</li>");
    setTimeout(function(){
    if($("#Ribbon\\.ITEMS").length===1){
    $("#Ribbon\\.ITEMS").append(b.join(''));
    }else if($("#Ribbon\\.ListItem").length===1){
    $("#Ribbon\\.ListItem").append(b.join(''));
    },100);
    alert("test");
    alert("test 1");
    setTimeout(function(){
    var cc = new SP.ClientContext.get_current();
    var web = cc.get_web();
    var currLib = web.get_lists().getById(SP.ListOperation.Selection.getSelectedList());
    var selectedItems = SP.ListOperation.Selection.getSelectedItems();
    if(selectedItems.length>0){
    $("#approveAllButton").removeClass("ms-cui-disabled");
    }else{
    $("#approveAllButton").addClass("ms-cui-disabled");
    },200);
    I didn't write that code but the website where I found it had some review that says that it was working and I'm more a C# dev than a JavaScript so I'm not use to debug it. Is that a version problem an implementation problem and how to solve it ? 
    Thanks for your time :)

    Hi,
    I think this is not the right way of customising ribbon. SharePoint has a very powerful ribbon management XML framework. So instead of javascript hacking, I would recommend you to use the XML based ribbon customisation. Reference:
    http://msdn.microsoft.com/en-us/library/office/jj163954(v=office.15).aspx.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Access 2010 Linked to Sharepoint online - avoid direct access to sharepoint stored data

    Hello,
    I have an access 2010 application (front end)  connected to SharePoint online team site (as back end).
    I wish to allow my users to work with the front end but to avoid direct access to the data on SharePoint Online.
    The user will open the access application and it will auto connect & work with SharePoint online.
    How can I implement this?
    Thank you for your help

    Hi,
    According to your description, my understanding is that you want to use Access 2010 to connect the SharePoint Online data.
    In Access 2010, you can connect the SharePoint list as a external datasource like the capture below. It will need to input url and user credentials to access SharePoint site in the wizard. If you want to connect automatically, you will need write some custom
    Micro code to achieve it.
    If you have some question about Micro code to connect SharePoint list automatically, I suggest you can create a new thread in Access Development, you will get more detailed information from there.
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=accessdev
    Thanks
    Best Regards
    Jerry Guo
    TechNet Community Support

  • Single Sign On and SharePoint Online. Why so much re-authentication?

    We are migrating to SharePoint Online 2013. Much of the organization is already on o365 for Exchange and Linq.
    Most clients are Windows 7 using IE 11.
    From what I understand there is an AD to ADFS sync and a custom SSO login page that accepts our enterprise user and passwords.
    Looking at this, a few dumb questions:
    http://technet.microsoft.com/en-us/library/hh852486.aspx
    In our organization, authenticating into our desktops and network does not automatically authenticate us into o365, Exchange, Linq or SharePoint Online.   Furthermore, Authetnicating into Exchange and Linq, does not automatically authenticate me
    into SharePoint Online.  I can create a map to SharePoint Document library while HTTP authenticated into SPO, but if reboot and log into our network and then Exchange/Linq and attempt to access that map the SPO library I get an error.  If I then
    authenticate into SPO, the map works again.
    These are all MS products and technologies.  Are these gaps in SSO normal and expected or are these limitation in our organization?
    What would it take to seamlessly have access to SPO resources automatically after authenticating into our AD network?
    Any chance MS SSO can work like a ChromeBook login, where all Google resource are automatically available without prompt for authentication?

    The problem is that the cookie/token for SPO expires. You need to periodically login there to renew it. Using a smart link to authenticate directly to SPO and get a persistent cookie will help:
    http://samhandle.no/2014/06/24/sharepoint-online-with-webdav-and-sso/
    You will still have to open SPO even with the above setup, but a lot less frequently. If you keep running into issues with mapped drives, refer to this article:
    http://support.microsoft.com/kb/2616712

  • ADFS SSO and SharePoint 2013 on-premise Hybrid outbound search results from SharePoint Online - does it work?

    Hi, 
    I want to setup an outpund hybrid search for SharePoint 2013 on-premise to SharePoint Online.
    But I'm not shure if this works with ADFS SSO.
    Has somebody experience with this setup?
    Here's my guide which I'm going to use for this installation:
    Introduction
    In this post I'll show you how to get search results from your SharePoint Online in your SharePoint 2013 on-premise search center.
    Requirements
    User synchronisation ActiveDirectory to Office 365 with DirSync
    DirSync password sync or ADFS SSO
    SharePoint Online
    SharePoint 2013 on-premise
    Enterprise Search service
    SharePoint Online Management Shell
    Instructions
    All configuration will be done either in the Search Administration of the Central Administration or in the PowerShell console of your on-premise SharePoint 2013 server.
    Set up Sever to Server Trust
    Export certificates
    To create a server to server trust we need two certificates.
    [certificate name].pfx: In order to replace the STS certificate, the certificate is needed in Personal Information Exchange (PFX) format including the private key.
    [certificate name].cer: In order to set up a trust with Office 365 and Windows Azure ACS, the certificate is needed in CER Base64 format.
    First launch the Internet Information Services (IIS) Manager
    Select your SharePoint web server and double-click Server Certificates
    In the Actions pane, click Create Self-Signed Certificate
    Enter a name for the certificate and save it with OK
    To export the new certificate in the Pfx format select it and click Export in the Actions pane
    Fill the fields and click OK Export to: C:\[certificate
    name].pfx Password: [password]
    Also we need to export the certificate in the CER Base64 format. For that purpose make a right-click on the certificate select it and click on View...
    Click the Details tab and then click Copy to File
    On the Welcome to the Certificate Export Wizard page, click Next
    On the Export Private Key page, click Next
    On the Export File Format page, click Base-64 encoded X.509 (.CER), and then click Next.
    As file name enter C:\[certificate
    name].cer and then click Next
    Finish the export
    Import the new STS (SharePoint Token Service) certificate
    Let's update the certificate on the STS. Configure and run the PowerShell script below on your SharePoint server.
    if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
    # set the cerficates paths and password
    $PfxCertPath = "c:\[certificate name].pfx"
    $PfxCertPassword = "[password]"
    $X64CertPath = "c:\[certificate name].cer"
    # get the encrypted pfx certificate object
    $PfxCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $PfxCertPath, $PfxCertPassword, 20
    # import it
    Set-SPSecurityTokenServiceConfig -ImportSigningCertificate $PfxCert
    Type Yes when prompted with the following message.
    You are about to change the signing certificate for the Security Token Service. Changing the certificate to an invalid, inaccessible or non-existent certificate will cause your SharePoint installation to stop functioning. Refer
    to the following article for instructions on how to change this certificate: http://go.microsoft.com/fwlink/?LinkID=178475. Are you
    sure, you want to continue?
    Restart IIS so STS picks up the new certificate.
    & iisreset
    & net stop SPTimerV4
    & net start SPTimerV4
    Now validate the certificate replacement by running several PowerShell commands and compare their outputs.
    # set the cerficates paths and password
    $PfxCertPath = "c:\[certificate name].pfx"
    $PfxCertPassword = "[password]"
    # get the encrypted pfx certificate object
    New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $PfxCertPath, $PfxCertPassword, 20
    # compare the output above with this output
    (Get-SPSecurityTokenServiceConfig).LocalLoginProvider.SigningCertificate
    [/code]
    ## Establish the server to server trust
    [code lang="ps"]
    if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
    Import-Module MSOnline
    Import-Module MSOnlineExtended
    # set the cerficates paths and password
    $PfxCertPath = "c:\[certificate name].pfx"
    $PfxCertPassword = "[password]"
    $X64CertPath = "c:\[certificate name].cer"
    # set the onpremise domain that you added to Office 365
    $SPCN = "sharepoint.domain.com"
    # your onpremise SharePoint site url
    $SPSite="http://sharepoint"
    # don't change this value
    $SPOAppID="00000003-0000-0ff1-ce00-000000000000"
    # get the encrypted pfx certificate object
    $PfxCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $PfxCertPath, $PfxCertPassword, 20
    # get the raw data
    $PfxCertBin = $PfxCert.GetRawCertData()
    # create a new certificate object
    $X64Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
    # import the base 64 encoded certificate
    $X64Cert.Import($X64CertPath)
    # get the raw data
    $X64CertBin = $X64Cert.GetRawCertData()
    # save base 64 string in variable
    $CredValue = [System.Convert]::ToBase64String($X64CertBin)
    # connect to office 3656
    Connect-MsolService
    # register the on-premise STS as service principal in Office 365
    # add a new service principal
    New-MsolServicePrincipalCredential -AppPrincipalId $SPOAppID -Type asymmetric -Usage Verify -Value $CredValue
    $MsolServicePrincipal = Get-MsolServicePrincipal -AppPrincipalId $SPOAppID
    $SPServicePrincipalNames = $MsolServicePrincipal.ServicePrincipalNames
    $SPServicePrincipalNames.Add("$SPOAppID/$SPCN")
    Set-MsolServicePrincipal -AppPrincipalId $SPOAppID -ServicePrincipalNames $SPServicePrincipalNames
    # get the online name identifier
    $MsolCompanyInformationID = (Get-MsolCompanyInformation).ObjectID
    $MsolServicePrincipalID = (Get-MsolServicePrincipal -ServicePrincipalName $SPOAppID).ObjectID
    $MsolNameIdentifier = "$MsolServicePrincipalID@$MsolCompanyInformationID"
    # establish the trust from on-premise with ACS (Azure Control Service)
    # add a new authenticatio realm
    $SPSite = Get-SPSite $SPSite
    $SPAppPrincipal = Register-SPAppPrincipal -site $SPSite.rootweb -nameIdentifier $MsolNameIdentifier -displayName "SharePoint Online"
    Set-SPAuthenticationRealm -realm $MsolServicePrincipalID
    # register the ACS application proxy and token issuer
    New-SPAzureAccessControlServiceApplicationProxy -Name "ACS" -MetadataServiceEndpointUri "https://accounts.accesscontrol.windows.net/metadata/json/1/" -DefaultProxyGroup
    New-SPTrustedSecurityTokenIssuer -MetadataEndpoint "https://accounts.accesscontrol.windows.net/metadata/json/1/" -IsTrustBroker -Name "ACS"
    Add a new result source
    To get search results from SharePoint Online we have to add a new result source. Run the following script in a PowerShell ISE session on your SharePoint 2013 on-premise server. Don't forget to update the settings region
    if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
    # region settings
    $RemoteSharePointUrl = "http://[example].sharepoint.com"
    $ResultSourceName = "SharePoint Online"
    $QueryTransform = "{searchTerms}"
    $Provier = "SharePoint-Remoteanbieter"
    # region settings end
    $SPEnterpriseSearchServiceApplication = Get-SPEnterpriseSearchServiceApplication
    $FederationManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($SPEnterpriseSearchServiceApplication)
    $SPEnterpriseSearchOwner = Get-SPEnterpriseSearchOwner -Level Ssa
    $ResultSource = $FederationManager.GetSourceByName($ResultSourceName, $SPEnterpriseSearchOwner)
    if(!$ResultSource){
    Write-Host "Result source does not exist. Creating..."
    $ResultSource = $FederationManager.CreateSource($SPEnterpriseSearchOwner)
    $ResultSource.Name = $ResultSourceName
    $ResultSource.ProviderId = $FederationManager.ListProviders()[$Provier].Id
    $ResultSource.ConnectionUrlTemplate = $RemoteSharePointUrl
    $ResultSource.CreateQueryTransform($QueryTransform)
    $ResultSource.Commit()
    Add a new query rule
    In the Search Administration click on Query Rules
    Select Local SharePoint as Result Source
    Click New Query Rule
    Enter a Rule name f.g. Search results from SharePoint Online
    Expand the Context section
    Under Query is performed on these sources click on Add Source
    Select your SharePoint Online result source
    In the Query Conditions section click on Remove Condition
    In the Actions section click on Add Result Block
    As title enter Results for "{subjectTerms}" from SharePoint Online
    In the Search this Source dropdown select your SharePoint Online result source
    Select 3 in the Items dropdown
    Expand the Settings section and select "More" link goes to the following URL
    In the box below enter this Url https://[example].sharepoint.com/search/pages/results.aspx?k={subjectTerms}
    Select This block is always shown above core results and click the OK button
    Save the new query rule

    Hi  Janik,
    According to your description, my understanding is that you want to display hybrid search results in SharePoint Server 2013.
    For achieving your demand, please have a look at the article:
    http://technet.microsoft.com/en-us/library/dn197173(v=office.15).aspx
    If you are using single sign-on (SSO) authentication, it is important to test hybrid Search functionality by using federated user accounts. Native Office 365 user accounts and Active Directory Domain Services
    (AD DS) accounts that are not federated are not recognized by both directory services. Therefore, they cannot authenticate using SSO, and cannot be granted permissions to resources in both deployments. For more information, see Accounts
    needed for hybrid configuration and testing.
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Follow-up question about forms and SharePoint Online

    I asked a question about life after InfoPath earlier, and got a good answer:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/fb23b3d9-8a09-4267-aab5-09929f6a3082/life-after-infopath-seeking-advice
    After looking at all of the limitations of SharePoint Online, I'm wondering how developers are dealing with the limitations. Lets say you are asked to develop something that has complex logic, including fetching data from external web services, dynamically
    displaying parts of a process to people depending on role, and ending up with a printable document. In our on-premises environment, InfoPath is well suited to this task, with some code behind for some things. Or, if not using InfoPath, we would use application
    pages and workflow.
    Neither of those are available in SharePoint Online, so what would you do?

    Some things, such as the conditional display of content, can be done via JavaScript. More advanced items, such as integrating external web services would likely require a SharePoint "app". A SharePoint app is essentially a link to a separate site
    that is running an asp.net web app (or PHP, or whatever). This asp.net site can do anything it needs with any web services, or conditional formatting, or anything. Because it's registered as a SharePoint app, it can also call back into the SharePoint site
    and work with data. So, a SharePoint App could present the user with a robust form that simply sends the data back to a SharePoint list. The SharePoint app can also be surfaced on the SharePoint site itself in an iframe, so the user won't know that the form
    is hosted by another server.
    By the way, the ideas behind the app model permeate the entire SharePoint environment: instead of having the SharePoint server itself run all kinds of custom business logic, that workload is handled by other servers, so the SharePoint servers can be focused
    on running the core bits of SharePoint. InfoPath puts a large load on the servers, so it's out.  XSLT list views also put a load on the server, so they're also out. SSRS is an amazingly fantastic tool, but is not supported in the cloud (and there's no
    alternative). Timer jobs, event handlers, workflow, and many other things have been re-architected to take the load off the SharePoint servers.
    Mike G.

  • Unable to run code analysis with WDK 9926

    Hi,
    I am trying to run code analysis with WDK 9926 and seeing below issue? can anybody help me to resolve this ?
    Error:
    ====
    C:\sw\dev\T4\windows\Src\kernel\vbd>msbuild.exe cht4vbd.vcxproj /p:Configuration="Windows 8.1 Debug" /P:Platform=x64 /P:RunCodeAnalysisOnce=True
    Microsoft (R) Build Engine version 12.0.21005.1
    [Microsoft .NET Framework, version 4.0.30319.33440]
    Copyright (C) Microsoft Corporation. All rights reserved.
    Build started 4/7/2015 12:08:30 AM.
    Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" on node 1 (defaul
    t targets).
    DriverBuildNotifications:
      Building 'cht4vbd' with toolset 'WindowsKernelModeDriver10.0' and the 'Deskto
      p' target platform.
      Using KMDF 1.11.
    PrepareForBuild:
      Creating directory "x64\Windows8.1Debug\".
      Creating directory "C:\sw\dev\T4\windows\Src\kernel\vbd\x64\Windows8.1Debug\c
      hk\x64\".
      Creating directory "x64\Windows8.1Debug\cht4vbd.tlog\".
    InitializeBuildStatus:
      Creating "x64\Windows8.1Debug\cht4vbd.tlog\unsuccessfulbuild" because "Always
      Create" was specified.
    StampInf:
      c:\Program Files (x86)\Windows Kits\10\bin\x86\stampinf.exe -d "*" -a "amd64"
       -k "1.11" -f x64\Windows8.1Debug\chvbdx64.inf
      Copying "C:\sw\dev\T4\windows\Src\kernel\vbd\chvbdx64.inf" to "x64\Windows8.1
      Debug\chvbdx64.inf" for stamping
      Using version information from c:\Program Files (x86)\Windows Kits\10\Include
      \shared\\ntverp.h
      Could not open version header file c:\Program Files (x86)\Windows Kits\10\Inc
      lude\shared\\bldnump.h. (0x00000002)
      Could not determine version information.  Please specify using -v option.
      Updates common INF file directives
            USAGE:
            stampinf -f filename [-s section] [-d <xx/yy/zzzz> | *]
                     -a architecture -n [-c catalogfile]
                                 [-v <w.x.y.z> | *]
                                 [-k nnnnn] [-u nnnnn]
                                 [-i path]
            -f  specifies the INF file to process
            -s  specifies the INF section to place the DriverVer= directive.  By
                default this directive is placed in the [Version] section.
            -d  specifies the date written in the DriverVer= directive.  Note that
                a '*' given for a date value means for stampinf to write the
                current date. If the date is not specified, the date is taken
                from the STAMPINF_DATE environment variable.
            -v  specifies the version written in the DriverVer= directive. Note
                that a '*' given for a version value means for stampinf to write
                the current time (h.m.s.ms).  This is useful during development
                in order to get increasing version numbers. If the version is not
                specified, its value is taken from the STAMPINF_VERSION
                environment variable.
            -a  specifies the architecture string to replace the $ARCH$ keyword.
                The $ARCH$ keyword is used to tailor a TargetOSVersion decoration
                in a [Manufacturer] section, as well as its respective section
                name, to a specific platform. If no value is specified, stampinf
                takes its value from the _BuildArch environment variable.
            -c  specifies the value to be written in the CatalogFile= directive
                in the [Version] section. By default, this directive is not
                written.
            -k  specifies the version of KMDF that this driver depends on.  This
                is used to tailor the KmdfLibraryVersion & KMDF co-installer name
                in the INF. This will replace the $KMDFVERSION$ and
                $KMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>
                As an example, supplying 1.5 as the version string will result in
                values of 1.5 and 01005 for the two keywords (respectively).
            -u  specifies the version of UMDF that this driver depends on.  This
                is used to tailor the UmdfLibraryVersion & UMDF co-installer name
                in the INF. This will replace the $UMDFVERSION$ and
                $UMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>.<service_version>
                (where service_version is generally zero)
                As an example, supplying 1.5.0 as the version string will result
                in values of 1.5.0 and 01005 for the two keywords (respectively).
            -i  specifies the location of ntverp.h file.
                path represent the fully qualified
                location of the directory containing ntverp.h.
            -n  noisy mode shows verbose stampinf output
              -x  removes the coinstaller tag from the file and replaces the line w
      ith a ";"
            NOTES:
            The environment variable PRIVATE_DRIVER_PACKAGE can be set to
            enable stampinf's 'developer mode' behavior. When this is
            set, the date and version used for DriverVer is set to the
            current date and time, regardless of the command line
            settings. Also, 'CatalogFile=delta.cat' is written to the
            version section, unless a catalog was already specified
            with '-c'.
    c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355,5
    ): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Src\
    kernel\vbd\cht4vbd.vcxproj]
    Done Building Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (de
    fault targets) -- FAILED.
    Build FAILED.
    "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (default target) (1) ->
    (StampInf target) ->
      c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355
    ,5): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Sr
    c\kernel\vbd\cht4vbd.vcxproj]
        0 Warning(s)
        1 Error(s)
    Time Elapsed 00:00:04.07
    Thanks, Krishna

    Hi,
    I am trying to run code analysis with WDK 9926 and seeing below issue? can anybody help me to resolve this ?
    Error:
    ====
    C:\sw\dev\T4\windows\Src\kernel\vbd>msbuild.exe cht4vbd.vcxproj /p:Configuration="Windows 8.1 Debug" /P:Platform=x64 /P:RunCodeAnalysisOnce=True
    Microsoft (R) Build Engine version 12.0.21005.1
    [Microsoft .NET Framework, version 4.0.30319.33440]
    Copyright (C) Microsoft Corporation. All rights reserved.
    Build started 4/7/2015 12:08:30 AM.
    Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" on node 1 (defaul
    t targets).
    DriverBuildNotifications:
      Building 'cht4vbd' with toolset 'WindowsKernelModeDriver10.0' and the 'Deskto
      p' target platform.
      Using KMDF 1.11.
    PrepareForBuild:
      Creating directory "x64\Windows8.1Debug\".
      Creating directory "C:\sw\dev\T4\windows\Src\kernel\vbd\x64\Windows8.1Debug\c
      hk\x64\".
      Creating directory "x64\Windows8.1Debug\cht4vbd.tlog\".
    InitializeBuildStatus:
      Creating "x64\Windows8.1Debug\cht4vbd.tlog\unsuccessfulbuild" because "Always
      Create" was specified.
    StampInf:
      c:\Program Files (x86)\Windows Kits\10\bin\x86\stampinf.exe -d "*" -a "amd64"
       -k "1.11" -f x64\Windows8.1Debug\chvbdx64.inf
      Copying "C:\sw\dev\T4\windows\Src\kernel\vbd\chvbdx64.inf" to "x64\Windows8.1
      Debug\chvbdx64.inf" for stamping
      Using version information from c:\Program Files (x86)\Windows Kits\10\Include
      \shared\\ntverp.h
      Could not open version header file c:\Program Files (x86)\Windows Kits\10\Inc
      lude\shared\\bldnump.h. (0x00000002)
      Could not determine version information.  Please specify using -v option.
      Updates common INF file directives
            USAGE:
            stampinf -f filename [-s section] [-d <xx/yy/zzzz> | *]
                     -a architecture -n [-c catalogfile]
                                 [-v <w.x.y.z> | *]
                                 [-k nnnnn] [-u nnnnn]
                                 [-i path]
            -f  specifies the INF file to process
            -s  specifies the INF section to place the DriverVer= directive.  By
                default this directive is placed in the [Version] section.
            -d  specifies the date written in the DriverVer= directive.  Note that
                a '*' given for a date value means for stampinf to write the
                current date. If the date is not specified, the date is taken
                from the STAMPINF_DATE environment variable.
            -v  specifies the version written in the DriverVer= directive. Note
                that a '*' given for a version value means for stampinf to write
                the current time (h.m.s.ms).  This is useful during development
                in order to get increasing version numbers. If the version is not
                specified, its value is taken from the STAMPINF_VERSION
                environment variable.
            -a  specifies the architecture string to replace the $ARCH$ keyword.
                The $ARCH$ keyword is used to tailor a TargetOSVersion decoration
                in a [Manufacturer] section, as well as its respective section
                name, to a specific platform. If no value is specified, stampinf
                takes its value from the _BuildArch environment variable.
            -c  specifies the value to be written in the CatalogFile= directive
                in the [Version] section. By default, this directive is not
                written.
            -k  specifies the version of KMDF that this driver depends on.  This
                is used to tailor the KmdfLibraryVersion & KMDF co-installer name
                in the INF. This will replace the $KMDFVERSION$ and
                $KMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>
                As an example, supplying 1.5 as the version string will result in
                values of 1.5 and 01005 for the two keywords (respectively).
            -u  specifies the version of UMDF that this driver depends on.  This
                is used to tailor the UmdfLibraryVersion & UMDF co-installer name
                in the INF. This will replace the $UMDFVERSION$ and
                $UMDFCOINSTALLERVERSION$ keywords in the INF.  The string is of
                the format:
                    <major_version>.<minor_version>.<service_version>
                (where service_version is generally zero)
                As an example, supplying 1.5.0 as the version string will result
                in values of 1.5.0 and 01005 for the two keywords (respectively).
            -i  specifies the location of ntverp.h file.
                path represent the fully qualified
                location of the directory containing ntverp.h.
            -n  noisy mode shows verbose stampinf output
              -x  removes the coinstaller tag from the file and replaces the line w
      ith a ";"
            NOTES:
            The environment variable PRIVATE_DRIVER_PACKAGE can be set to
            enable stampinf's 'developer mode' behavior. When this is
            set, the date and version used for DriverVer is set to the
            current date and time, regardless of the command line
            settings. Also, 'CatalogFile=delta.cat' is written to the
            version section, unless a catalog was already specified
            with '-c'.
    c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355,5
    ): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Src\
    kernel\vbd\cht4vbd.vcxproj]
    Done Building Project "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (de
    fault targets) -- FAILED.
    Build FAILED.
    "C:\sw\dev\T4\windows\Src\kernel\vbd\cht4vbd.vcxproj" (default target) (1) ->
    (StampInf target) ->
      c:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(355
    ,5): error MSB6006: "stampinf.exe" exited with code 1. [C:\sw\dev\T4\windows\Sr
    c\kernel\vbd\cht4vbd.vcxproj]
        0 Warning(s)
        1 Error(s)
    Time Elapsed 00:00:04.07
    Thanks, Krishna

Maybe you are looking for

  • My Mac Mini keeps shutting itself down; why?

    Hello, When I woke up this morning, I went to use my new Mac Mini. For some reason, it will appear on the monitor for about five seconds, and then nothing will show on the monitor at all. Attempting to restart the Mac Mini only finds it doing the sam

  • Unable to find BP properties

    Hi i am trying to create Business Patrner using DIAPI. How can i set the following properties? Field                   Tab Alias Name              General Unified Federal Tax ID  General Holidays                Payment Terms Title                   C

  • HT1688 My itunes radio dissappeard!? Can anyone help?

    I have the last beta that apple released, before they released official ios7. This morning I was going to listen to iTunes Radio but, it just disappeared from my screen! What happened??

  • Print Photo from wireless

    When I print a photo wirelessly from the test it prints correctly.  However, when I choose to print a photo outside of the setup it prints on paper instead of the photo paper.  I check 4 x 6 print on HP Premium Paper. What am I doing wrong?

  • Why no indication of flag status in 'edit' mode?

    In 'edit' mode, I can flag photos, either via the menu or command-period. How come I can't tell if a current photo is flagged? No indicator anywhere, except to watch the 'flagged <n>' indicator in 'recent' and hit the key combo a few times to see if