Loading this assembly would produce a different grant set from other instances

I was trying to get to the root of an issue for a client’s environment that was mysteriously down (SharePoint 2013, March 2017 CU). IIS was up and running, disk space was fine, SQL was also fine, but the sites were just loading blank pages. I checked the error logs, on both the application servers, as well as the web front ends, and they all had this same error message. "An exception occurred when trying to issue security token: Loading this assembly would produce a different grant set from other instances". This is a new one on me, I’ve not seen this error before. (Surprise, it’s SharePoint!)

Image

After a bit of searching, I found this article on TechNet, which advised in setting the trust level to full for the web.config files, clearing out ASP.NET temporary files, and a few other things. None of these solutions worked. However, in the comments of the same article, someone had noted to setting the following registry setting, adding a DWORD (32-bit) value of 1 under a new key named LoaderOptimization in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. And also doing the same under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework.

Rebooted the servers, although I am sure an IIS reset, and a manual restart of all of the services would have done the trick, but the Farm was down, so a reboot wasn’t an issue to perform.

I found more information on the issue from CA, on this page, under the heading "Defect DE46408 (Formerly 369408) – Application Errors When Instrumenting SharePoint", it states:

"This situation usually happens when the SharePoint site web.config is set to use the legacy CAS model. The legacy CAS model was introduced in .NET version 4, and provokes the error. Refer to https://msdn.microsoft.com/en-us/library/vstudio/dd984947(v=vs.100).aspx for a reference of CAS changes in ASP.NET 4."

I am not exactly sure what prompted this issue, except that there were some recent security updates applied, but this did the trick. I’ll have to dig into this deeper as time permits and see if I can determine the root cause.

Advertisement

Boston Area SharePoint Users Group February 13, 2018 Meeting

Hey, guess what? I’m speaking at the BASPUG in February… come join me! We’ve moved to a new night – Tuesday, works better for everyone who helps out with the group.

Read the below for more information, and click here to register!

The Boston Area SharePoint Users Group (BASPUG) was founded to bring together like minds to network and share their experiences, triumphs, and tribulations around Microsoft SharePoint, to provide a community platform for Boston area SharePoint users, administrators, developers, architects, of all experience levels, even brand new to SharePoint, to share their knowledge with the community.

Geoff Varosky will be presenting “Easily Integrating a Chat Bot into SharePoint”

Session Abstract

​Chat Bots are very commonplace these days. They have been around for years, but advances in AI technology have allowed for a large growth and advances in this area. Microsoft has in preview a service called QnA Maker, that will allow you to create and build a Chat Bot that you can easily integrate into SharePoint using the Azure Bot Framework, all without writing a single line of code. Join me, and I’ll walk you through step-by-step on this process, along with discussing how and where Chat Bots can be used to provide better adoption and support to your users.

About the Speaker

​Geoff Varosky is a Senior Architect for BlueMetal, a division of Insight, based out of Watertown, MA. He has been architecting and developing web based applications his entire career, and has been working with SharePoint for the past 13 years. Geoff is an active member of the SharePoint community, Co-Founder and Co-Organizer of the Boston Area SharePoint Users Group, co-founder for the Boston Office 365 Users Group, co-organizer for SharePoint Saturday New England.

MEETING SPONSOR – BlueMetal

​Modern technology, craftsman quality. We’re an interactive design and technology architecture firm matching the most experienced consultants in the industry to the most challenging business and technical problems facing our clients. We seek to understand your business strategy and technical foundation to craft modern applications that holistically blend strategic vision, creative design, architecture, and innovation, to exactly meet your needs and ensure your success.​​

SUSTENANCE

Food and beverages will be provided at the meeting free of charge from our meeting sponsor. Food arrives at about 6PM. We generally have pizza (with and without meat), as well a salad, water, and sodas.​​

RAFFLE PRIZES

We will be handing out raffle tickets at the BASPUG meetings.

LOCATION

The meeting will be held at the BlueMetal Boston Office at 9 Galen St, Suite 300, Watertown, MA.​ Parking is FREE, and available in the main lot, and behind the building along the river.
Walk in the main building entrace (not the side of the bus stop), go to the back, take the elevator up to the 3rd floor, and the BlueMetal office is right in front of the elevator.

LINKED IN
Join our group on LinkedIn today to connect with the rest of the BASPUG members, and spread the word!

