Managing Query Suggestions through CSOM (C#) or PowerShell for Sharepoint Online.

Hello everybody.
I am currently working with Sharepoint Online search and am trying to find information about managing Query suggestions (CRUD operations).
Would anybody have any information as to how I could do this in CSOM or PowerShell ? I truely am having a hard time on this.

Hi,
Please check below. This should help you. You can REST APIs
Retrieving query suggestions using the Search REST service
https://msdn.microsoft.com/en-us/library/office/dn194079.aspx
Please remember to click 'Mark as Answer' on the answer if it helps you

Similar Messages

  • How to make intellisense enable in powershell in CSOM for sharepoint online?

    how to make intellisense enable in powershell in CSOM for sharepoint online?
    I am loading assembly  as following
    [Reflection.Assembly]::LoadFrom("$scriptdir\Microsoft.SharePoint.Client.dll")        
     [Reflection.Assembly]::LoadFrom("$scriptdir\Microsoft.SharePoint.Client.Runtime.dll")

    Hi,
    try this
    http://powerguivsx.codeplex.com/
    http://mackenzie-sharepoint.blogspot.com/2011/12/sharepoint-2010-powershell-intellisense.html
    https://technet.microsoft.com/en-us/library/ff461033.aspx
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/fcb85984-abf9-428a-a2a7-952cec37ea49/powershell-ise-intellisense
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

  • How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    Hi,
    According to your description, my understanding is that you want to set security group as admin of primary and secondary site collection using PowerShell command in office 365.
    I suggest you can use the command below to set the group to site owner, then it will have the site collection admin permission.
    Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -Owner [email protected] -NoWait
    Here are some detailed articles for your reference:
    https://technet.microsoft.com/en-us/library/fp161394(v=office.15)
    http://blogs.realdolmen.com/experts/2013/08/16/managing-sharepoint-online-with-powershell/
    Thanks
    Best Regards
    Jerry Guo
    TechNet Community Support

  • The underlying connection was closed: An unexpected error occurred on a receive..Exception.Message - while executing powershell command for sharepoint online site

    " +The underlying connection was closed: An unexpected error occurred on a receive..Exception.Message " OR sometimes
    "The remote server returned an error: (503) Server Unavailable..Exception.Message"
    Getting exception above when performing various operation (site coll creating, group creation, adding users to group) for sharepoint online (Office 365) site using powershell script.
    I want to create 3500 site collections using PS script. In-between getting above exception so it will skip one site collection creating and working again. for eg. after creating 11 site coll, script will through above exception and so 12th site coll will
    not be create but working fine from 13 and so on...

    Remote server seems working to me...any additional check?
    if problem with remote server then may be loop to create site provisioning should not start again..Right?
    any idea?

  • Not able to set security group without mail enabled as site collection admin using powershell in sharepoint online site - office 365

    not able to set security group without mail enabled as site collection admin using powershell in sharepoint online site - office 365?
    Any idea?

    after few days test in my lab, I can see that only email enabled group can be added as site collection admin using POWERSHELL.
    hope this helps who stuck like me!! :-)

  • Add a list and column to about 200 sites using powershell in SharePoint online

    
    I have a sitecollection with about 200 identical sites. However I need to add a new list to each site and a lookup column (referring to this list) to two other lists. I'm not a developer so I struggle a bit. I found this as a starting point:
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | Out-Null
    $WebUrl = 'https://yourtenant.sharepoint.com/sites/somesite'
    $EmailAddress = "[email protected]"
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($WebUrl)
    $Credentials = Get-Credential -UserName $EmailAddress -Message "Please enter your Office 365 Password"
    $Context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($EmailAddress,$Credentials.Password)
    $List = $Context.Web.Lists.GetByTitle("YourList")
    $FieldXml = "<Field Type='Text' DisplayName='New_Field_Display_Name' />"
    $Option=[Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefaultView
    $List.Fields.AddFieldAsXml($fieldxml,$true,$option)
    $Context.Load($list)
    $Context.ExecuteQuery()
    $Context.Dispose()
    Can someone help me out or is there a better solution?
    Thanks.
    

    Hi,
    According to your post, my understanding is that you wanted to add a list and a lookup column in about 200 identical sites.
    Per my knowledge, there is no out of the box way to achieve it in SharePoint Server, however, I’m not sure whether it is in SharePoint online.
    As this is the forum for SharePoint Server, you can post your question in the forum for SharePoint online.
    http://community.office365.com/en-us/forums/154.aspx.
    However, as you had known, we can achieve it programmatically.
    Besides the PowerShell command, we can also use the Client Object Model to achieve your scenario.
    If all the 200 sites in one site collection, we can first retrieve all the sites in the site collection, then add the list in every site.
    To retrieve all the sites in a site collection, you can refer to the following code snippets.
    static string mainpath = "SiteURL";
    static void Main(string[] args)
    getSubWebs(mainpath);
    Console.Read();
    public static void getSubWebs(string path)
    try
    ClientContext clientContext = new ClientContext( path );
    Web oWebsite = clientContext.Web;
    clientContext.Load(oWebsite, website => website.Webs, website => website.Title);
    clientContext.ExecuteQuery();
    foreach (Web orWebsite in oWebsite.Webs)
    string newpath = mainpath + orWebsite.ServerRelativeUrl;
    getSubWebs(newpath);
    Console.WriteLine(newpath + "\n" + orWebsite.Title );
    catch (Exception ex)
    http://chennaisharepointtraining.blogspot.in/2011/11/get-all-subwebs-using-client-object.html
    To create a list, you can have a look at the following article.
    http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Jason Guo
    TechNet Community Support

  • How to install app using powershell in sharepoint online - office 365?

    How to install app using powershell in sharepoint online - office 365?

    Hi
    check this similar post
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/1f0cd45a-00e1-4452-bafe-83c6ee3a59db/can-i-deploy-a-sharepointapp-to-office-365-using-powershell?forum=appsforsharepoint
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Any way to get all users's user profile proeprty using CSOM c# for sharepoint online - office 365?

    Any way to get all users's user profile proeprty using CSOM c# for sharepoint online - office 365?

    Since CSOM provides methods for operations related to people per
    user scope, you could retrieve all site users first using SP.Web.siteUsers
    property. and then use SP.UserProfiles.PeopleManager.getUserProfilePropertyFor
    Method to get property.
    [custom.development]

  • Powershell Error for SharePoint Online -"The remote server returned an error: (407) Proxy Authentication Required."

    I am trying to call sharepoint online from powershell. Below is the code. I get 
    Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (407) Proxy Authentication Required."
    $loadInfo1 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
    $loadInfo2 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
    $webUrl = "ZZZZ"
    $username = "XXX"
    $password = "YYYY"
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl) 
    $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
    $web = $ctx.Web
    $lists = $web.Lists 
    $ctx.Load($lists)
    $ctx.ExecuteQuery()
    $lists| select -Property Title
    Raj-Shpt

    Hi,
    About how to access SharePoint online site using PowerShell, the blog below would be helpful:
    http://social.technet.microsoft.com/wiki/contents/articles/29518.csom-sharepoint-powershell-reference-and-example-codes.aspx
    Another two demos for your reference:
    http://www.hartsteve.com/2013/06/sharepoint-online-powershell/
    http://www.sharepointnutsandbolts.com/2013/12/Using-CSOM-in-PowerShell-scripts-with-Office365.html
    Thanks
    TechNet Community Support
    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]

  • Get user manager in workflow SharePoint Designer 2013 for SharePoint online list item

    Hello,
    I would like to create a workflow in SharePoint Designer 2013 for a list in a site on SharePoint online and one of the action would be to send an e-mail to the manager of the user that created an item in a list.
    How can I get the manager of the user and then use it to send an e-mail?
    Thanks!

    In SP Designer there's the following action that I use.
    Find Manager for this user (then output to variable:manager) Action
    This is for SPD 2010 not sure if it's still available in SPD 2013
    Thanks,
    KP
    KP

  • Cannot see managed properties values in search result webpart- Sharepoint online

    Hi,
    Cannot see custom managed properties at site collection level in ResultScriptWebPart for SharePoint online. where as it is visible when i create managed properties @SSA (Search Service Application) level.
    Below are the steps which I followed:
    1) I have added few custom managed properties at Search Site collection level in SharePoint online.
    2) Mapped those properties to user profile crawled properties
    3) We are using those custom managed properties in ResultScriptWebPart(People Search Core Results) by using ItemTemplate
    I cannot see those managed properties in search result.When I debug it in browser it comes as null.
    But when I add these managed properties @SSA (Search Service Application) level I can see the value in search result webpart.
      What is the reason value doesn't get populated  at Site Collection level?
    Thanks,
    Prashant A

    Hi Prashant,
    Based on your description, the site collection managed property cannot work in SharePoint Online.
    For troubleshooting this issue, I recommend to verify the things below:
    Please make sure that the full crawl has been run after creating the managed property.
    Please check if the managed property is set to be searchable.
    Please search with this managed property to see if the results can be returned.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Retrieving files from Sharepoint Online based on time stamp using SharePoint Online Management Shell

    Hello,
    I would like to create a Powershell script to download files based on timestamp (all files updated on a given date or later). I would really appreciate any guidance on which cmdlets/objects I should look at to accomplish this.  I am new to Sharepoint
    online and Powershell, though not to programming or scripting.
    Thank you for your help!

    Hi,
    You should start by reading this article : Windows PowerShell for SharePoint Online.
    Then have a look at the Windows PowerShell for SharePoint Command Builder, and select "SharePoint Online"
    in the dropdown list.
    My technical blog on SharePoint ||
    My contributions on the TechNet Gallery

  • Managed property in a site collection (powershell - SharePoint online)

    Link to my site collection -> https://web.domain.com/sites/SC/_layouts/15/listmanagedproperties.aspx?level=sitecol
    when opening an url similar to this one and filter on a property name refinablestring00
    What I need is to is to add a mapping to do is to add a mapping
    Mappings to crawled properties
    With powershell.
    Assume that a full crawl has finished. That all crawled properties exist.
    I want to add "ows_GoPro_x0020_Code" and I also want to change the Alias to "ProjectNumber"
    What is the best way to do this via powershell for SharePoint 2013 online?
    Do I need to build a sandboxed solution for this?

    HI,i would recommend  run the PowerShell cmdlet to check if this website exists. Here are the detailed steps:
    1. Set up the SharePoint Online Management Shell Windows PowerShell environment
    http://technet.microsoft.com/en-us/library/fp161372.aspx
    2. Run the command Get-SPOSite, it will return all site collections.
    3. Check if the problematic public site collection is shown in the result. If it shows up, run another command to remove it. For example:
    Remove-SPOSite -Identity https://expertsharepoint/sites/site1 -NoWait
    This will remove the site collection named https://expertsharepoint/sites/site1 from the site collections list and moves it to the Recycle Bin.
    4. Delete the site from the Recycle Bin:
    Remove-SPODeletedSite -Identity https://expertsharepoint/sites/site1
    Anil Avula[MCP,MCSE,MCSA,MCTS,MCITP,MCSM] See Me At: http://expertsharepoint.blogspot.de/

  • PowerShell for Office 365 is here – here's how to use it

    After announcing its intention to release new scripts and commands to better integrate PowerShell with Office 365,Microsoft has followed through.The newly ordained PowerShell for Office 365 features the same command-line interface found in PowerShell 5.0 – and that's because it is the same program.According to The Register, Microsoft has created "ascript libraryto help you do things like add users, control licenses, and stop people from recording Skype meetings."Before you start using it, however, you have to "import the modules corresponding to all the bits of Office 365 you want to administer, including the Microsoft Online Services Sign-in Assistant and the Azure Active Directory Module to handle the important matters of security and authentication."The widespread use of PowerShell and its necessity for sysadmins and network admins...
    This topic first appeared in the Spiceworks Community

    Hi, almightywiz,
    Sorry for the delayed response. I was away from office for one day and did not have access to the files.
    And you are right, column 11 is text and column 26 is date (i.e., numeric). And indeed, those visually blank cell in column 11 are not null but have zero length. Java can tell the difference but not by visually inspecting the cells in the spreadsheet.
    I also checked the POI API documents, and found that org.apache.poi.ss.usermodel.Cell interface, which has those cell types, is implemented by both HSSFCell and XSSFCell. The question is under what condition the cell type of a cell becomes Cell.CELL_TYPE_BLANK.
    While that is not yet clear, I will catch cells missing data in column 11 by checking three things: first check if(cell == null), then if(cell.getCellType() != Cell.CELL_TYPE_STRING), and then if(cell.getStringCellValue().length() == 0). And that solves my problem.
    Thank you so much for sharing your experience and solving my problem.
    I have another problem that may more serious, at Can I process Excel BIFF5 files, or simply abandon Apache POI? It would be very much appreciated if you had time to look at it.
    Best regards,
    Newman

  • Count documents in a SharePoint online library using PowerShell

    Hi,
    I would like to use PowerShell to iterate through a site (and its sites) and count how many documents are in each document library.
    Does anyone know if this is possible for SharePoint online please?
    Thanks

    yes. You can set an ID on counter. I don't have any idea about how to do that from the PowerShell but from SharePoint online it is possible by going in to document library settings and then select default view (All documents). Then go and then select
    ID as column and there is an option over there Total. If you select the ID column drop down you will get an option called count select that and click ok. Then go back to your document library and see the count of the documents you have in your doc library.
    If you find this information helpful then please propose this as answer and vote. Thanks.

Maybe you are looking for