harbar.net http://www.harbar.net/Default.aspx component based software & platform hygiene en-GB Spence Subtext Version 2.5.2.0 http://creativecommons.org/licenses/by/2.5/ harbar.net http://www.harbar.net/images/RSS2Image.gif http://www.harbar.net/Default.aspx 77 60 Connecting Yamaha Digital Pianos to a USB-C iPad (or other devices) http://www.harbar.net/archive/2023/05/17/Connecting-Yamaha-Digital-Pianos-to-a-USB-C-iPad-or.aspx <p>Connecting an USB-C iPad to a Yamaha digital piano is simple… As long as you ignore everything Yamaha tell you in it's <a href="https://uk.yamaha.com/files/download/other_assets/6/725646/iphone_ipad_connect_en_om_j0.pdf">Smart Device Connection Manual</a>. :)</p> <p><em>TL;DR: Forget/ditch the Apple Multiport Adaptors and use a USB-C Hub.</em></p> <p>There are three key elements that are needed for a "all in one" solution: <br />    • <strong>Data</strong> (MIDI to/from the instrument) <br />    • <strong>Audio</strong> (iPad audio is played back thru the speakers of the instrument) <br />    • <strong>Power</strong> (to charge the iPad). <br />       Strictly speaking power is optional, but in reality if the iPad lives on the music rest, then it's a requirement.</p> <p>With the first two, you can leverage Yamaha's own Smart Pianist app - the functionality of which varies depending on the instrument series you use (P, Arius, CLP, CVP, CSP). And a multitude of virtual instruments, instructional apps, sheet music apps, MIDI apps and so on. If you are using a real computer, then obviously DAWs, Main Stage etc are also in play.</p> <p><em>Ironically the flagship instrument has the least Smart Pianist capability but then again it's mostly onboard the instrument. Honestly, Smart Pianist isn't that great unless you have the CSP series or P-515. It's the 3rd Party apps that are really useful. I use forScore, Symphony Pro and Spectrasonics Keyscape the most.</em></p> <p>One thing to note, with some CLP and older Arius models, you may need to update the firmware to enable the instrument as a Audio Interface (play audio back from the iPad via the instrument speakers). Often a store will sell you a instrument without the latest firmware. An CLP-725 will have from the factory no functioning audio interface until you run the firmware update. One time in the Netherlands, the piano store staff didn't know the capability existed, and we had to return with my cable set and iPad to test it in store, at which point the sales dude was like, "hey, that's great, never knew it could do that". It worked on an YDP-164 but not the CLP-725.</p> <p>One can attempt to use Wireless LAN adaptors, and Bluetooth adaptors, but they are all suboptimal and mixing two connections will lead to lag, latency and audio breakup. If the instrument doesn't have on board Audio and Data (MIDI) wireless or Bluetooth support, I wouldn't bother. </p> <p>Most instruments still only offer the ability to connect a Bluetooth device to the instrument in order to play it's audio via the instrument speakers. Big whoop!!  Bluetooth does not always mean Bluetooth MIDI support. Yamaha are slow in this respect, but it's also worth noting that Bluetooth MIDI is terrible for professional applications. At any rate, don't buy an instrument based on it's Bluetooth support, and the key phrase should be "Bluetooth audio and MIDI".</p> <p>So all good. A cable you say! Easy.</p> <p>Except if you also want to power the iPad. Which is a pretty reasonable requirement. Lest the thing runs out of power during a gig. :)</p> <p>In the past, when iPads used Lightning connectors things were far more straightforward. <br /> This is clearly still the target and fully tested scenario by the vendor and the most used by customers. This makes total sense as for ages the iPad used Lightning, and Lightning is a good connector despite what the EU may legislate! </p> <p>There's a reason the Smart Device Connection Manual gets put in a separate downloadable PDF rather than the instrument's instruction manual, and the Smart Pianist application is updated immediately after you install it from the AppStore. You will find older versions of the manual that don’t even mention USB-C and none of the diagrams show a power lead connected! I’m pretty sure they never tested these scenarios with power and certainly not with power cycles.</p> <p>At any rate, you'd hook up a Apple Camera Connection kit which basically has power pass thru and a USB-A port. Into that USB-A port you connect a USB-A to USB-B lead (aka printer cable) and the USB-B end goes into the USB to Host port on the instrument. USB-B being the industry standard for USB MIDI. All good. A reliable connection that survives power cycles of the instrument and the iPad. If you don't want the fugly Apple connector and it's two cables on the music rest then a simple Lightning extension cable takes care of that. </p> <p>This scenario (with the exception of the extension cable) is detailed in the Smart Device Connection Manual. In the latest version, it says to use a USB-C Digital AV Multiport Adapter or USB-C VGA Multiport Adapter. Older versions include a note saying replace Camera Connection kit with a Multiport Adaptor.</p> <p>And this is where things start to go downhill.</p> <p>These Apple adaptors do work, but they will almost always cause problems, especially on the CLP and CVP instruments. Once you get it working it likely will not continue to work when you power cycle the instrument. Or it may work three times, but not the fourth. It gets even worse if you wish to hide the adaptor by using a USB-C extension cable. It needs to be the correct extension cable (at least 10Gbps) and it matters which way around the connection is made at the USB-C end (because USB-A is directional)  It is not a reliable connection, and therefore it is not a connection.</p> <p>The simplest solution for Data and Audio is to connect a straight USB-C to USB-B cable from the iPad to the Instrument. This works GREAT. But there's no power.</p> <p>For power as well, we must use a <strong>USB-C Hub</strong>, that has both a Power Delivery port (for the incoming power) and a USB-A or C port for the cable to the instrument. Usually they have other ports as well (HDMI, etc). Most of these on the market also have a very short cable, so a USB-C extension (capable of power delivery) is also needed to hide all this gubbins.</p> <p><a href="http://www.harbar.net/images/www_harbar_net/Open-Live-Writer/Connecting-Yamaha-Digital-Pianos-to-USB-_137B/image_8.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="http://www.harbar.net/images/www_harbar_net/Open-Live-Writer/Connecting-Yamaha-Digital-Pianos-to-USB-_137B/image_thumb_3.png" width="244" height="177" /></a><a href="http://www.harbar.net/images/www_harbar_net/Open-Live-Writer/Connecting-Yamaha-Digital-Pianos-to-USB-_137B/image_10.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="http://www.harbar.net/images/www_harbar_net/Open-Live-Writer/Connecting-Yamaha-Digital-Pianos-to-USB-_137B/image_thumb_4.png" width="139" height="244" /></a></p> <p>And YES, it does matter which way around the two USB-C connectors connect!! This is the Hub's male plug to the extension cable's female socket. This is because the "legacy device" - the USB-A end of the instrument is directional. Don't try to rationalise it, just know that it's how it is! :) if the connection doesn't work at first, turn the USB-C connector around. I gaff up the side of the connectors so I know which way they need to connect in the future.</p> <p><a href="http://www.harbar.net/images/www_harbar_net/Open-Live-Writer/Connecting-Yamaha-Digital-Pianos-to-USB-_137B/image_6.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="http://www.harbar.net/images/www_harbar_net/Open-Live-Writer/Connecting-Yamaha-Digital-Pianos-to-USB-_137B/image_thumb_2.png" width="244" height="145" /></a></p> <p>To recap what's needed:</p> <ul> <li>a USB-C hub which supports power delivery, and includes at least one USB-A port and an incoming power USB-C port.</li> <li>(optional) a high quality, 10Gbps or higher power delivery capable USB-C extension cable. 2m is a good length to gaff down the back of the instrument legs into some power apparatus concealment (which is where the hub also goes) </li> <li>a USB-C power source and cable</li> <li>a USB-B to USB-A cable (USB to Host MIDI) aka a printer cable. You can also use a USB-B to USB-C here</li> </ul> <ol> <li>The USB-C cable goes from the power source into the Power Delivery port on the hub.</li> <li>The USB-B cable goes from the instrument's USB to Host port to a USB-A (or C) port on the hub.</li> <li>The hub's built in USB-C lead goes into the USB-C extension lead.</li> <li>The other end of the extension lead connects to the iPad.</li> </ol> <p>Rinse and repeat for connection to a computer such as a MacBook or Mac Mini, although of course with these, they can be powered via another port, so the use of the Apple Digital Multiport adaptor is viable. One can even hook up a USB switch at the "legacy" end of the chain (the USB-B port of the instrument) to switch between the iPad and computer. However if you are in for this sort of thing, you are much better off with a professional MIDI switch solution. Aside anything else, you know you'll be adding another five instruments soon enough! :)</p> <p>Hopefully in the future, the instrument vendors will:</p> <ul> <li>Update and correct their documentation. <br />Although they are right to be cautious because at present there is no such thing as a "certified USB-C extension" and they have enough trouble making lists of supported video adaptors, doing so for USB-C hubs would be very risky. Nonetheless they should at least accommodate the requirement to have power at the same time as data and audio. <br /></li> <li>Improve support for current "standards" - and implement alternative USB to Host ports alongside USB-B. Basically put USB-C into the instruments. <br /></li> <li>Make it standard to include proper Bluetooth and wireless on board for those that wish to go cable free. The bandwidth is there, it's merely the implementations that suck. <br /></li> <li>A step change in instrument connectivity all up. <br />Nobody wants this box of tricks with fragile connectors that have little resilience and need gaffered to a brick. The one thing (only thing :)) all sound engineers agree on is adaptors and shitty computer connectors are turdtastic. We need proper robust connectors - there is a reason USB used a DIN socket. But we won't get them so this bullet is just a fantasy! <br /></li> <li>A general industry move away from printing logos on connectors :)</li> </ul> <p>For reference, the specific cables and hub I'm using are:</p> <ul> <li>Anker USB C Hub, 341 USB-C Hub (7-in-1) with 4K HDMI, 100W Power Delivery, USB-C and 2 USB-A 5 Gbps Data Ports, microSD and SD Card Reader</li> <li>Ruxely Right Angle USB C Extension Cable 2M,90 Degree Type C 3.1 Gen2 10Gbps Female to Male Extender Cord,4K 60Hz L-Shaped USBC Thunderbolt 3</li> <li>Apple 20W USB-C Power Adapter and USB-C Charge Cable (that came with the 2022 iPad Pro)</li> </ul> <p>Testing and validation using the following:</p> <ul> <li>iPad Pro (circa 2018) with Lightning port</li> <li>2022 iPad Pro with USB-C</li> <li>2009 MacBook with USB-C</li> <li>2022 MacBook with USB-C</li> <li>Mac Mini</li> <li>Dell Precision 7530</li> <li>Yamaha P-515</li> <li>Yamaha Arius YDP-164</li> <li>Yamaha Clavinova CLP-745</li> <li>Yamaha Clavinova CVP-809</li> </ul> <p>. </p><img src="http://www.harbar.net/aggbug/435.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2023/05/17/Connecting-Yamaha-Digital-Pianos-to-a-USB-C-iPad-or.aspx Wed, 17 May 2023 00:47:12 GMT http://www.harbar.net/archive/2023/05/17/Connecting-Yamaha-Digital-Pianos-to-a-USB-C-iPad-or.aspx#feedback http://www.harbar.net/comments/commentRss/435.aspx Adding the Office 365 &ldquo;stubs&rdquo; to your VS Code profile Office 365 Platform Hygiene PowerShell SharePoint http://www.harbar.net/archive/2019/12/17/Adding-the-Office-365-ldquostubsrdquo-to-your-VS-Code-profile.aspx <p>Quite some time ago I posted about the <a href="http://www.harbar.net/archive/2018/08/21/Adding-the-SharePoint-ldquostubsrdquo-to-your-VS-Code-PowerShell-profile.aspx">SharePoint “stubs”</a> – a PowerShell module that allows for remote authoring with intellisense within your favourite PowerShell editor (i.e. VS Code!) on a machine that does not have the SharePoint bits installed. This was put together by the SharePointDSC folks ostensibly to help them with unit testing, but it’s much wider use was around being able to create scripts properly and easily on a remote machine.</p> <p>Well, now the <strong><a href="https://github.com/microsoft/Office365DSC">OfficeDSC</a></strong> project has done the same thing creating a gargantuan “stub” for the cmdlets available in the following services and frameworks:</p> <ul> <li>AzureAD </li> <li>MSOnline </li> <li>ExchangeOnline </li> <li>SharePointOnline </li> <li>PnP </li> <li>Teams </li> <li>SkypeForBusiness </li> <li>SecurityAndCompliance </li> <li>PowerApps </li> </ul> <p>This is seriously awesome! <br /> <br />Head on over to github and download the module from <a href="https://github.com/microsoft/Office365DSC/blob/Dev/Tests/Unit/Stubs/Office365.psm1">https://github.com/microsoft/Office365DSC/blob/Dev/Tests/Unit/Stubs/Office365.psm1</a>. Then of course, you simply Import-Module on that sucker and you are golden for some nice and simple remote authoring without any need for bits and bobs and toolchains and disaster on a nice clean dev machine! Yay!  Of course you can add this to your profile by editing the file located at $profile.</p> <p>If you are curious, they also published the <a href="https://github.com/microsoft/Office365DSC/blob/Dev/Modules/Office365DSC/Modules/O365DSCStubsUtility.psm1">utility that is used to create</a> the stubs. This is somewhat important, as unlike SharePoint which will change once every three years (if we are lucky) Office 365 updates and additions will be much more frequent. <br /> <br />These peeps rock! And this is a must have. Check it out!</p> <p> </p> <p>s.</p><img src="http://www.harbar.net/aggbug/434.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2019/12/17/Adding-the-Office-365-ldquostubsrdquo-to-your-VS-Code-profile.aspx Tue, 17 Dec 2019 18:14:28 GMT http://www.harbar.net/archive/2019/12/17/Adding-the-Office-365-ldquostubsrdquo-to-your-VS-Code-profile.aspx#feedback http://www.harbar.net/comments/commentRss/434.aspx Azure AD &amp; SharePoint (On-Premises) update following SPS Lisbon and ESPC Platform Hygiene SharePoint 2013 SharePoint 2016 SharePoint 2019 Speaking http://www.harbar.net/archive/2019/12/14/Azure-AD-amp-SharePoint-On-Premises-update-following-SPS-Lisbon.aspx <p>Here’s a quick update on the issue that occurred during my recent Azure AD and SharePoint sessions at SharePoint Saturday Lisbon and ESPC.</p> <p>For those interested, once I had configured the AAD Enterprise Application and created a Trusted Identity Provider in SharePoint to use it – and attempted a (seemingly successful) login via AAD the glorious Yellow Page of Death was returned by the SharePoint Web Application. </p> <p>It was, perhaps obviously, a basic error – albeit one that is not *that* obvious, especially when you are brutalised by a head cold and a very dodgy furry podium! :)  After booting the machines and going thru the motions to reproduce the error with a clean configuration, the event log held the answer…</p> <p>After the AAD login process, everyone’s third favourite ASP.NET event is logged – 1309. Useless in it’s own right, but the inner exception bubbles up is a “specified argument was out of the range of valid values” – from <strong>CreateSessionSecurityToken</strong>. Experience (mostly with legacy ADFS) told me straight away to check the system clock – and yes – the time is out by one hour. One hour ahead of the actual time. Thus the expected behaviour. It doesn’t work. Good! It’s not supposed to.  it would be a pretty shitty authentication mechanism if time wasn’t part of the token!!</p> <p>Alas, the SharePoint error is as much use as a fart in a spacesuit – but hey, this *is* SharePoint we are talking about – and as referenced in the presentation – there are no changes in the core of AuthN/Z within the On-premises product.</p> <p>So, a rookie error – but it seems after a recent VMWare update the time sync had been disabled. As soon as I fixed the time and reattempted a login as Miles Davis, everything works, and I was taken back to the default Sharing/Request Access UX.</p> <p>Simple. It always is.  Totally my fault. But i’m blaming all the silly time zone madness I’ve had to accommodate over the last six months!</p> <p> </p> <p>s.</p><img src="http://www.harbar.net/aggbug/433.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2019/12/14/Azure-AD-amp-SharePoint-On-Premises-update-following-SPS-Lisbon.aspx Sat, 14 Dec 2019 22:06:21 GMT http://www.harbar.net/archive/2019/12/14/Azure-AD-amp-SharePoint-On-Premises-update-following-SPS-Lisbon.aspx#feedback http://www.harbar.net/comments/commentRss/433.aspx There were giants in those days, there are giants these days. http://www.harbar.net/archive/2018/10/22/There-were-giants-in-those-days-there-are-giants-these.aspx <p>Patrick was my friend. </p> <p>He was more a personal friend than a professional acquaintance, not to say he didn’t influence me professionally. There is no one in the SharePoint-verse who does not owe a debt of gratitude to Patrick. These days, now the community has grown so large around the world, and in some ways has become overly narcissistic it’s easy to overlook how it all begun, with the selfless and kind contributions of a small band of people. Patrick “Profke” Tisseghem was foremost among them. He was also a first rate engineer and teacher – a rare breed indeed. Most importantly, he was wickedly funny and always kind.</p> <p>Ten years since he passed way too soon, the folks at the Belgian Information Worker User Group, of which he was a founding father, and some of his friends put together a touching tribute at the SharePoint Saturday Belgium event in Brussels. With their permission, you can check it out. Apologies in advance for the amateur camerawork.</p> <p><iframe height="315" allowfullscreen="allowfullscreen" src="https://www.youtube.com/embed/kTvF7ldIx4U" frameborder="0" width="560" allow="autoplay; encrypted-media"></iframe></p> <p>Thank you, Patrick.</p><img src="http://www.harbar.net/aggbug/429.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/10/22/There-were-giants-in-those-days-there-are-giants-these.aspx Mon, 22 Oct 2018 13:18:23 GMT http://www.harbar.net/archive/2018/10/22/There-were-giants-in-those-days-there-are-giants-these.aspx#feedback http://www.harbar.net/comments/commentRss/429.aspx Adding the SharePoint &ldquo;stubs&rdquo; to your VS Code PowerShell profile Platform Hygiene SharePoint SharePoint 2013 SharePoint 2016 SharePoint 2019 PowerShell http://www.harbar.net/archive/2018/08/21/Adding-the-SharePoint-ldquostubsrdquo-to-your-VS-Code-PowerShell-profile.aspx <p><font color="#ff0000">[update] if you use OneDrive to store your Documents – the default on a new install of Windows 10 - you must ensure the WindowsPowerShell folder exists and is set to be “always on this device”.</font></p> <p>Ahh, SharePoint. Ahh, SnapIns. Yeah. 2009 faxed and before the ink faded, told us the old crap is hanging around like a bad hangover. I hate SnapIns more than most, but that’s a story for another day. For the time being we are stuck with them when working with our “built from the cloud up” versions of SharePoint Server. </p> <p>One of the more esoteric problems with SnapIns is a total lack of portability. In many situations you want to author scripts without being on a virtual machine that has SharePoint installed. In these days of “modern” we are mostly doing this in Visual Studio code to take advantage of the reasonably nice PowerShell authoring experience and of course the integration with GitHub and so on. Plus, fancy colours.</p> <p>Thus, how can we get some additional help when authoring? What we need is a “mock” or a “stub” of the SharePoint cmdlets so we can get intellisense.</p> <p>Thanks to the nice chaps who made the SharePoint DSC resources, we can do this easily by grabbing the stub they made (as a Module) and adding it to our PowerShell Profile. We used to do a similar thing back in the day by adding the SnapIn to the PoSh Profile to avoid having to load it when opening up ISE.</p> <p>First thing to do is grab the stub(s). They are included in the <a href="https://github.com/PowerShell/SharePointDsc">SharePointDsc</a> project on GitHub. However, there is no need to grab the whole thing – you can just get the SharePoint 2016 version from <a href="https://github.com/PowerShell/SharePointDsc/blob/master/Tests/Unit/Stubs/SharePoint/16.0.4456.1000/Microsoft.SharePoint.PowerShell.psm1">here</a>. There is also a SharePoint 2013 version <a href="https://github.com/PowerShell/SharePointDsc/blob/master/Tests/Unit/Stubs/SharePoint/15.0.4805.1000/Microsoft.SharePoint.PowerShell.psm1">here</a>. Save that bad boy on your machine someplace sensible. I put it in my <font face="Courier New">_ScriptLibrary</font> folder which lives in my OneDrive. Note there is also a stub for Distributed Cache which lives <a href="https://github.com/PowerShell/SharePointDsc/blob/master/Tests/Unit/Stubs/DistributedCache/DistributedCache.psm1">here</a>.</p> <p>Now you have the stub we can add it to our PowerShell profile. Open up VSCode and make sure you are in a PowerShell session. Go to the Terminal and type <font face="Courier New">$profile.</font> This will display your current profile file location.</p> <p><a href="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/1.png"><img title="1" style="display: inline; background-image: none;" border="0" alt="1" src="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/1_thumb.png" width="754" height="173" /></a></p> <p>By default that file doesn’t exist yet so the simplest way to create it is to type <font face="Courier New">notepad $profile</font>, which will open up Notepad and prompt you to create it.</p> <p><a href="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/2.png"><img title="2" style="display: inline; background-image: none;" border="0" alt="2" src="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/2_thumb.png" width="754" height="470" /></a></p> <p>Then simply Import the module using the path to the stub file, my profile looks like this:</p> <pre class="brush: powershell; "># SharePoint 2016 Stub Import-Module "C:\Users\harbars\OneDrive\_Script Library\Microsoft.SharePoint.PowerShell.psm1" </pre> <script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shCore.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPlain.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushAS3.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushBash.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushColdFusion.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushCpp.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushCss.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushDelphi.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushErlang.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushFSharp.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushDiff.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushGroovy.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushJScript.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushJava.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushJavaFX.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushMatlabKey.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushObjC.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPerl.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPhp.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPowerShell.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPython.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushRuby.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushScala.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushSql.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushVb.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushXml.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushCSharp.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushClojure.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushR.js"></script><script type="text/javascript"><![CDATA[ (function(){ var corecss = document.createElement('link'); var themecss = document.createElement('link'); var corecssurl = "http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCore.css?m=1370811927g&amp;ver=3.0.83c"; if ( corecss.setAttribute ) { corecss.setAttribute( "rel", "stylesheet" ); corecss.setAttribute( "type", "text/css" ); corecss.setAttribute( "href", corecssurl ); } else { corecss.rel = "stylesheet"; corecss.href = corecssurl; } document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") ); var themecssurl = "http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shThemeDefault.css?m=1363304414g&amp;ver=3.0.83c"; if ( themecss.setAttribute ) { themecss.setAttribute( "rel", "stylesheet" ); themecss.setAttribute( "type", "text/css" ); themecss.setAttribute( "href", themecssurl ); } else { themecss.rel = "stylesheet"; themecss.href = themecssurl; } //document.getElementById("syntaxhighlighteranchor").appendChild(themecss); document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") ); })(); SyntaxHighlighter.config.strings.expandSource = '+ expand source'; SyntaxHighlighter.config.strings.help = '?'; SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n'; SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: '; SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: '; SyntaxHighlighter.defaults['pad-line-numbers'] = false; SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); ]]></script> <p>Save that file and close Notepad. The next time you open a VSCode PowerShell session the module will be imported and you will see a lovely warning about the made up verbs the SharePoint development team thought would be OK back in 2008! Chortles. </p> <p>But never mind that (for the time being) we now have intellisense for the SharePoint cmdlets.</p> <p><a href="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/3.png"><img title="3" style="display: inline; background-image: none;" border="0" alt="3" src="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/3_thumb.png" width="754" height="379" /></a></p> <p>I actually tweak the profile a little so the warning is removed, and I add a message to say the Stub was loaded.</p> <pre class="brush: powershell; "># SharePoint 2016 Stub Import-Module "C:\Users\harbars\OneDrive\_Script Library\Microsoft.SharePoint.PowerShell.psm1" Clear-Host Write-Output "SharePoint Stub Loaded" </pre> <div><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shCore.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPlain.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushAS3.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushBash.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushColdFusion.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushCpp.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushCss.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushDelphi.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushErlang.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushFSharp.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushDiff.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushGroovy.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushJScript.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushJava.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushJavaFX.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushMatlabKey.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushObjC.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPerl.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPhp.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPowerShell.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPython.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushRuby.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushScala.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushSql.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushVb.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushXml.js"></script><script type="text/javascript" src="http://s2.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushCSharp.js"></script><script type="text/javascript" src="http://s1.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushClojure.js"></script><script type="text/javascript" src="http://s0.wp.com/wp-content/plugins/syntaxhighlighter/third-party-brushes/shBrushR.js"></script><script type="text/javascript"><![CDATA[ (function(){ var corecss = document.createElement('link'); var themecss = document.createElement('link'); var corecssurl = "http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCore.css?m=1370811927g&amp;ver=3.0.83c"; if ( corecss.setAttribute ) { corecss.setAttribute( "rel", "stylesheet" ); corecss.setAttribute( "type", "text/css" ); corecss.setAttribute( "href", corecssurl ); } else { corecss.rel = "stylesheet"; corecss.href = corecssurl; } document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") ); var themecssurl = "http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shThemeDefault.css?m=1363304414g&amp;ver=3.0.83c"; if ( themecss.setAttribute ) { themecss.setAttribute( "rel", "stylesheet" ); themecss.setAttribute( "type", "text/css" ); themecss.setAttribute( "href", themecssurl ); } else { themecss.rel = "stylesheet"; themecss.href = themecssurl; } //document.getElementById("syntaxhighlighteranchor").appendChild(themecss); document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") ); })(); SyntaxHighlighter.config.strings.expandSource = '+ expand source'; SyntaxHighlighter.config.strings.help = '?'; SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n'; SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: '; SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: '; SyntaxHighlighter.defaults['pad-line-numbers'] = false; SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); ]]></script> <p><a href="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/4.png"><img title="4" style="display: inline; background-image: none;" border="0" alt="4" src="http://harbar.net/images/www_harbar_net/Open-Live-Writer/Adding-the-SharePoint-stubs-to-your-VS-C_A324/4_thumb.png" width="754" height="151" /></a></p> <p>Just a simple trick to get the SharePoint cmdlets on a machine without SharePoint installed. Enjoy. And don’t go making up any verbs! :)</p> <p>s.</p> </div><img src="http://www.harbar.net/aggbug/428.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/08/21/Adding-the-SharePoint-ldquostubsrdquo-to-your-VS-Code-PowerShell-profile.aspx Tue, 21 Aug 2018 11:21:50 GMT http://www.harbar.net/archive/2018/08/21/Adding-the-SharePoint-ldquostubsrdquo-to-your-VS-Code-PowerShell-profile.aspx#feedback http://www.harbar.net/comments/commentRss/428.aspx European Collaboration Summit follow up: Tutorial Scripts and Identity Manager Demos FIM Platform Hygiene SharePoint SharePoint 2016 SharePoint 2019 Speaking User Profiles MIM http://www.harbar.net/archive/2018/06/26/European-Collaboration-Summit-follow-up-Tutorial-Scripts-and-Identity-Manager.aspx <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/European-Collaboration-Summit-follow-up_12359/13886357_1081186301972836_5470626544742346563_n_2.png"><img title="13886357_1081186301972836_5470626544742346563_n" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 0px 10px 0px 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="13886357_1081186301972836_5470626544742346563_n" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/European-Collaboration-Summit-follow-up_12359/13886357_1081186301972836_5470626544742346563_n_thumb.png" width="204" align="left" height="204" /></a>Many thanks to everyone who attended the <strong>European Collaboration Summit</strong> in Mainz, Germany, last month. It’s safe to say that the event overall was a runaway success and yes, we have already started planning for <a href="http://www.collabsummit.eu/">the 2019 edition</a>! <br /> <br />At the event, I promised to publish some additional resources. These are a little later than I had hoped but with a new job and a variety of “more important” things on a rather large to-do list, the delay was inevitable. At any rate, this post serves as a landing page for these resources.</p> <h3>Tutorial Attendees: SharePoint 2016 Automation Toolkit</h3> <p>For those who attended the Infrastructure PowerClass hosted by Thomas Vochten and I, the scripts we showed and discussed for building out the On Premises portions of the Hybrid Labs are <a href="https://github.com/harbars/SPAT16"><strong>over here on GitHub</strong></a>. This toolkit has been used to build thousands of customer farms and has also been used at other pre/post conference events such as Microsoft Ignite. More details and so on can be found in the readme. I am not offering support for this toolkit. I will answer questions on it if they are easy to deal with quickly. But I will not be engaging in any debates about their worth, nor any religious arguments about DSC! :) </p> <a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/European-Collaboration-Summit-follow-up_12359/2018-06-26_20-58-01_2.png"><img title="2018-06-26_20-58-01" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 0px 10px 0px 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2018-06-26_20-58-01" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/European-Collaboration-Summit-follow-up_12359/2018-06-26_20-58-01_thumb.png" width="244" align="left" height="153" /></a>The 2013 version will be published over the next couple of weeks. <br /> <p>Don’t worry about GitHub if you are not familiar with it. <br />Within the page, there is the ability to download the files as a ZIP file – without having to do the whole “install some tools, clone, open” dance that the developers love so much! :)</p> <p> </p> <h3>Identity Manager &amp; SharePoint Server Demos</h3> <p>During my session on User Profiles there wasn’t enough time to complete the demonstrations. As promised I’ve put together a 90 minute video of the complete demos, with some additional explanations and remarks.  This is hosted over on YouTube. Apologies in advanced for the slightly annoying sound quality. I had, erm, a slight ‘accident’ with my mic stand earlier today that will mean a trip to the music store in the near future – drat! :) </p> <p><iframe height="480" src="https://www.youtube.com/embed/mrz8D0KUKMs" frameborder="0" width="800" allowfullscreen="allowfullscreen" allow="autoplay; encrypted-media"></iframe></p> <p> </p> <h3>Identity Manager &amp; SharePoint Server Scripts</h3> <p>All of the scripts used within the above demos, and indeed at other conferences, are also available <a href="https://github.com/harbars/UserProfileSyncUtilities"><strong>over here on GitHub</strong></a>. <br /> <br /> <br />I hope some of you find these resources useful and once again, thanks for helping make #CollabSummit 2018 the single best community technology event on the planet!</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/European-Collaboration-Summit-follow-up_12359/34747662_1760481667376626_617131227853357056_o_2.jpg"><img title="34747662_1760481667376626_617131227853357056_o" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="34747662_1760481667376626_617131227853357056_o" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/European-Collaboration-Summit-follow-up_12359/34747662_1760481667376626_617131227853357056_o_thumb.jpg" width="644" height="384" /></a></p> <p> </p> <p>I’m outta here like I dropped a couple tables in a production database!</p> <p>s.</p><img src="http://www.harbar.net/aggbug/427.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/06/26/European-Collaboration-Summit-follow-up-Tutorial-Scripts-and-Identity-Manager.aspx Tue, 26 Jun 2018 21:28:12 GMT http://www.harbar.net/archive/2018/06/26/European-Collaboration-Summit-follow-up-Tutorial-Scripts-and-Identity-Manager.aspx#feedback http://www.harbar.net/comments/commentRss/427.aspx RPC Server Unavailable when creating a SharePoint Farm&hellip; the curse of dodgy legacy NetDOM! SharePoint SharePoint 2010 SharePoint 2013 SharePoint 2016 Platform Hygiene SharePoint 2019 http://www.harbar.net/archive/2018/06/25/RPC-Server-Unavailable-when-creating-a-SharePoint-Farmhellip-the-curse.aspx <p>Every so often a real blast from the past comes back to haunt me. Usually it’s some obscure “infrastructure” gubbins – you know, the sort of thing that 80% of so called IT Pros knew in 1999. These days thou. Not so much.</p> <p>With SharePoint in particular there is a whole boat load of legacy. Not that legacy is bad. Lot’s of it is awesome. That’s why the product remains so successful. On the other hand some of it is real, real, real nasty!  :) </p> <p>It always seems to come in waves. Over the last two weeks I’ve had six emails regarding problems creating the first server in a SharePoint Farm. The ye olde <em>“An error occurred while getting information about the user SPFarm at server fabrikam.com: The RPC server is unavailable”.</em></p> <p>Naturally, there are a whole bunch of wild goose chases out there on the interwebz about how to potentially resolve this issue. Most of them are complete claptrap. Or even worse, a ‘support bot’ automated answer, something like “are you running as an administrator?” :)</p> <p>Now this old chestnut can have a multitude of root causes and the API that raises this exception isn’t very clever about that – it just bubbles it back up the stack. As you might imagine, when SharePoint was first developed nobody was sat there running through all the various deployment scenarios and fire testing every code path to ensure a nice neat experience for the next 20+ years.  But more importantly 17-18 years ago, idempotent, designed to be managed via automation and state independence were not so much of a thing as they are now.  Let’s say we do it via PowerShell using <font face="Consolas">New-SPConfigurationDatabase</font>. That isn’t doing one thing. It’s doing a WHOLE BUNCH of things. All masked via the Server Side OM. The same is true if we use the Configuration Wizard. After all, they are both simply masks or wrappers for the OM.</p> <p>The real problem with this error (and others like it), when creating a Farm, is that it only partly fails. The Configuration database is created on the SQL Server. It’s sitting there pretty happy. Indeed, it will have 711 Objects. <font face="Consolas">New-SPConfigurationDatabase</font> has sorta kinda worked. Even though it’s raised an exception. But it’s not really worked, and as soon as we go to the next stage of farm creation (typically <font face="Consolas">Initialize-SPResourceSecurity</font>) that will fail as well, with the error <em>“Cannot perform security configuration because the configuration database does not exist.  You must create or join to a configuration database before doing security configuration.”</em></p> <p>Interesting. Most people will actually check if the Farm exists after<font face="Consolas"> New-SPConfigurationDatabase</font> by calling <font face="Consolas">Get-SPFarm</font>. This is mainly because the very first “build a farm using PowerShell” posts included this. However, in this case – it is entirely worthless. because <font face="Consolas">Get-SPFarm</font> will report the farm exists and that it is <font face="Consolas">Online</font>.</p> <p>The sample script that virtually everyone has been following since SharePoint 2010 is entirely flawed. There is zero point in calling <font face="Consolas">Get-SPFarm</font> at this point. If <font face="Consolas">New-SPConfigurationDatabase</font> works it appears to be a nice little bit of defensive coding. And it does actually deal with some other errors that can occur. But it won’t help in the case of bubbled up exceptions from dependencies.</p> <p>What we ACTUALLY should be doing here is <em><strong>restarting the PowerShell session entirely</strong></em>. Indeed if you try and do anything which would otherwise be sensible, like removing and adding the Snap In – it will likely crash the process anyway. Indeed. if you just leave it sitting there for a bit, the process will crash all on it’s own. How do you like those apples?</p> <p>This is an absolutely critical thing to realise about the Administration OM and the PowerShell that wraps it. This is why delivering true desired state configuration for SharePoint is currently impossible. The only way to catch this is to catch it. Neither the OM nor the PowerShell cmdlets are designed or developed to be leveraged in an automation first approach. Doesn’t mean we can’t get pretty close, but as soon as you start delving into the details, it becomes obvious just how much work is required to do all the things the back end OM doesn’t.  And how exactly does one create a DSC resource that can detect a failed process, know exactly when it failed, and kick off another one to carry on? Yeah, exactly.</p> <p>Again, SharePoint itself doesn’t handle the exception it just bubbles it back. It does no clean up. Our box is shafted. So to speak. Until we delete the database, and of course restart (or create a new) PowerShell session. Thus, in order to deal with this properly, we’d need to catch the specific exception and handle it appropriately. Do some remoting and kill the database (using SQL Server PowerShell), then restart our session. In other words clean up after the mess that SharePoint has made for us. </p> <p>But of course we also need to fix the root cause of the problem before retrying.</p> <p>“The RPC server is unavailable” is one of the classic, generic, “we have no idea what happened, throw this” errors. Now we live in a modern, transformed, cloud first world, we only have one generic error, “access denied” :). But back in the day, when type was understood, we had lots of them.</p> <p>Sometimes the RPC server really is unavailable. But when creating a SharePoint Farm there is a 98% chance your machine has multiple Network Interfaces, and the prioritised (default) NIC cannot route to the SQL Server. It looks like this.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/RPC-Server-Unavailable-when-creating-a-f_A61E/2018-06-25_12-51-09_2.png"><img title="2018-06-25_12-51-09" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2018-06-25_12-51-09" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/RPC-Server-Unavailable-when-creating-a-f_A61E/2018-06-25_12-51-09_thumb.png" width="434" height="484" /></a></p> <p>In this example “Ethernet1” is a shared network to a backup device. The customer is using this network to separate farm traffic from management traffic. Is that a good idea? Well that’s a post for another time (or perhaps not!) but the thing is it’s extremely common. Even in IaaS lots of people do this.</p> <p>If I move the “10net” network to the top of the list. Hey presto. No more RPC server is unavailable. It’s a common gotcha. The trouble is most people don’t know there even IS a NIC order. Never mind where in the UI to configure it. For over a decade all but one causes of this error, where I’ve been involved either as escalation or hands on, has been the NIC order.  It’s in my checklist before deploying farms – not that I really do that anymore, but whatever, that checklist doesn’t get updated much.</p> <p>The good news is we can fix it with PowerShell, decent PowerShell…. <br /><font face="Consolas">Set-NetIPInterface -InterfaceIndex &lt;index&gt; -InterfaceMetric &lt;new metric&gt;</font></p> <p>It of course shouldn’t be this way – the reason it is – is because the SharePoint APIs (especially the core Farm Admin ones) rely on some real legacy. In this case, what old timers refer to as the NetDOM stack. That’s an in joke related to an old utility used to hack AD things, back before there was a RTM AD and Microsoft were still doing NetBIOS. Now, it works. But that is the depth of a product like this. A rabbit’s warren of more or less every API made by Microsoft from around 1996 through to today. It would take a brave (and quite possibly barking mad) person indeed to make the decision to re-architect and re-implement the core admin stack. <br /> <br />Anyway the point of this post was to:</p> <ul> <li>document the 98% case cause and resolution (fix the NIC order, even if only temporarily whilst the farm is built) so I don’t have to actually explain it ever again (I hope!)</li> <li>provide a worked example of the importance of understanding how things are actually built, rather than merely the mask of veneer that so many products have today.</li> </ul> <p>Not to be all Donald Rumsfeld, but remember with most things in life, and especially SharePoint - The more you know, the more you know you don’t know. You know?! :)</p> <p>s.</p><img src="http://www.harbar.net/aggbug/426.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/06/25/RPC-Server-Unavailable-when-creating-a-SharePoint-Farmhellip-the-curse.aspx Mon, 25 Jun 2018 12:15:29 GMT http://www.harbar.net/archive/2018/06/25/RPC-Server-Unavailable-when-creating-a-SharePoint-Farmhellip-the-curse.aspx#feedback http://www.harbar.net/comments/commentRss/426.aspx Welcome to our family! SharePoint Platform Hygiene Speaking SharePoint 2013 Office 365 SharePoint 2016 http://www.harbar.net/archive/2018/05/16/Welcome-to-our-family.aspx <p>The building block of every community is a family. Welcome to our family.</p> <p>See you in Mainz!</p> <video width="600" controls=""><source type="video/mp4" src="http://www.harbar.net/ECS2018-Trailer-Final.mp4" />Your browser does not support the video tag. </video><img src="http://www.harbar.net/aggbug/425.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/05/16/Welcome-to-our-family.aspx Wed, 16 May 2018 11:10:43 GMT http://www.harbar.net/archive/2018/05/16/Welcome-to-our-family.aspx#feedback http://www.harbar.net/comments/commentRss/425.aspx Resolving Catastrophic Distributed Cache Failures on VMWare vSphere or ESX guest virtual machines Distributed Cache Platform Hygiene SharePoint SharePoint 2013 SharePoint 2016 http://www.harbar.net/archive/2018/04/27/Resolving-Catastrophic-Distributed-Cache-Failures-on-VMWare-vSphere-or-ESX.aspx <p>Ahh, Distributed Cache, everybody’s favourite SharePoint service instance, the most reliable and trouble-free implementation since User Profile Synchronization. I jest of course, it’s the most temperamental element of the current shipping release, not to mention the most ridiculous false dependency ever introduced into the product and should be killed as soon as possible. However, it is extremely important to a SharePoint Farm in terms of both functionality and ensuring maximum performance. Even in simple deployments the impact of the Search and LogonToken related caches can provide ~20% performance and throughput improvements.</p> <p>But what to do when it’s busted? Once Distributed Cache gets out of whack all bets are off and you are best throwing away the cache cluster and starting again, cleanly. This procedure has been documented by yours truly in the past. But it doesn’t help if no matter how many times you follow this procedure to the letter the service doesn’t stay up. Your Cache Hosts report “DOWN” or “UNKOWN”, and the Windows Service is either stopped, or faults immediately after starting.</p> <p>This occurs often in misconfigured VMWare environments (vSphere and ESX). And it’s all down to the relationship between the guest configuration and the AppFabric configuration. As you hopefully know, SharePoint server is <b>not</b> supported with Dynamic Memory. Dynamic Memory is Microsoft speak for dynamically adjusting the RAM allocated to a guest. In VMWare this is actually the default configuration. The system estimates the working set for a guest based on memory usage history. Whilst the common statement is that dynamic memory will cause “issues with Distributed Cache” it’s a bit more serious than this in the real world.</p> <p>Generally speaking Guest VMs are provisioned by an infrastructure team responsible for the VM platform, and in almost all cases, the request to reserve all memory will either be not understood or ignored. This leads to the VM being configured with the defaults. If you are in control of setting up the guests then life is easy, you just ensure that the “Reserve all guest memory (All locked)” option is selected with the guest properties BEFORE you even install the SharePoint bits.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Resolving-Catastrophic-Distributed-Cache_107D2/pic1_2.png"><img title="pic1" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="pic1" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Resolving-Catastrophic-Distributed-Cache_107D2/pic1_thumb.png" width="541" height="484" /></a></p> <p>However, if you are in a situation where this was not configured originally and on that guest a SharePoint server is added to the farm and is running Distributed Cache things will go south quickly leading to a broken Distributed Cache. Even if you go back and select the option later, it’s hosed. The last machine which joins the cache cluster basically takes over. Just like with changing the service account – which resets cache size. The last one wins. Or in this case, totally hoses your farm.</p> <p>One of the reasons the Distributed Cache and Dynamic Memory don’t get along, aside complete ignorance is that the Cache Cluster Configuration is not modified based on the memory resource management scheme in place (AppFabric includes this support, but it’s not exposed via the SharePoint configuration set).</p> <p>The default Cache Partition Count varies for different memory resource management schemes. So, once we change that, we need to alter this configuration. If we install fresh on a new guest correctly configured it’s set automatically.</p> <p>In this situation we need to deal with it ourselves, and as always there is zero (until now) documentation on this issue. This info has been used to support hundreds of customers via CSS cases over the last few years (I don’t know why it hasn’t been published properly).</p> <p>Here’s the fix:</p> <p>1. You need a Cache Cluster – it doesn’t need to be working (!) but if you’ve deleted all the service instances and so on, you need to bring back a broken Distributed Cache first.</p> <p>2. Use the following PowerShell to export the Cache Config to a file on disk <br /> </p><pre class="brush: ps;">Use-CacheCluster Export-CacheClusterConfig c:\distCacheConfig.xml</pre> <p>3. Edit the XML file so that the partitionCount is 32: <br /> </p><pre class="brush: ps;">&lt;caches partitionCount="32"&gt;</pre> <p>4. Save the XML file</p> <p>5. Use the following PowerShell to ensure the Cache Cluster is stopped and import the modified configuration, and then Start the Cache Cluster (this time it will actually start!) <br /> </p><pre class="brush: ps;">Stop-CacheCluster # should report all hosts down Import-CacheClusterConfig C:\distCacheConfig.xml Start-CacheCluster</pre> <p>6. Once you’ve done this you can use the standard tooling to report on the cluster or use my PowerShell module, each host in the cluster will report “UP” and you can interrogate the individual caches to verify they are being populated. You will of course need to modify your cache size if you have changed it previously, or wish to. Do it now before it starts being used!</p> <p> </p> <p>Happy days!</p> <p> </p> <p>s.</p><img src="http://www.harbar.net/aggbug/423.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/04/27/Resolving-Catastrophic-Distributed-Cache-Failures-on-VMWare-vSphere-or-ESX.aspx Fri, 27 Apr 2018 17:48:34 GMT http://www.harbar.net/archive/2018/04/27/Resolving-Catastrophic-Distributed-Cache-Failures-on-VMWare-vSphere-or-ESX.aspx#feedback http://www.harbar.net/comments/commentRss/423.aspx Update: Using WMU to transfer NEFs to iOS for editing etc. Photography http://www.harbar.net/archive/2018/04/19/Update-Using-WMU-to-transfer-NEFs-to-iOS-for-editing.aspx <p>In a previous post I showed <a href="http://www.harbar.net/archive/2016/09/14/Using-Nikon-Wireless-Utility-with-the-Nikon-D500-on-iOS.aspx"><strong>Using Nikon Wireless Utility with the Nikon D500 on iOS to download NEFs to iOS</strong></a><strong> </strong>which worked for a while. However Nikon made some significant updates to SnapBridge – making it actually much better in terms of connection ease and reliability and remote photography. It’s still not much of a bridge to your snaps thou – it still restricts you to the silly 2Mb file and it only transfers JPEGs which means you need to be shooting them. Rubbish. These updates also break the procedure detailed previously.</p> <p>I fiddled around with <a href="https://dslrdashboard.info/phpBB3/viewtopic.php?f=4&amp;t=2384"><strong>qDslrDashboard</strong></a> – but alas this is not available in the UK iOS Store. And even on a Windows PC I could not get the machine to connect to the D500 or D850 wireless.</p> <p>It turns out it’s so much easier now – still using WMU. <strong>BUT you need two devices. </strong>So a hoop jump, but here’s the updated procedure.</p> <ol> <li>Pair your camera with SnapBridge on device one (I'm using an iPhone) as normal. </li> <li>Click <strong>Remote Photography</strong> or <strong>Download Pictures</strong> – it doesn’t matter, as long as you do something to initiate the Wireless connection on the camera.  Click <strong>OK</strong> to enable the camera Wi-Fi, and wait whilst it’s started. When the Join screen appears, <em><strong><font color="#ff0000">do NOT click Join</font></strong></em>. <br /> <br />Note the Wi-Fi Network name, which will be the camera model_serial number, e.g. D850_6666666 <br /> <br /><strong><em><font color="#ff0000">Leave device one on this screen. </font></em></strong> <br /> <br /><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/2018-05-10_09-38-27_2.png"><img title="2018-05-10_09-38-27" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2018-05-10_09-38-27" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/2018-05-10_09-38-27_thumb.png" width="274" height="484" /></a> <br /></li> <li>On device two (I’m using an iPad Pro) connect to the camera Wi-Fi using the regular iOS Settings. The password you can view from the camera menus. It will be NIKONDXXX, where XXX is your camera model. You only need to enter this the first time you connect. <br /> <br /><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/IMG_0424.png"><img title="IMG_0424" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="IMG_0424" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/IMG_0424_thumb.png" width="644" height="252" /></a> <br /></li> <li>Once connected, open up WMU, click <strong>View Photos</strong> – <strong>Pictures on Camera</strong> – then you can browse, select and download images from the camera cards. <br /> <br /><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/IMG_0425.png"><img title="IMG_0425" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="IMG_0425" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/IMG_0425_thumb.png" width="644" height="484" /></a> </li> </ol> <p> </p> <p>And of course these are now available on your device two for editing in Lightroom mobile or whatever. Happy days!</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/IMG_0428.png"><img title="IMG_0428" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="IMG_0428" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/IMG_0428_thumb.png" width="644" height="484" /></a></p> <p> <br />Remember to charge your batteries!!!! <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Update-Using-WMU-to-transfer-NEFs-to-mob_AEAE/wlEmoticon-smile_2.png" /> and have a spare one or three in your pocket. Especially with the D850 these are some BIG ASS NEFs!</p> <p>s.</p><img src="http://www.harbar.net/aggbug/422.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/04/19/Update-Using-WMU-to-transfer-NEFs-to-iOS-for-editing.aspx Thu, 19 Apr 2018 11:52:27 GMT http://www.harbar.net/archive/2018/04/19/Update-Using-WMU-to-transfer-NEFs-to-iOS-for-editing.aspx#feedback http://www.harbar.net/comments/commentRss/422.aspx Using PowerShell to import Profile Photos when using Active Directory Import and SharePoint Server 2013/2016/2019 Platform Hygiene SharePoint SharePoint 2013 SharePoint 2016 User Profiles http://www.harbar.net/archive/2018/02/02/Using-PowerShell-to-import-Profile-Photos-when-using-Active-Directory.aspx <p>One of the most common requests I have received over the last couple years has been how to leverage PowerShell to get User Photos from Active Directory (or any other location really) into the SharePoint User Profile Store. With the removal of User Profile Synchronization (UPS) in SharePoint 2016 this need has increased significantly. For most mid market customers this is a key requirement, and implementing Microsoft Identity Manager (MIM) for this purpose is not practical.</p> <p>I did spend a whole bunch of time before the release of SharePoint 2016 attempting to convince the powers that be, that Active Directory Import (ADI) should include this capability to ease the upgrade pain and so forth. Alas, the goal was to remove UPS, not address the gaps left by it’s removal.</p> <p>At any rate, if the business requirements can be met by ADI, with the exception of User Photos, then MIM is absolutely NOT the right solution. From an architectural perspective, a operational management perspective, and most importantly a cost perspective, it’s just daft. Thus I have always suggested that for this requirement a simple PowerShell script, regularly scheduled is the appropriate approach.</p> <p>Now in essence such a script is simple. We iterate Active Directory, get the photos from thumbnailPhoto, then put them in the Profile Pictures folder within the My Site host. Depending upon operational requirements we can enhance this basic capability with logging and caching of the images on the file system and so forth. </p> <p>Active Directory provides us with two key APIs for this work. We can use the basic APIs exposed nicely thru the ActiveDirectory PowerShell module, or we can use DirSync. DirSync is more complicated, but vastly preferable as it provides a change log as well as much more efficient operations generally. It’s actually how ADI works under the covers (another reason why it’s farcical from a technical perspective why ADI doesn't include this capability). So there’s nothing to install on the box, whereas with the AD PowerShell we have to install the RSAT tools and import the module which is generally not done on a SharePoint server.  We do however require Replicating Directory Changes in order to make use of the change log – use the very same account you use to perform ADI and you’re all set.</p> <p>But then we come to SharePoint! : ) As always it get’s more “interesting”….</p> <p>Firstly, the “Profile Pictures” folder. That bad boy is not created until the very first profile photo is created. And it sits within the “User Photos” folder. i.e. https://mysitehost.fabrikam.com/User Photos/Profile Pictures. somebody, somewhere, somewhen thought this was clever. It is not. Anyway. no biggie. we need to accommodate checking it exists and if not, creating it.</p> <p>Secondly the file name of the images, before they are “translated” into usable images by Update-SPProfilePhotoStore. This is a real problem because they include a “default partition ID”. There is no public API to discover this value. There is a way to get it but that involves calling a legacy web service which is unsupported (this is how Microsoft themselves do it in the MIM SharePoint Management Agent). The good news is that this GUID is the same on every SharePoint 2013/2016/2019 deployment.  So we can just slap it in as variable and use it to splat the filename. But we need to be aware that this means the solution will only work with a non partitioned UPA. and of course there is a possibility this GUID may change in the future.</p> <p>We also still need to run Update-SPProfilePhotoStore once the import is complete, to create the three thumbnails that SharePoint uses.</p> <p>We also need to ensure that both the import script and Update-SPProfilePhotoStore are run on a machine hosting the User Profile Service service instance. The latter will not raise any exception if it is run elsewhere, it merely does nothing and quits!</p> <p>With all this said in terms of brief explanation, the basic script from <strong>Adam Sorenson</strong> can be found over at <a title="https://gallery.technet.microsoft.com/SharePoint-User-Profile-928b39c0" href="https://gallery.technet.microsoft.com/SharePoint-User-Profile-928b39c0"><strong>https://gallery.technet.microsoft.com/SharePoint-User-Profile-928b39c0</strong></a>.  You can update the initial variables to suit your environment. You will also need a “dummy” DNLookup.xml as described over at <a title="https://blogs.technet.microsoft.com/adamsorenson/2017/05/24/user-profile-picture-import-with-active-directory-import/" href="https://blogs.technet.microsoft.com/adamsorenson/2017/05/24/user-profile-picture-import-with-active-directory-import/">https://blogs.technet.microsoft.com/adamsorenson/2017/05/24/user-profile-picture-import-with-active-directory-import/</a>.</p> <p>Now yes, there are lots of things “wrong” with this script. Some are the fault of SharePoint as previously discussed, and others are more regarding operational management. But the point of posting is that this is a <strong><em>start point for which you can build out what you need</em></strong>. For example you may not wish to cache images on the file system (although for large environments that is a good idea). Further you would look to clean up the PowerShell and/or make it into a module and so on. Also watch out for the LDAP filter that’s used, this may not reflect your requirements.  I would also remove the horrible legacy API for alternative credentials.  Otherwise, this script is actually more or less identical to mine, except that I split out the gathering of photos to support Urls as well as Thumbnails, and I used the “private” API for the “partition ID” as I was looking for a way to encourage the powers that be to provide a public API (and needed a solution for Multi Tenant). <br /></p> <p>If there is enough interest I will publish my PowerShell Module but this script is all you need to get started…</p> <p> </p> <p>s. </p><img src="http://www.harbar.net/aggbug/421.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2018/02/02/Using-PowerShell-to-import-Profile-Photos-when-using-Active-Directory.aspx Fri, 02 Feb 2018 19:02:07 GMT http://www.harbar.net/archive/2018/02/02/Using-PowerShell-to-import-Profile-Photos-when-using-Active-Directory.aspx#feedback 2 http://www.harbar.net/comments/commentRss/421.aspx Configuring a Partitioned UPA in SharePoint 2016 with Active Directory Import Platform Hygiene SharePoint SharePoint 2016 User Profiles FIM http://www.harbar.net/archive/2017/08/08/Configuring-a-Partitioned-UPA-in-SharePoint-2016-with-Active-Directory.aspx <h3>Introduction</h3> <p>For about a year now I’ve been plagued by people asking me how to configure a partitioned User Profile Application (UPA) in SharePoint Server 2016, <b><i>and</i></b> perform successful profile import using Active Directory Import (ADI). Every few weeks someone asks for the configuration, and it basically got to the point where it made sense to post this article to which I can refer folks.</p> <p>Now, I am not going to provide all up coverage here. I expect you to be familiar with the fundamental concepts of SharePoint Multi-Tenancy. You can head over to my other articles <a href="http://www.harbar.net/articles/sp2010mt1.aspx">here</a> (2010), <a href="http://www.harbar.net/articles/sp2013mt.aspx">here</a> (2013), and on <a href="https://technet.microsoft.com/en-us/library/dn659286.aspx">TechNet</a> for that information. All I am going to do in this article is outline the changes in the configuration of the UPA and ADI because of the removal of UPS from SharePoint 2016. I’ll also point out a couple of significant gotchas which are imperative to plan for.</p> <p>Having said that, it would be remiss to not state categorically that <b><i>multi-tenancy is absolutely NOT something most customers should be doing</i></b>. Neither I, or Microsoft, recommend this deployment approach in any way whatsoever because virtually no one has the time, money or expertise to implement all of the things out with the SharePoint product which are necessary to be successful. Indeed, one of the most significant non-Microsoft deployments of multi-tenant SharePoint which used to exist, no longer does – mainly because that vendor decided it was not worth it. You’ve been warned.</p> <p> </p> <h3>What’s different about SharePoint 2016?</h3> <p>Only one thing basically, but it’s a significant element. As you will be aware User Profile Synchronization (UPS) is no longer part of SharePoint Server. In 2010 and 2013 UPS was used to perform profile synchronization with a partitioned UPA. This was the canonical and recommended deployment approach.</p> <p>We set up a directory structure that looked something like this:</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/image_2.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/image_thumb.png" width="128" height="77" /></a></p> <p>A “base” OU (in this case Customers) which included a OU per tenant. We then configured UPS to sync with the base OU, and it used the <strong>SiteSubscriptionProfileConfig</strong> to match up each tenant to the child OUs using a simple string match.</p> <p>As UPS is no longer available, we must use Active Directory Import to perform synchronization. For a long time during pre-release versions of SharePoint 2016, it was not possible to configure this due to a bug. This lead to statements such as “sync with a partitioned UPA is not supported”. This was never the case, and it was simply a few bugs that were resolved with the RTM of the product.</p> <p>On the face of it pretty simple. However, there is some “interesting” configuration required in order to get things working correctly, and also extremely important planning considerations around how you manage synchronization operations which were not present in previous versions.</p> <p> </p> <h3>What’s the same as previous versions?</h3> <p>Pretty much everything. Creating Site Subscriptions, their Tenant Administration sites and provisioning initial member sites is identical. We don’t need change our tenant provisioning scripts in this respect. </p> <p>Just like previous versions we need to tell the UPA about these new Subscriptions as they are created. If we browse to a Tenant Administration site, and click the <b>Manage User Profile Application</b> link we will see the following error.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image002_2.jpg"><img title="clip_image002" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image002" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image002_thumb.jpg" width="644" height="222" /></a></p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image004_2.jpg"><img title="clip_image004" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image004" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image004_thumb.jpg" width="644" height="201" /></a></p> <p>This is totally expected at this point, and is no different from SharePoint 2010 or 2013, except for the rendering of the “modern” access denied experience :). This is basically one of these generic “access denied” exceptions which bubbles up and causes this rather lame UI. What actually is the case at this stage is that the UPA has no Subscriptions (Tenants) and therefore it is impossible to display this page. If we look at the UPA, we can see there are no Subscriptions (Tenants in UPA terminology!) configured.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image006_2.jpg"><img title="clip_image006" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image006" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image006_thumb.jpg" width="644" height="220" /></a></p> <p>We add the new Subscription to the UPA in the exact same way we did with previous versions, using <font face="Courier New">Add-SPSiteSubscriptionProfileConfig</font>. It’s worth pointing out that prior to RTM of SharePoint Server 2016 there was a bug which prevented this command from succeeding. This was fixed for RTM. We pass in a <br /><font face="Courier New">-SynchronizationOU</font> which is a <strong>STRING</strong> not a DN. In a real deployment, we would also pass in the configuration for the MySites. For example:</p> <pre class="brush: ps;"># Add this subscription to the Partitioned UPA $UpaProxyName = "User Profile Service Application Proxy" $MemberSiteUrl = "https://oracle.fabrikam.com" $TenantSyncOU = "Oracle" $Sub = Get-SPSiteSubscription $MemberSiteUrl $UpaProxy = Get-SPServiceApplicationProxy | Where-Object {$_.Name -eq $UpaProxyName} Add-SPSiteSubscriptionProfileConfig -Identity $Sub -SynchronizationOU $TenantSyncOU ` -MySiteHostLocation "$MemberSiteUrl/my" ` -MySiteManagedPath "$MemberSiteUrl/my/personal/" ` -ProfileServiceApplicationProxy $UpaProxy</pre> <p>Once that is complete, we can see the Subscription (Tenant) has been added to the UPA:</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image008_2.jpg"><img title="clip_image008" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image008" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image008_thumb.jpg" width="644" height="182" /></a></p> <p>And if we go ahead and click <b>Manage User Profile Application</b> from Tenant Admin, we no longer see the request access screen and we can view the profiles and so forth as expected:</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image010_2.jpg"><img title="clip_image010" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image010" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/clip_image010_thumb.jpg" width="644" height="172" /></a></p> <p>So now we have the Partitioned UPA configured, and added our Subscription to it. We would of course provision more than one subscription. Everything we have done up till now is identical to how it was done with SharePoint 2010 and 2013.</p> <p> </p> <h3>Configuring Synchronization Connections</h3> <p>Now we need to actually deal with getting profiles into these “partitions” of the UPA. In theory, we could use the Central Administration UI to add a new synchronization connection, hook that up to the Customers OU, then perform a sync. In theory. In practice, <b><i>creating Synchronization Connections for a Partitioned UPA does not work, and is 100% unsupported.</i></b></p> <p>If we try to configure using the UI and then go back and edit the connection, we will see that the changes are not persisted within the container selection. Yes, really. This is “by design”.</p> <p>More importantly however, sync runs won’t work – with no profiles being imported to the UPA. We will see something similar to this in the ULS:</p> <pre class="brush: ps;">UserProfileADImportJob:ImportDC -- Regular DirSync scan: successes '0', failures '0', ignored '113', total duration '21', external time in Profile '0', external time in Directroy '16' (times in milliseconds)</pre> <p><em>Check out the spelling of “directroy” at the end of that trace log! :) Wicked!</em></p> <p>In order to create our connections, we MUST use the currently undocumented online and rather esoteric <font face="Courier New">Add-SPProfileSyncConnection</font> PowerShell cmdlet. But it’s not that straightforward, as multi tenancy brings along a specific pattern to its usage.</p> <p>Now, this cmdlet has a chequered history with a lot of problems. Some of those (such as the ability to exclude disabled accounts) have been fixed in SharePoint 2016. But it is important to note the behaviour of the cmdlet – which is counter to all PowerShell naming and best practices – will be confusing.</p> <p>With UPS we used to add one container to the Sync connection, (e.g. Customers). With ADI we must add <b><i>one container for each subscription we wish to sync</i></b>. (e.g. Microsoft, Oracle, Amazon). We can NOT use a single container. </p> <p>The PowerShell below creates an initial sync connection using the OU for one of the subscriptions.</p> <pre class="brush: ps;">$UpaName = "User Profile Service Application" $ForestName = "fabrikam.com" $DomainName = "FABRIKAM" $AdImportUserName = "spupi" $AdImportPassword = Read-Host "Please enter the password for the AD Import Account" -AsSecureString $SyncOU = "OU=Microsoft,OU=Customers,DC=fabrikam,DC=com" Add-SPProfileSyncConnection -ConnectionSynchronizationOU $SyncOU ` -ConnectionUseDisabledFilter $True ` -ProfileServiceApplication $Upa ` -ConnectionForestName $ForestName ` -ConnectionDomain $DomainName ` -ConnectionUserName $AdImportUserName ` -ConnectionPassword $AdImportPassword</pre> <p>Note that the <font face="Courier New">-ConnectionSynchronizationOU</font> is a DN. Note also that the <font face="Courier New">-ConnectionUserName</font> must not include DOMAIN\ - it’s merely the username itself.  Don’t ask! It’s what it is.</p> <p>Once we have done this we can go ahead and perform a Synchronization run and the profiles for the Microsoft subscription will be imported into the Microsoft partition of the UPA.</p> <p>To add other subscriptions, we repeat the use of <font face="Courier New">Add-SPProfileSyncConnection</font>, once for each additional subscription. Whilst it’s called <font face="Courier New">Add-</font> what is actually happening here is the existing profile connection is being updated to include the additional containers.</p> <pre class="brush: ps;">$SyncOU = "OU=Oracle,OU=Customers,DC=fabrikam,DC=com" Add-SPProfileSyncConnection -ConnectionSynchronizationOU $SyncOU ` -ConnectionUseDisabledFilter $True ` -ProfileServiceApplication $Upa ` -ConnectionForestName $ForestName ` -ConnectionDomain $DomainName ` -ConnectionUserName $AdImportUserName ` -ConnectionPassword $AdImportPassword $SyncOU = "OU=Adobe,OU=Customers,DC=fabrikam,DC=com" Add-SPProfileSyncConnection -ConnectionSynchronizationOU $SyncOU ` -ConnectionUseDisabledFilter $True ` -ProfileServiceApplication $Upa ` -ConnectionForestName $ForestName ` -ConnectionDomain $DomainName ` -ConnectionUserName $AdImportUserName ` -ConnectionPassword $AdImportPassword $SyncOU = "OU=Amazon,OU=HR,OU=Customers,DC=fabrikam,DC=com" Add-SPProfileSyncConnection -ConnectionSynchronizationOU $SyncOU ` -ConnectionUseDisabledFilter $True ` -ProfileServiceApplication $Upa ` -ConnectionForestName $ForestName ` -ConnectionDomain $DomainName ` -ConnectionUserName $AdImportUserName ` -ConnectionPassword $AdImportPassword</pre> <p>Now when we run another Full Import, all subscriptions will get the appropriate profiles imported.</p> <p>At the end of the day, we get a number of Subscriptions (tenants) and a bunch of profiles in each:</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/image_6.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/image_thumb_2.png" width="644" height="217" /></a></p> <p>And that’s all there is to it…. Kind of… Sort of…</p> <p> </p> <h3>Implications</h3> <p> </p> <p>There are a couple of BIG considerations with this approach to be aware of. You will have to manage this stuff – or build tooling to manage it. If you get it wrong, then the wrong objects will be in the wrong tenants, and that’s not good.</p> <p>Firstly, there is no way to easily manage the sync connection. You can’t use the UI to add/remove containers. It’s all PowerShell. <font face="Courier New">Remove-SPProfileSyncConnection</font> works just fine. But you have to match up exactly what you want removed, and you must always include the same connection and credential parameters with every call. If you accidentally mess up the connection, say by removing a container – then those objects will no longer be synced. We don’t have a <font face="Courier New">Get-SPProfileSyncConnection</font> – although you could build one “easily” enough.</p> <p>Secondly, and more importantly, even thou we are adding a DN of a container to the sync connection – it is only for initial configuration –<b><i> it serves no purpose during sync operations</i></b>. Consider the following domain structure. See all those Microsoft OUs scattered around – all three of them? See that Amazon OU which is not within the Customers OU?</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/image_4.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/2186dbc5ca5c_2E9A/image_thumb_1.png" width="373" height="484" /></a></p> <p>When we perform a sync, all of the objects within ALL of the Microsoft OUs will be imported to the Microsoft partition of the UPA! Yes, really! And the Amazon OU, even thou it’s not in the customers OU will also be imported. If we had two Amazon OUs, they would both be imported.</p> <p><strong><em>The only thing that governs whether a container is parsed is the configuration using Add<font face="Courier New">-SPSiteSubscriptionProfileConfig</font></em></strong>. If this name matches, wherever it is in the domain, it will be synced. Remember we CANNOT use a DN for this value, it must be a string.</p> <p>The addition of a DN using <font face="Courier New">Add-SPProfileSyncConnection</font> of one container whose name happens to be the same as that within the <font face="Courier New">SiteSubscriptionProfileConfig</font> is merely the trigger to make ADI aware of it. It doesn’t actually matter where it is as long as one or more <strong>CN=Foo </strong>matches up to a <strong>Foo </strong>in the <font face="Courier New">SiteSubscriptionProfileConfig</font>.</p> <p>This is extremely important. </p> <p>It means we actually have much more flexibility in our domain structure – something which many hosters asked for – although this is not why it’s like this :). </p> <p>However, it also means it can get quite confusing and <b>very dangerous</b>. It means that using customer names for OUs might not be the smartest move – you really need to think through which structure best fits your needs, and be totally aware of the implications should you have many OUs with the same name as part of the solution. You must be really on top of planning and governing the AD used for your profile import in hosting scenarios.</p> <p>None of this is of course how it should be. But it is how it is. And hopefully the explanation above helps those of you whom are looking to implement hosting scenarios with SharePoint 2016.</p> <p>Ahh, the joys of user profile sync. Peace and B wild. May U live 2 see the dawn.</p><img src="http://www.harbar.net/aggbug/420.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2017/08/08/Configuring-a-Partitioned-UPA-in-SharePoint-2016-with-Active-Directory.aspx Tue, 08 Aug 2017 02:46:39 GMT http://www.harbar.net/archive/2017/08/08/Configuring-a-Partitioned-UPA-in-SharePoint-2016-with-Active-Directory.aspx#feedback http://www.harbar.net/comments/commentRss/420.aspx User Profile Photo Import from thumbnailPhoto using MIM and the SharePoint Connector FIM Platform Hygiene SharePoint SharePoint 2016 SharePoint 2013 User Profiles http://www.harbar.net/archive/2017/05/13/User-Profile-Photo-Import-from-thumbnailPhoto-using-MIM-and-the.aspx <p>When leveraging Microsoft Identity Manager (MIM) and the SharePoint Connector for User Profile Synchronization, some customers have a requirement to import profile pictures from the <font face="Consolas">thumbnailPhoto</font> attribute in Active Directory.</p> <p>This post details the correct way of dealing with this scenario, whilst retaining the principle of least privilege. The configuration that follows is appropriate for all of the following deployments:</p> <ul> <li>SharePoint 2016, MIM 2016, and the MIM 2016 SharePoint Connector </li> <li>SharePoint 2013, MIM 2016, and the MIM 2016 SharePoint Connector </li> <li>SharePoint 2013, FIM 2010 R2 SP1 and the FIM 2010 R2 SharePoint Connector <br /> <br /><em>* Note: you can also use MIM or FIM 2010 R2 SP1 with SharePoint 2010, although this is not officially supported by the vendor.</em> </li> </ul> <p>Before we get started it is important to understand that if the customer requirement is to be able to import basic profile properties from Active Directory with the addition of profile photos, then MIM/FIM is almost certainly the wrong choice. SharePoint’s Active Directory Import capability alongside some simple PowerShell or a console application will deliver this functionality with significantly less capital and operational cost.</p> <p>However, many customers are dealing with more complicated identity synchronization requirements and <font face="Consolas">thumbnailPhoto</font> is merely one of the elements required. Due to some bizarre behaviour of SharePoint’s <font face="Consolas">ProfileImportExportService</font> web service, previous vendor guidance on this capability has been inaccurate, and indeed yours truly has provided dubious advice on this topic in the past.</p> <p>Most enterprise identity synchronization deployments have stringent requirements regarding the access levels granted to the variety of accounts used. This is just as it should be, there is no credible identity subsystem which allows more privilege than necessary to get the job done. Naturally a system which is providing a “hub” of identity data should be as secure as possible. Because of this security posture, many customers have complained about the level of access “required” by the account used within the SharePoint Connector (Management Agent). In some cases, customers, have refused to deploy or used alternative means to deal with <font face="Consolas">thumbnailPhoto</font> . It’s not a little deal at all for those customers.</p> <p> </p> <h3>What is the issue?</h3> <p>Assume that MIM Synchronization is configured using an Active Directory MA, and a SharePoint MA with the <b>Export</b> option for <b>Picture Flow Direction*</b>. The account used by the SharePoint MA is added to the SharePoint <strong>Farm Administrators</strong> group as required. We then perform an initial full synchronization. MIM Synchronization successfully exports 217 profiles to the UPA. </p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_2.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_thumb.png" width="748" height="516" /></a> <br /> <br /><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_4.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_thumb_1.png" width="369" height="96" /></a> <br /> <br /><i><strong>*Note:</strong> 218 is the Farm Administrator plus the 217 new profiles. <br />The Import option for Picture Flow Direction, whilst available in the UI and PowerShell, is not implemented and therefore won’t do anything.</i></p> <p>We will however notice some rather puzzling results for the profile pictures. The <strong>Profile Pictures</strong> folder is correctly created within the My Site Host Site Collection’s <strong>User Photos</strong> Library. However only some of the profile pictures will be created, in this example 112 of them. What happened to the other 105? </p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_6.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_thumb_2.png" width="644" height="232" /></a></p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_8.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_thumb_3.png" width="644" height="426" /></a></p> <p>The numbers will actually vary, I can run this test scenario hundreds of times (and believe me, I have!) and get different numbers each time. However, roughly half the pictures are created each time. </p> <p>This is the problem which has led to incorrect guidance. It really is quite a puzzler. Obviously, some files are created, and thus logic suggests that the account which is calling the web service has the appropriate permissions. If the permissions were wrong, surely no files would be created. Alas, this is SharePoint after all, and sometimes it really isn’t worth the cycles! Bottom line there is an issue with the web service. That’s not something which can easily be resolved.</p> <p>The <a href="https://technet.microsoft.com/en-us/library/dn511003(v=ws.10).aspx">documentation</a> for the FIM 2010 R2 SP1 SharePoint Connector, which is the previous version of the currently shipping release, remains the best documentation available, it notes:</p> <blockquote> <p><i>When you configure the management agent for SharePoint 2013, you need to specify an account that is used by the management agent to connect to the SharePoint 2013 central administration web site. The account must have administrative rights on SharePoint 2013 and on the computer where SharePoint 2013 is installed. <br /></i></p> <p><i>If the account doesn’t have full access to SharePoint 2013 and the local folders on the SharePoint computer, you might run into issues during, for example, an attempt to export the picture attribute. <br /> <br />If possible, you should use the account that was used to install SharePoint 2013.</i></p> </blockquote> <p> </p> <p>This, to a SharePoint practitioner, is clearly poor guidance. Whilst it’s true the MA account must connect to Central Administration, that means it must be a Farm Administrator. There is no requirement for the account to have other administrative rights on the SharePoint Farm, and there is no requirement for any machine rights on any machine in the SharePoint Farm except for WSS_ADMIN_WPG, which is granted when adding a Farm Administrator. And certainly no access to the local file system of a SharePoint server is needed. Furthermore, there is no scenario whereby the SharePoint Install account should ever be used for runtime operations of any component, anywhere, in any farm!  Of course, this is material authored by the FIM folks, and there is no reason to expect them to be entirely familiar with the identity configuration of SharePoint, especially given that the topic is confusing to most SharePoint folks as well! <br /> <br />When I delivered the “announce” of the <a href="https://channel9.msdn.com/Events/Ignite/2016/BRK3039">MIM MA at Microsoft Ignite</a> last fall, I made a point of this issue, by stating that the Farm Account should be used by the SharePoint MA if importing from <font face="Consolas">thumbnailPhoto</font> . This is also incorrect guidance. In my defence, at the time we had worked a couple weeks to try and get to the bottom of the issue, and ran out of time before the session. Thus, to show it all working there was little choice. It’s pretty silly to do a reveal of something if the demo doesn't work. <br /> <br />Using the Farm Account for <em>anything</em>, other than the Farm is a bad idea. In this case, it’s extremely dubious, as in a real-world deployment the account’s password will need to be known by the MIM administrator. Internal security compliance of any large corporation is simply not going to accept that.</p> <p>Others have suggested that the SP MA account is added to the Full Control Web Application User Policy for the My Site Host web application. Or rather that the <font face="Consolas">GrantAccessToProcessIdentity()</font> method of the web application is used, which results in the above policy. That guidance is also inherently very bad. A large number of deployments now make use of a single Web Application, and providing Full Control to the MA account to that is patently a bad idea. Furthermore, such configuration allows unfettered access to the underlying content databases (which store the user’s My Sites remember!) and provides Site Collection Administrator and Site Collection Auditor rights on the My Site host.</p> <p> </p> <h3>The Workaround</h3> <p>So, we don’t want to use the Install Account, we don’t want to use the Farm Account, and we don’t wish to configure an unrestricted policy.</p> <p>The answer to this conundrum is to configure a brand-new <strong>Permission Policy</strong> to which we will add a <strong>User Policy</strong> for the SharePoint MA account. This enables all the pictures to be created, without granting any more permissions than necessary.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_10.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_thumb_4.png" width="656" height="380" /></a></p> <p>The <strong>Grant Permissions</strong> for this policy are: <strong>Add Items, Edit Items, Delete Items, View Items</strong> and <strong>Open Site</strong>. No more, no less.</p> <p>Then we add a new User Policy for the Web Application hosting the My Site host Site Collection, for the SharePoint MA account, with this Policy Level:</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_12.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_thumb_5.png" width="655" height="505" /></a></p> <p>Now at this point if we perform another Full Synchronization we have a problem. As far as MIM Synchronization is concerned the previous export worked flawlessly. It thinks all the pictures are present. This is because the <font face="Consolas">ProfileImportExportService</font> didn’t report any exceptions. The failures have been lost to the great correlation ID database in the sky. Gone forever. If we search the SharePoint MA’s Connector Space within MIM, we will see the photo data present and correct. There are zero updates to make.</p> <p>Of course, the idea is to correctly configure all of this <em>before</em> we perform the initial Full Synchronization. However, if you are following along, we can “fix” this by deleting the SharePoint MA’s Connector Space, and then performing a Full Synchronization. This will force an fresh Export to SharePoint (there is no need to delete the AD Connector Space).</p> <p>Once the Full Synchronization has completed, we will see the correct number of items within the <strong>User Photos</strong> Library (one item is the Profile Pictures folder, the other 217 are images).</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_14.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/User-Profile-Photo-Import-from-thumbnail_11B76/image_thumb_6.png" width="644" height="244" /></a></p> <p>Of course, we would also need to run <strong><font face="Consolas">Update-SPProfilePhotoStore</font></strong> at this point to generate the three images for each profile, and delete the initial data (the files with GUIDs for filenames).</p> <p> </p> <h3>But wait, there is more! </h3> <p>As you may be aware the UPA does not fully understand Claims identifiers for internal access control. This is why we must enter Windows Classic style identifiers for UPA permissions and administrators.</p> <p>Whilst we can create the new Permission Policy with Central Administration, we cannot create a new User Policy using a Windows Classic identifier. Whatever we enter in the UI will be transformed to a claims identifier. For this to work the policy must be as shown in the screenshot above (<font face="Consolas">FABRIKAM\spma</font>) – using a Classic identifier. And yes, I do feel stupid calling a NetBIOS username, “classic” but I am not in charge of naming anything :)</p> <p>In order to configure the policy correctly for this use case we must use PowerShell. Which is actually just fine, because we don’t really want to be using the UI anyway. We can also combine all this work into a simple little script to create both the Permission Policy and the User Policy, as shown below.</p> <pre class="brush: ps;">Add-PSSnapin -Name "Microsoft.SharePoint.Powershell" # update these vars to suit your environment $WebAppUrl = "https://onedrive.fabrikam.com" $PolicyRoleName = "MIM Photo Import" $PolicyRoleDescription = "Allows MIM SP MA to export photos to the MySite Host." $GrantRightsMask = "ViewListItems, AddListItems, EditListItems, DeleteListItems, Open" $SpMaAccount = "FABRIKAM\spma" $SpMaAccountDescription = "MIM SP MA Account" # do the work $WebApp = Get-SPWebApplication -Identity $WebAppUrl # Create new Permission Policy Level $policyRole = $WebApp.PolicyRoles.Add($PolicyRoleName, $PolicyRoleDescription) $policyRole.GrantRightsMask = $GrantRightsMask # Create new User Policy with the specified account $policy = $WebApp.Policies.Add($SpMaAccount, $SpMaAccountDescription) # Configure the Permission Policy to the User Policy $policy.PolicyRoleBindings.Add($policyRole) # Commit $WebApp.Update()</pre> <p> </p> <h3>Summary</h3> <p>There you have it. How to use a least privilege account for the SharePoint MA, and successfully import <font face="Consolas">thumbnailPhoto</font> from Active Directory. In summary, the required steps are:</p> <ol> <li>Create an account in Active Directory for use by the SharePoint MA (e.g. <font face="Consolas">FABRIKAM\spma</font>) </li> <li>Add the account as a SharePoint <strong>Farm Administrator</strong> using Central Administration or PowerShell </li> <li>Create the <strong>Permission Policy</strong> and <strong>User Policy</strong> for the account using the PowerShell above </li> <li>Configure the SharePoint MA with this account, and select <strong>Export</strong> as the <strong>Picture Flow Direction</strong>. If you are using the MIMSync toolkit the <font face="Consolas">thumbnailPhoto</font> attribute flow is already taken care of. If you are not, obviously you will need to configure the necessary attribute flow </li> <li>Perform Synchronization operations </li> <li>Execute <font face="Consolas"><strong>Update-SPProfilePhotoStore</strong></font> once Synchronization is complete to create the thumbnail images used by SharePoint </li> </ol> <p>Now of course, we have added the SP MA account as a Farm Administrator. As such it could be used to do just about anything to the farm. Least privilege is always a compromise and in this case the farm administrator is a requirement of the <font face="Consolas">ProfileImportExportService</font> – a SharePoint product limitation. Therefore, this approach is the best compromise available, and one that has already been accepted by security compliance in three enterprise customers using MIM and the SharePoint Connector. The bottom line is that if you don’t trust your MIM administrators, or indeed your SharePoint ones, you’ve got bigger security problems than a couple of accounts!</p> <p>Also, none of this explains why without the policy configuration or overly aggressive permissions, the web service creates some pictures but not others. But life is just too short to worry about that rabbit hole!</p> <p>Finally, it is always good to remember the mantra of the SharePoint Advanced Certification programs, “just because you can, doesn’t mean you should”. This post is not intended to promote the use of MIM for just the profile photo. Furthermore, using <font face="Consolas">thumbnailPhoto</font> in AD for photos is just one approach of many. For some organisations, especially the larger ones, this would be a spectacularly stupid implementation choice, and of course in many others Active Directory is not the master source of identity anyway.</p> <p> </p> <p>s.</p><img src="http://www.harbar.net/aggbug/419.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2017/05/13/User-Profile-Photo-Import-from-thumbnailPhoto-using-MIM-and-the.aspx Sat, 13 May 2017 19:37:52 GMT http://www.harbar.net/archive/2017/05/13/User-Profile-Photo-Import-from-thumbnailPhoto-using-MIM-and-the.aspx#feedback http://www.harbar.net/comments/commentRss/419.aspx Microsoft Identity Manager 2016 Service Pack 1 is now available! FIM Platform Hygiene SharePoint 2016 User Profiles Office 365 http://www.harbar.net/archive/2016/10/06/Microsoft-Identity-Manager-2016-Service-Pack-1-is-now-available.aspx <p>Today, Microsoft released Service Pack 1 for Microsoft Identity Manager 2016 (MIM). This is an extremely important release for SharePoint practitioners who are looking to leverage MIM for User Profile Synchronization with SharePoint Server 2016.</p> <p>This Service Pack provides a significantly streamlined deployment process – no more hotfix rollups (well, for the time being :)). This is important for those leveraging simply the Synchronization Service, but also for those working with declarative provisioning using the MIM Portal and Service – SharePoint Server 2016 support is also included, as is support for SQL Server 2016.</p> <p>Service Pack 1 can be downloaded today from the Volume Licensing Service Center or from MSDN Subscriber Downloads. Go get it.</p> <p><a title="https://blogs.technet.microsoft.com/enterprisemobility/2016/10/06/microsoft-identity-manager-2016-service-pack-1-is-now-ga/" href="https://blogs.technet.microsoft.com/enterprisemobility/2016/10/06/microsoft-identity-manager-2016-service-pack-1-is-now-ga/">https://blogs.technet.microsoft.com/enterprisemobility/2016/10/06/microsoft-identity-manager-2016-service-pack-1-is-now-ga/</a></p> <p><strong>Please be aware that installation of Service Pack 1 requires an uninstall of MIM 2016 and then installation of MIM 2016 SP1 – after backing up the databases relevant to the components you are working with. </strong>It is not a in place “upgrade”.</p> <p><font color="#ff0000"><strong>[UPDATE] On November 8th, Microsoft announced an “in place” </strong></font><a href="https://blogs.technet.microsoft.com/iamsupport/2016/11/08/microsoft-identity-manager-2016-service-pack-1-update-package/"><font color="#ff0000"><strong>upgrade path</strong></font></a><font color="#ff0000"><strong> and </strong></font><a href="https://www.microsoft.com/en-us/download/details.aspx?id=54184"><font color="#ff0000"><strong>build</strong></font></a><font color="#ff0000"><strong>.</strong></font></p> <p>Once you have upgraded your build will be 4.4.1237.0. Observants will have a little chuckle at the string resource used to describe the product. :)</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Microsoft-Identity-Manager-2016-Service-_12034/image_2.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Microsoft-Identity-Manager-2016-Service-_12034/image_thumb.png" width="587" height="484" /></a></p> <p>Don’t forget to re-install the SharePoint Connector after upgrading the MIM Sync service.</p> <p>I just completed a full upgrade of a fully operational MIM 2016 setup with the SharePoint Connector, AD and SQL MAs plus the MIM Portal (on SharePoint 2013) – it took around 25 minutes from start to finish, including fixing up the MIM Sync database name (which still can’t be changed unless using an unattended install). This time included performing a full sync run. So all pretty straightforward. I see no value in using SharePoint 2016 for the portal, but will try that at a later time to see if there are any issues to be concerned about.</p> <p>Important Note: If you are using the “MIMSnyc toolkit” for SharePoint 2016 you will also need to update the module, as it has a (rather pathetic) version check which is broken. As we’ve gone from 4.3.xxxx to 4.4.xxxx it can’t handle it. We need to update lines 81 and 82. And don’t forget to reload the module after making the changes.</p> <pre class="brush: ps;"> $MimPowerShellModuleAssembly = Get-Item -Path (Join-Path (Get-SynchronizationServicePath) UIShell\Microsoft.DirectoryServices.MetadirectoryServices.Config.dll) if ($MimPowerShellModuleAssembly.VersionInfo.ProductMajorPart -eq 4 -and $MimPowerShellModuleAssembly.VersionInfo.ProductMinorPart -eq 4 -and $MimPowerShellModuleAssembly.VersionInfo.ProductBuildPart -ge 1237) { Write-Verbose "Sufficient MIM PowerShell version detected (&gt;= 4.4.1237): $($MimPowerShellModuleAssembly.VersionInfo.ProductVersion)" } else { throw "SharePoint Sync requires MIM PowerShell version 4.4.1237 or greater (this version is currently installed: $($MimPowerShellModuleAssembly.VersionInfo.ProductVersion). Please install the latest MIM hotfix." }</pre> <p>This is a pretty horrible implementation as the error (&gt;) doesn’t reflect the condition (=). But easy fix. At a later stage this will get updated to be actually sustainable across hotfixes and service packs.</p> <p>s.</p><img src="http://www.harbar.net/aggbug/418.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2016/10/06/Microsoft-Identity-Manager-2016-Service-Pack-1-is-now-available.aspx Thu, 06 Oct 2016 19:33:48 GMT http://www.harbar.net/archive/2016/10/06/Microsoft-Identity-Manager-2016-Service-Pack-1-is-now-available.aspx#feedback 3 http://www.harbar.net/comments/commentRss/418.aspx Using Nikon Wireless Utility with the Nikon D500 on iOS to download NEFs to iOS Photography http://www.harbar.net/archive/2016/09/14/Using-Nikon-Wireless-Utility-with-the-Nikon-D500-on-iOS.aspx <p>As most Nikon D500 users are aware, one of the “features” of the camera is “SnapBridge”, Nikon’s attempt to do something useful with wireless and smartphone connectivity. The iOS app is pretty awful. The connection dance for bluetooth and then the silly switch to wireless for remote photography and image download. Admittedly part of that connection dance is the fault of iOS which restricts apps from interfacing with core device settings directly. The whole thing is just painful, slow and a battery killer. I attempted to use it to download and share one image at an air show recently. Not only could I not get it to function, trying battered my battery even with only 10 minutes use so towards the end of the day I was getting dangerously close to no power which is not where you want to be when a Typhoon jet is flying acrobatics in front of you at 600mph! </p> <p>So, a total disaster basically for Nikon’s first attempt (really) to do something decent. Sure being able to add GPS to images via the phone and do clock sync is very useful. But really, I have to destroy the battery for this. Yeah not happening. I can take a picture with my phone to give me the GPS and you know, I can set the clock pretty easy!</p> <p>But it gets worse. The remote photography stuff – i.e. control the camera from the phone – it’s rubbish also – not only can it only take small JPEGs, you can’t do much but select the focus point and hit the shutter. No control of aperture or shutter speed, or ISO or well anything basically. So you can’t be more than a couple feet away from the camera. Not exactly remote.</p> <p>And it get’s worse. The primary use case of this app is to allow you to get images from your camera onto your phone. You know so that you can stick them on the interwebz and be all social. SnapBridge. Good name, but it doesn’t include a bridge for your snaps!It can only do the silly small files which you aren’t shooting, and you’ll never remember to switch to that QUAL mode.</p> <p>Now, if the D500 didn’t include this feature I would have still brought the camera. I bought it for taking images. But it is pretty disappointing that this promised “additional” feature is just so shockingly lame. Nikon are rock solid at understanding how shooters shoot to deliver first class camera ergonomics and controls (at least on the pro bodies). But when it comes to how someone would use this app it’s a total shambles. How they thought this was ready for prime time is a complete mystery.</p> <p>BUT! there is something you can do whilst waiting on Nikon to get their act together.</p> <p>There is another app called the <strong>Nikon Wireless Mobile Utility</strong>. It’s designed for consumer bodies such as the D750, D600, D7200 etc.</p> <p><strong>We can use this to download NEF files from the camera.</strong></p> <p>Now, the bad news is we have to jump through some hoops and use it in conjunction with SnapBridge. So it’s not seamless and it’s nowhere near as easy as it should be. But it works and if you are looking to edit on an iPad Pro or similar. This is the best solution right now.</p> <p>Here’s how to set it up.</p> <p>Before starting make sure you have downloaded and installed the Wireless Mobile Utility (WMU) from the App Store.</p> <p>1. Connect the D500 using SnapBridge Bluetooth pairing as normal. Yes, this can be quite painful and slow. But a straightforward process.</p> <p>2. Once you are connected in SnapBridge, tap the <strong>Camera icon</strong> at the bottom.</p> <p>3. Tap <strong>Download Selected Pictures</strong>: </p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/1..png"><img title="1." style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="1." src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/1._thumb.png" width="274" height="484" /></a></p> <p>we aren’t going to use this, but we need to connect via Wi-Fi in order to use WMU, and this is initiated inside SnapBridge.</p> <p>4. Wait for ages watching the spinning progress icon.!</p> <p>5. When the <strong>Switch from Bluetooth to Wi-Fi for connection to D500</strong> dialog appears, tap <strong>Yes</strong>.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/2.png"><img title="2" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="2" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/2_thumb.png" width="274" height="484" /></a></p> <p>6. Wait for ages (again) watching the spinning progress icon! This step is basically turning the Wi-Fi on the camera, on.</p> <p>7. On the <strong>Wi-Fi has been enabled on the camera</strong> dialog, tap <strong>Go</strong>.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/3.png"><img title="3" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="3" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/3_thumb.png" width="274" height="484" /></a></p> <p>8. From the SnapBridge settings screen, tap <strong>Settings</strong> in the top left. This takes you “back” to the main Settings iOS app.</p> <p>9. Scroll up to the top to <strong>Wi-Fi</strong>, tap it and select the D500 camera which will now show up in the list of available networks. Once the network has a tick, we are connected.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/4.png"><img title="4" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="4" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/4_thumb.png" width="274" height="484" /></a></p> <p>10. Now open the <strong>Nikon WMU</strong> app without closing SnapBrige, and tap the <strong>gear icon</strong>, followed by <strong>Connection Status</strong>. You will see the camera connection.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/5.png"><img title="5" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="5" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/5_thumb.png" width="274" height="484" /></a></p> <p>11. Tap <strong>Settings</strong>, followed by <strong>Done</strong> to return to the WMU home screen.</p> <p>12. Tap <strong>View Photos</strong>.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/6.png"><img title="6" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="6" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/6_thumb.png" width="274" height="484" /></a></p> <p>13. Tap <strong>Pictures on D500</strong>.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/7.png"><img title="7" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="7" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/7_thumb.png" width="274" height="484" /></a></p> <p>14. You will see all the photos on the camera.</p> <p>15. Tap <strong>Select</strong> and then the photos you want on the phone to select them.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/IMG_0662.png"><img title="IMG_0662" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="IMG_0662" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/IMG_0662_thumb.png" width="274" height="484" /></a></p> <p>16. Tap <strong>Download</strong>, followed by <strong>Yes</strong>.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/9.png"><img title="9" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="9" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/9_thumb.png" width="274" height="484" /></a></p> <p>17. Wait whilst they are downloaded.</p> <p>18. Once the download is complete, they will be in your <strong>WMU Camera Roll</strong> and in the photos library on the iPhone. A NEF can’t be viewed in photos but it can be in Photoshop, Lightroom etc. Here is one of my NEFs open in Lightroom for iPhone.</p> <p><a href="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/IMG_0667.png"><img title="IMG_0667" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="IMG_0667" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/IMG_0667_thumb.png" width="274" height="484" /></a></p> <p>Obviously from here you can save the final file out as JPEG and share on the interwebz.</p> <p>Yes. it’s a mess. But it works. And you can edit your NEF from Photoshop Mobile etc on the iOS device. </p> <p>Make sure your camera battery is charged <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://harbar.net/images/www_harbar_net/Windows-Live-Writer/Using-Nikon-Wireless-Utility-with-the-Ni_CE41/wlEmoticon-smile_2.png" />:)</p> <p>s.</p><img src="http://www.harbar.net/aggbug/417.aspx" width="1" height="1" /> Spence http://www.harbar.net/archive/2016/09/14/Using-Nikon-Wireless-Utility-with-the-Nikon-D500-on-iOS.aspx Wed, 14 Sep 2016 15:52:35 GMT http://www.harbar.net/archive/2016/09/14/Using-Nikon-Wireless-Utility-with-the-Nikon-D500-on-iOS.aspx#feedback 3 http://www.harbar.net/comments/commentRss/417.aspx