FACEBOOK 
We are also on facebook! http://www.facebook.com/#!/pages/Boston-Area-SharePoint-User-Group/113652405354617
TWITTER
Follow news about the Boston Area SharePoint Users Group on twitter by following us @BASPUG, and by using the hashtag #BASPUG
WEB
Visit the Boston Area SharePoint Users Group website at http://www.bostonsharepointug.org
ORGANIZERS
Event meetings are organized by Geoff Varosky of BlueMetal and James Restivo of Crow Canyon Systems.

 

Please visit The Boston SharePoint Area Users Group page for more event details!

Creating Runbooks in Azure and Calling Them from SharePoint Using Webhooks and Flow

AzureFlowSharePointAutomationRunbooks are a feature of Azure Automation that allow you to execute workflows from within Azure or remotely to automate processes.

To give an example, lets say you have a script that monitors an Azure service every 5 minutes to see if it is running or not. The script, will test and see the status of an Azure App Service. If it tests the site, and does not get the HTTP 200/OK message, then it triggers an alert, creates a ticket, and now someone has to go recycle the Azure App Service. If this can happen frequently, then it is something you would look to automate.

In comes the Azure Automation Runbook. You create a PowerShell script that is hosted in Azure (a Runbook), and when your script detects that the service is not responding, it makes a call out to a URL, and the URL runs the Runbook, which restarts the Azure App Service. The monitoring script then runs again, sees that the service is back up, and the appropriate steps are taken.

This might seem like a lot of extra work, but, if you are, say, connecting in through a VPN to manage an Azure environment, it can be quite time consuming just to restart a service.

However, we are not using that as our working example in this article. That was just to give you an idea of the kinds of things that can be done using Runbooks. In this article, we will be showing you how to create a Runbook, and call it from SharePoint, using Microsoft Flow. It will not be a real exciting example either, but, it will show you how to do all this, so you can do more on your own!

Prerequisites

This article assumes the following:

  • You have an Azure subscription. If you do not, you can get one here for free to play around
  • You have SharePoint Online

Creating an Azure Automation Account

Before we can create our Runbook, we need to create an Azure Automation Account. Login into the Azure Portal, click on New > Monitoring + Management > Automation

image

Configure the following settings for your Automation Account:

  • Name: What are you going to call it?
  • Subscription: Select the subscription to use
  • Resource Group: Either create a new one, or, use an existing.
  • Location: Which Azure region should this run in? I am using East US 2… since I’m in the East US.
  • Create Azure Run As account: This is not needed for our test, but, if you’re doing anything in Azure with your runbooks, you will want to configure this. For more information, visit: https://docs.microsoft.com/en-us/azure/automation/automation-offering-get-started#authentication-planning

image

Then press Create.

It’ll take a moment while this deploys…

image

Once done… access it either by the Automation Accounts blade on the left side, or, via the Notifications link Go to resource once its done deploying.

image

And you will be brought to the landing page for your Automation Account, AutomationTest

image

Creating an Azure Automation Runbook

Now that we have our Automation Account, we need to create our runbook. From within the Automation Account, click on Runbooks under Process Automation on the left hand side.

image

Then click Add a runbook at the top of the runbooks dashboard

image

Click on Quick Create / Create a new runbook

image

Fill in the details

  • Name: Check-Website
    Give your runbook a name
  • Type: PowerShell
    You can also choose Python 2, Graphical, PowerShell Workflow, and Graphical PowerShell Workflow
  • Description: Check the status of a website
    Enter in a description for the runbook

Then click on Create

image

And viola! Your runbook has been created!

image

It doesn’t do anything yet, so, we will need to add code. Click on Edit at the top of the dashboard.

Here is where we will type out, or paste in our PowerShell code for the runbook.

image

NOTE: Do not use Write-Host, there is no “host” per-say to write to. Instead, ensure all output is written using Write-Output

Let’s add the following code to test if Google is up and running…

Function OutputStatus($type,$status) {
    Write-Output "$type | $status";
}

Function Get-HTTPSStatus($url,$type) {
    $HTTPSStatus = Invoke-WebRequest $url -Method Get –UseBasicParsing
    if ($HTTPSStatus.StatusCode -eq "200") {
        return OutputStatus -type $type -status "Success"
    } else {
        return OutputStatus -type $type -status "Error"
    }
}

Get-HTTPSStatus "http://www.google.com" "Google Website"

image

Click on Save

image

Now lets test it…click on Test pane

image

Click on Start

image

You will see a message that it is being submitted

image

You can then see that it gets queued

image

And finally, we see the status and the output displayed

image

Pretty neat!

Now, lets say we want to add some parameters to our script, so we can specify the input… and not have it statically set as just “http://www.google.com” as the site, and “Google Website” as the description. Let’s update the code with some parameters…

To get back to your code, click on Edit PowerShell Runbook in the breadcrumb navigation at the top

image

Update our code with the parameters $Site and $Description, and then Save, and then go back on over to the Test pane

image

You can now see we have two fields for Site and Description under Parameters. Fill those out…

image

And run the script again…

image

Looks good! Now… we can do this all day from within Azure… but remember way back to the start of this article, I mentioned calling this from Microsoft Flow from within SharePoint? To do that… we’re going to need to make a change to our script, as well as create a webhook.

First, lets change our script. You know how we just added parameters? Well, when calling a webhook, we’re going to be making a REST call to a URL. We cannot pass in parameters like we just did to the script. That is good for running within Azure itself… in order to pass parameters to our runbook via a webhook… we need to change the parameters. We will be passing in an object called WebhookData (or whatever else you want to call it). Which will be the JSON data sent along with the REST call. So, let’s update our code to this:

image

We will then parse out the Site and Description name/value pairs from that and pass it into our script from the $WebhookData object.

The code for the above is here:

Param (
    [object]$WebhookData
)

Function OutputStatus($type,$status) {
    Write-Output "$type | $status";
}

function Get-HTTPStatus($url,$type) {
    $HTTPStatus = Invoke-WebRequest $url -Method Get –UseBasicParsing
    if ($HTTPStatus.StatusCode -eq "200") {
        return OutputStatus -type $type -status "Success"
    } else {
        return OutputStatus -type $type -status "Error"
    }
}

if ($WebhookData -ne $null) {
    Get-HTTPStatus $WebhookData.RequestHeader.Site $WebhookData.RequestHeader.Description
} else {
    Write-Error "No data received in webhook call."
}

We need to Publish it first before creating the webhook. Go back to the code view, and click on Publish

image

It will prompt you to confirm, click Yes, and it’ll be published.

image

Now that we’ve got that straightened out… let’s move on to creating our webhook.

Creating a Runbook Webhook

From our runbook Dashboard, click on Webhook at the top of the dashboard

image

Click on Webhook – Create a new webhook

image

Then give it a name, and an expiration date, and if it should be enabled or not…

image

Now… notice the big warning sign at the top of this screen…

image

See? Now… copy and paste that URL at the bottom, and save it somewhere. There is no way to get this URL once the webhook has been created.

image

Once you have done that, click OK

Then click on Parameters and run settings and then click OK there

image

Then click Create at the bottom of the form. Until you do that, you can still get the webhook URL…

Ok… now what? Let’s call it from PowerShell, since we need to do a POST to access it.

image

We can see in the Content section of the output, we are given a JobId of 4164eb1f-57ba-41c3-a7cb-2f556652e9ad

In our runbook, if we go to Jobs under Resources

image

We can see that a job successfully ran

image

Click on it, and we can see the status, and you will see the JobId matches what we got from the call from Invoke-WebRequest

image

You will see there were errors… because we didn’t actually send any data along with it. We just called it directly. But now that we have it… we can move on to SharePoint and Flow.

Creating a Flow to Call our Webhook from SharePoint

Now that we’ve gone through the meat an potatoes of this project… let’s look at linking at all together with SharePoint and Flow.

Log into your SharePoint Online tenant… and lets create a new list.

I’ve got a basic custom list called Flowtest

image

Now… once created, in the Modern interface… click on Flow > Create a flow

image

Click on See your flows at the bottom, because we’re going to create a brandy-new one…

image

Click on + Create from blank at the top of the page

image

Click on Search at the bottom of the next screen, and search for SharePoint created… we want to add a trigger for when a new item is created in our list.

image

Select SharePoint – When an item is created

Select your SharePoint Online site from the list, or, enter in the URL, then select the list… in this case, we’re using Flowtest

image

Then click + New step > Add an action

image

Click on HTTP under Connectors

image

Choose HTTP – HTTP

image

Then fill out the details…

  • Method: POST
  • Uri: The URL we copied when we created our webhook
  • Headers
    Site:
    http://www.google.com
    Description: Google’s Website (FROM SHAREPOINT!)

image

And then click on Save Flow

Also… don’t forget to give your flow a name Smile

image

You should now see your Flow

image

Now… open a new window, and go back to your list, and create a new item…

image

And if you check back on your flows…

image

You will see one succeeded!

Clicking on it will give you the breakdown of the flow run (which is one of the more awesome features of Flow… over IFTTT IMHO FWIW YK?)

image

Now… let’s go check Azure…

If we look at the jobs for our Runbook… we’ll see a new one in there…

image

Click on it, and then click on the output

image

image

It worked!

Now… let’s make this a bit more functional. Go back to your list settings in SharePoint

image

I’ve changed the Title field to URL, and added a field called Description as a single line of text.

image

Now, let’s go back to our Flow…

And edit the HTTP step

image

Edit the values for Site and Description, and then select the corresponding Site and Description values from the Dynamic Content list that pops up to the right. See what we’re doing here?

image

Let’s run our Flow… create a new list item, passing in a URL and Description…

image

and check the status…

image

It worked! It’s a day of miracles people! While this is not a really exciting example, it shows how to use Azure Runbooks and Webhooks, and how they can be accessed remotely to do a specific task.

What sort of cool things are you doing or have you done with Flow and Runbooks, if anything?

Resources and References

Connecting to SharePoint Online using the PnP PowerShell Library and NOT Having to Log In Every. Single. Time…

imageBefore you can do anything with the SharePoint Patterns & Practices PowerShell library, you need to first connect to SharePoint Online. Sounds pretty basic, right? You need to establish who you are, and maintain your access during your session with the site you are working with.

Now, the Documentation does show you how to do this:

image

Connect-PnPOnline –Url https://geoff365.sharepoint.com –Credentials (Get-Credential)

When you do this… you are prompted for credentials… Every. Single. Time.

image

This is good for production, however, if you are developing a script, you may run this tens or hundreds of times… and, it gets old pretty fast. So, here is what I do. In my script, I set variables for the username and password (alternatively, you could pass these as parameters, and pass them along using a batch file).

image

Then, I convert the password into a secure string, and create a PSCredential object with the username and secure password.

image

I can then connect to SharePoint Online using the Connect-PnPOnline command (as shown above), wrapped in a try/catch block, and not be prompted for credentials!

image

Here’s the full script:

#region Imports
Import-Module SharePointPnPPowerShellOnline -WarningAction SilentlyContinue
#endregion Imports

#region Variables
$Username = "admin@geoff365.onmicrosoft.com"
$Password = "ThisIsNotMyRealPassword!"
$SiteCollection = "https://geoff365.sharepoint.com/sites/powershellplayground"
#endregion Variables

#region Credentials
[SecureString]$SecurePass = ConvertTo-SecureString $Password -AsPlainText -Force
[System.Management.Automation.PSCredential]$PSCredentials = New-Object System.Management.Automation.PSCredential($Username, $SecurePass)
#endregion Credentials

#region ConnectPnPOnline
try {
    Connect-PnPOnline -Url $SiteCollection -Credentials $PSCredentials
    if (-not (Get-PnPContext)) {
        Write-Host "Error connecting to SharePoint Online, unable to establish context" -foregroundcolor black -backgroundcolor Red
        return
    }
} catch {
    Write-Host "Error connecting to SharePoint Online: $_.Exception.Message" -foregroundcolor black -backgroundcolor Red
    return
}
#endregion ConnectPnPOnline

Creating a Chat Bot with Microsoft’s QnA Maker and Azure Bot Service

Image

Microsoft has a service in preview, called QnA Maker. It is a free (presently) service, which provides a REST and web-based service that trains AI to respond to questions asked of it. You’ve seen these on other sites, as these have become quite common, and ease the burden on support for SharePoint, or any other service out there. Chat bots can field common questions, freeing up time and energy spent on answering common asks.

They make it very easy to use – you can point it to a URL, type in your questions and answers, or upload a document (.docx, .doc, .pdf, .xlsx, and .tsv). The tricky part, is getting this from loading your knowledge base, to actually having a chat bot on your site. This is what this blog post is for, is to show you how to do it. They do have directions, but not a full walk-through on what to do.

This post assumes that you have at the very least, an Azure Account. If not, you can start one for free.

QnA Maker Setup

First, go to http://qnamaker.ai, this is where you will get started. Click on Create New Service

image

Then sign in with a Microsoft ID, or organizational account like you would into Azure, Office365, Outlook.com, etc.

image

It will then ask you to provide permissions to QnAMaker, click Accept

image

Then you must agree to the terms and privacy statement, check the box and hit Continue

image

Enter in a name for your bot. I am choosing Testbot 9001

image

You now have 3 options for loading data into your Chat Bot…

  1. From a URL that links to a resource which has a clear Q&A format, like a FAQ
  2. From a file, in Question/Answer format (supported file types are .TSV*, .PDF, .DOC, .DOCX, and .XLSX format)
    *TSV stands for Tab Separated Values. Like a CSV, but, you know, with Tabs. You can do this in Excel.
  3. Enter them in manually

For our Testbot 9001, we will be uploading from Excel. So, let’s create a new Excel file. In the first column, type in the question, or phrase, which the chatbot AI will hit on and use to provide the answer. Use the second column to provide that answer. Here is my example file:

image

Now, save the file. And go back to the QnA Maker setup, and choose Select file… next to the FILES section

image

and select the XLSX file from your local computer you just saved

image

Then scroll to the bottom and select Create

image

You will then see a dialog window appear while the service scans your file, and imports your Questions and Answers
image

Once complete, it will take you to the Testbot 9001 Knowledgebase.

image

Select Test from the side bar, and you can test the functionality with your questions
image

Cool, huh? The testing also allows you to train the bot as well. Such as choosing the best answer based upon what you had typed
image

Or providing multiple alternative phrasings, or synonyms

image

When done, click Save and Retrain to save your changes

image

You can see back in the main Knowledgebase, that it has been updated by what we asked and what we updated the suggestions and phrasings with

image

You can also add new Q & A pairs by clicking on Add new QnA pair

image

image

When done, Save & Retrain again to save your settings.

Once you are ready… click Publish

image

It will then show you what will be published… and then when ready, click Publish

image

The deployment confirmation screen will show you the example HTTP request for using your bot through the REST API. These are also available in the Settings link on the sidebar of the Knowledgebase.

image

We will need some f this information in a few minutes, so take down the Knowledgebase ID

image

And the Subscription Key

image

and put those aside for a few minutes…

Azure Bot Service Setup

Next we’re going to use the Azure Bot Service to setup our bot. To do so, we’ll be following these instructions: https://docs.microsoft.com/en-us/bot-framework/bot-service-quickstart

Log into the Azure Portal

Click on New > AI + Cognitive Services > Web App Bot

image

Now, let’s configure the botimage

  • Name: Testbot9001
    So you can identify the soldiers in your bot army!
  • Subscription: GeoffOps
    Choose your own subscription. This one is mine. You can’t have it.
  • Resource Group: Testbot9001
    Use an existing or create a new one
  • Location: East US
    Select the data center region you would like to use
  • Pricing Tier:  FO (10K Premium Messages)
    This defaults to S1 Standard, change this to F0 Free. Or else you will pay for the service
  • App Name: Testbot9001
  • Bot template:  Question and Answer
  • App service plan/Location: Testbot9001
    You will need to create a new one, or use an existing. For this example, I created a new one also in East US
  • Azure Storage: testbot9001a325
    I am letting Azure create a new one for me. This is a data storage account, like a fileshare. You can use an existing one if you have one as well.
  • Application Insights: Off
    This is not free. So I turned it off.

Then click Create to bring life to your Azure Bot. I twill validate your choices, and then when complete, will begin deployment.

image

When deployment has completed, you can find the bot and associates Azure resources under the All Resources blade of the left, or, if you have other stuff in Azure, go to the Resource Groups blade, and click on your Resource Group we created in the Bot setup above. In my case, the Resource Group is Testbot9001

image

Ok. So, we’ve created our bot with QnA Maker, and created a Bot Service in Azure… now what? We need to connect the two.

Select your bot, it’ll be the one which has a TYPE of Web App Bot

image

On the left hand side, click on APP SERVICE SETTINGS > Application Settings

image

And then scroll down to App settings. You will see two blank settings called QnAKnowledgebaseId and QnASubscriptionKey

Now, remember those things we copied off earlier? Pate these in there.

image

And then click Save up top

ScreenClip

Now, click on Test in Web Chat on the left side, and test out your new bot!

image

Pretty neat! But… now what?

Click on Channels on the left side. You will see Web Chat setup and running by default. You can also see, you can extend this out to Teams, Skype, and more pretty easily.

image

Click on Edit, and copy the Embed Code

image

And show one of the keys at the top

image

and replace the YOUR_SECRET_HERE in the embed code

image

And you can now drop that into a site, web part, whatever you’d like. It’s just an iFrame, so the possibilities are endless.

A simple example – using Embed Code on a SharePoint page:

image

image

image

Would I implement it like this for a client? Likely not… I’d be more apt to have a sliding pop-up window, similar to Facebook chats that can be minimized and maximized as needed. This was just an example to show how to build one of these.

 

References

Registration open for the May 10, 2017 Boston Area SharePoint Users Group Meeting

BASPUG_195square_initialsRegistration is now open for the Boston Area SharePoint User Group (BASPUG) taking place on May 10th, 2017, at the BlueMetal office at 9 Galen St, Suite #300, Watertown, MA​ from 6:30-8:30 PM. Click here to register!

Dimitri Ayrapetov will be presenting “How to Approach SharePoint Governance”

Session Abstract

​The term governance means different things to different people. There are many ways to define what governance means to your organization as you start on the journey of planning, implementing, and monitoring it. This session will provide the key fundamentals for approaching Governance in SharePoint with lessons from the field and practical best practices.​

About the Speaker

​Dimitri Ayrapetov is a Digital Partner with TrnDigital. He comes with over 10 years of consulting experience working with SharePoint, Office 365, and related technologies.

MEETING SPONSOR – BlueMetal

​Modern technology, craftsman quality. We’re an interactive design and technology architecture firm matching the most experienced consultants in the industry to the most challenging business and technical problems facing our clients. We seek to understand your business strategy and technical foundation to craft modern applications that holistically blend strategic vision, creative design, architecture, and innovation, to exactly meet your needs and ensure your success.​​

SUSTENANCE

Food and beverages will be provided at the meeting free of charge from our meeting sponsor. Food arrives at about 6PM. We generally have pizza (with and without meat), as well a salad, water, and sodas.​​

RAFFLE PRIZES

We will be handing out raffle tickets at the BASPUG meetings.

LOCATION

The meeting will be held at the BlueMetal Boston Office at 9 Galen St, Suite 300, Watertown, MA.​ Parking is FREE, and available in the main lot, and behind the building along the river.
Walk in the main building entrace (not the side of the bus stop), go to the back, take the elevator up to the 3rd floor, and the BlueMetal office is right in front of the elevator.

LINKED IN

Join our group on LinkedIn today to connect with the rest of the BASPUG members, and spread the word!
FACEBOOK 
We are also on facebook! http://www.facebook.com/#!/pages/Boston-Area-SharePoint-User-Group/113652405354617
TWITTER
Follow news about the Boston Area SharePoint Users Group on twitter by following us @BASPUG, and by using the hashtag #BASPUG
WEB
Visit the Boston Area SharePoint Users Group website at http://www.bostonsharepointug.org
ORGANIZERS
Event meetings are organized by Geoff Varosky and Bob German of BlueMetal, James Restivo of Crow Canyon Systems.

Please visit The Boston SharePoint Area Users Group page for more event details!

Replacing a Drop-Down List in Nintex Forms 2010 with an Autocompleting Textbox – Fix for Version 1.11.4.0 Update

SharePoint Sig wrote a great post about creating an autocompleting textbox in Nintex Forms 2010 using a Drop-Down list as the source. This was awesome code that did not require much hassle to implement. Until version 1.11.4.0 was released in January of this year.

That is right, this threat that is on every Nintex release finally came to pass:

image

The changes did indeed require adjustments to custom JavaScript.

We had a client that this functionality broke on, so the SWAT team was called in to figure out a solution. After a few frustrating hours, I was able to figure it out. When configuring your variables that are linked to your textbox and drop-down list, let’s call them simply mylist and mytext for the drop-down list and textbox respectively… the ID for the drop-down list element had changed and added _hid on the end of it. So as an example, the ugly ID for the element:

ctl00_m_g_53210a58_ac0b_4f63_be11_47018c3b62f1_ctl00_ListForm2_formFiller_FormView_ctl26_ca219dc8_8328_4480_b26c_fabd21a218d9

Now becomes:

ctl00_m_g_53210a58_ac0b_4f63_be11_47018c3b62f1_ctl00_ListForm2_formFiller_FormView_ctl26_ca219dc8_8328_4480_b26c_fabd21a218d9_hid

So I needed to add in a replace on the string to fix it:

mylist = mylist.replace("_hid","");

That’s the first issue. The second issue is iterating through the options in the dropdown did no longer work. The original code used the following to iterate through:

        $(dropDown1).children().each(function() {

This was no longer working in our implementation, so we did this:

Now, I tried several (well, a lot more than several) options to get ahold of the element, this seemed to be the only one that worked. I built up the element selector in a variable, and then passed it in:

var dropDownOptions = "#" + mylist + " > option";

NWF$(dropDownOptions).each(function() {

The final code ended up being close to this… this was the working prototype, so it can probably be cleaned up a bit more, but, the most important thing is that it worked (changed bits highlighted):

NWF$(document).ready(function(){

    var textbox = NWF$("#" + mytext);

    mylist = mylist.replace("_hid","");

    var dropDown1 = NWF$("#" + mylist);

       
    textbox.autocomplete({

        source: function(request, response) {

            var autocompleteVals = [];

            console.log("autocomplete1");

           
            var dropDownOptions = "#" + mylist + " > option";

            NWF$(dropDownOptions).each(function() {

                if (NWF$(this).text() != "(None)" && NWF$(this).text().toLowerCase().indexOf(request.term.toLowerCase()) >= 0) {

                    autocompleteVals.push(NWF$(this).text());

                }

            });

           
            response(autocompleteVals);

        },

        minLength: 1,

        select: function(event, ui) {

            console.log("autocomplete3");

            var fieldOption = NWF$("#" + dropDown1Id + " option").filter(function() {

                return NWF$(this).html() == ui.item.value;

            });

           
            NWF$(fieldOption).attr("selected", true);

            NWF$(dropDown1).change();

        }

    })

});   

Hope this helps someone else out struggling with this issue!

Registration open for the April 12, 2017 Boston Area SharePoint Users Group Meeting

BASPUG_195square_initialsRegistration is now open for the Boston Area SharePoint User Group (BASPUG) taking place on April 12th, 2017, at the Versatile office at 450 Donald Lynch Blvd., Suite B, Marlboro, MA​ from 7:00-8:30 PM. Click here to register!

Jared Matfess will be presenting "Enhancing Your SharePoint Business Solutions using JavaScript & REST"
Session Abstract

​This demo-heavy session is going to focus on showing you how to enhance your current business solutions using JavaScript & libraries such as DataTables, Google Charts, MomentJS, and more. Learn how to grab data from SharePoint Lists using the SharePoint REST API and display that information in a more meaningful way on the page.​

About the Speaker

Jared is a Solution Principal working for Slalom Consulting, a Microsoft Managed Partner providing national Business & IT solutions headquartered in Seattle, Washington. He is a Microsoft Certified Professional (MCP), and has over a decade of experience building technical solutions, and solving business problems. He is a regular speaker at user groups & SharePoint Saturdays all up and down the East Coast. Jared is also a Microsoft Most Valuable Professional (MVP) in the Office Servers and Services category. He can be reached through his blog or on Twitter (@jaredmatfess).

MEETING SPONSOR – Versatile

At Versatile, we understand your IT solutions require careful consideration, whether you’re making traditional IT or cloud decisions. By focusing on clarity, simplicity, and support, we help you align your computing decisions with desired business outcomes. We take great pride in helping your organization run smoother, more efficiently, and more profitably by helping you find the right balance between traditional IT and cloud computing.

Versatile is more than our name – it’s who we are.​​​

SUSTENANCE

Food and beverages will be provided at the meeting free of charge from our meeting sponsor. We generally have pizza (with and without meat), as well a salad, water, and sodas. Beer and wine will also be available.​​

RAFFLE PRIZES

We will be handing out raffle tickets at the BASPUG meetings.

LOCATION

We will be meeting at the Versatile office at 450 Donald Lynch Blvd, Suite B, Marlboro, MA. Parking is free.

LINKED IN

Join our group on LinkedIn today to connect with the rest of the BASPUG members, and spread the word!

FACEBOOK
We are also on facebook! http://www.facebook.com/#!/pages/Boston-Area-SharePoint-User-Group/113652405354617

TWITTER
Follow news about the Boston Area SharePoint Users Group on twitter by following us @BASPUG, and by using the hashtag #BASPUG

WEB
Visit the Boston Area SharePoint Users Group website at http://www.bostonsharepointug.org

ORGANIZERS
Event meetings are organized by Geoff Varosky and Bob German of BlueMetal, James Restivo of Crow Canyon Systems.

Please visit The Boston SharePoint Area Users Group page for more event details!

Registration open for the March 8, 2017 Boston Area SharePoint Users Group Meeting

BASPUG_195square_initialsRegistration is now open for the Boston Area SharePoint User Group (BASPUG) taking place on March 8th, 2017, at the BlueMetal office at 9 Galen St, Suite 300, Watertown, MA from 6:30-8:30 PM. Click here to register!

Bob German will be presenting "Is it Safe to Customize SharePoint?"
Session Abstract

​Since 2007, SharePoint has been billed as a platform for developing custom solutions. And who wants to be limited to just what’s in the box? The thing is, sometimes the customizations break when you upgrade SharePoint, which might be at any moment if you’re in SharePoint Online. Just ask anyone who used the "Fab 40" web templates and then couldn’t upgrade from SharePoint 2007! It’s gotten so crazy that some people just won’t customize SharePoint at all, even as new development technologies are introduced.

In this talk, we’ll review all the major options for customizing SharePoint since 2003, and the strengths and pitfalls of each. You’ll learn which options are "safe" and which are headed for a long trip down a short pier. This talk is for everyone who makes decisions about SharePoint – admins, business decision-makers, architects, and developers alike. You’ll learn what’s possible from each type of customization, and what the future has in store. The goal is to make it easy for you to navigate through all the options without stepping on any land mines!​

About the Speaker

Bob German is Principal Architect at BlueMetal Architects, where he leads SharePoint architecture and development engagements for enterprise customers. Bob has been developing on the SharePoint platform since it was called “Site Server”, and is a Microsoft MVP for Office Development and Office Services and Servers. Over the last few years, Bob has demonstrated "future-proof" client side solutions that allow code reuse from legacy SharePoint to the Add-in model and the forthcoming SharePoint Framework.

Prior to joining BlueMetal, Bob was an architect at the Microsoft Technology Center in Boston, MA; he also worked for Microsoft Consulting Services building and performance tuning web sites and other networking solutions.

DATE

Wednesday Mar 08, 2017.

TIME

6:30 PM – 8:30 PM.

LOCATION

The meeting will be held at the BlueMetal Boston Office at 9 Galen St, Suite 300, Watertown, MA.​ Parking is FREE, and available in the main lot, and behind the building along the river.

Walk in the main building entrance, go to the back, take the elevator up to the 3rd floor, and the BlueMetal office is right in front of the elevator.​​

MEETING SPONSOR – BlueMetal

Modern technology, craftsman quality. We’re an interactive design and technology architecture firm matching the most experienced consultants in the industry to the most challenging business and technical problems facing our clients. We seek to understand your business strategy and technical foundation to craft modern applications that holistically blend strategic vision, creative design, architecture, and innovation, to exactly meet your needs and ensure your success.​​

SUSTENANCE

Food and beverages will be provided at the meeting free of charge from our meeting sponsor. Food arrives at about 6:00. We generally have pizza (with and without meat), as well a salad, water, and sodas.​​

RAFFLE PRIZES

We will be handing out raffle tickets at the BASPUG meetings.​​

Creating New Service Application Proxy Groups and Associating Services and Sites

Sometimes the need arises to create separate Service Application Proxy groups in SharePoint. Starting with SharePoint 2010, you’ve been able to do this. In SharePoint 2007, you would have created different Shared Service Providers. Your needs might be, that you are exposing web applications to a different group of users, and need separate applications such as Search and the User Profile Service. This also allows you to run those service applications under different accounts, if you needed to for security reasons.

First, let’s create the proxy group we want to use. And lets give it a name.. in the example, I’ll be using "Redacted"… because all my screenshots have had the real service application group identity redacted 🙂 But you can name this anything you’d like. Load up the SharePoint Version Management Console… and call the New-SPServiceApplicationProxyGroup PowerShell cmdlet.

New-SPServiceApplicationProxyGroup "Redacted"

Once you have your new Service Application Proxy Group created, you can then change the web application subscriptions to the proxy groups. To do so, go into Central Administration > Application Management > Web Applications > Manage web applications and select one of your sites. In the ribbon, then select Service Connections under the Management group.

Image(5)

You can always verify this by then going into Central Administration > Application Management > Service Applications > Configure service application associations

Image(6)

Select the Web Applications view, and then you should see your sites, and their associated applications with their Application Proxy Groups.

Image(7)

When you create a new service application, by default, it is going to get tossed into the default group. There is no way in the UI presently to allow you to change associations in the UI once you have created your new proxy group, so, what you need to do is to handle this in PowerShell. The best way to get the IDs for your service applications is to use Get-SPServiceApplication, and then only display the two columns you need, DisplayName (so you know what ones you are looking for), and the Id.

Get-SPServiceApplication | select-object DisplayName,Id

Image(8)

Once you have the ID’s that you need for your Service Applications, you now need to add them as members to the new proxy group you created earlier. You can do this by using the Add-SPServiceApplicationProxyGroupMember PowerShell cmdlet, like so:

Add-SPServiceApplicationProxyGroupMember "Redacted" -Member "f166672c-24b5-4f1a-bd2d-e8436d966abb"

This will add the "Secure Store Service – Redacted" Service Application to my new proxy group Redacted.

If for some reason, one of the service applications do not want to move out of the default group after adding them into the new group, you can remove them with the Remove-SPServiceApplicationProxyGroupMember PowerShell cmdlet. Just an FYI – the default group is referenced as "", so, if you needed to now remove the above service from the default group, you will need to address it as:

Remove-SPServiceApplicationProxyGroupMember "" -Member "f166672c-24b5-4f1a-bd2d-e8436d966abb"

%d bloggers like this: