Using PowerShell to unpin the AppStore in Windows 10 – Workaround

I can’t find a way to unpin the AppStore in Windows 10. So I wen’t about it another way.
I reset the taskbar to have nothing and then I added everything back that I wanted.
I am using this in my OSD/RunOnce PowerShell script to customize the user’s desktop.

First of all I am using this function to manipulate the registry:

Function ChangeRegistry{
PARAM(
$ErrorActionPreference = "SilentlyContinue",
[Parameter(Mandatory=$true)]$registryPath,
[Parameter(Mandatory=$true)]$Name,
[Parameter(Mandatory=$true)]$Value ,
[Parameter(Mandatory=$true)]$PropertyType,
$Comment
)
Try {
 $RESULT=Get-ItemProperty -Path $registryPath -Name $Name | Out-Null
 New-ItemProperty -Path $registryPath -Name $Name -Value $Value -PropertyType $PropertyType -Force | Out-Null
}
Catch [System.Management.Automation.PSArgumentException] {
  New-ItemProperty -Path $registryPath -Name $Name -Value $Value -PropertyType $PropertyType -Force | Out-Null 
}
Catch [System.Management.Automation.ItemNotFoundException] {
  New-Item -Path $registryPath -Force | Out-Null
  New-ItemProperty -Path $registryPath -Name $Name -Value $Value -PropertyType $PropertyType -Force | Out-Null 
}
Finally { 
$ErrorActionPreference = "Continue" 
Write-host "$($Comment)$($Name): $Value"
}
}

Next I reset the Taskbar:

Write-Host "Setting up Start Menu" -ForegroundColor Green
ChangeRegistry -registryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "Favorites" -PropertyType "Binary" -Value ([byte[]](0xFF))
ChangeRegistry -registryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "FavoritesResolve" -PropertyType "Binary" -Value ([byte[]](0xFF))
ChangeRegistry -registryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "FavoritesChanges" -PropertyType "DWORD" -Value 0
ChangeRegistry -registryPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "FavoritesVersion" -PropertyType "DWORD" -Value 1
Stop-Process -Name explorer -ErrorAction SilentlyContinue

Finally I use the InvokeVerb method to put back what I want:

$ShellApplication = New-Object -ComObject Shell.Application
$result=$ShellApplication.Namespace("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office").ParseName("Microsoft Outlook 2010.lnk").InvokeVerb("taskbarpin")

Re-imaging a machine, with SCCM 2012 fails with error 0x80070570

I have been working on building a new Windows 10 image. I was testing on a laptop and all of the sudden the OSD Task Sequence started failing, before anything even started!
I had only made a minor change to the TaskSequence, so I was pulling my hair out.

Error 0x80070570. 
Logs shows : threadtoresolveandexecutetasksequence failed 0x80070570.

If you are impatient like me, then you you power off the machine (press and hold the power button), and start over.
Well, that was the issue. Drive was marked as dirty (so many power offs throughout the day!) and a check disk needed to be run.

Hope that helps someone.

A better jQuery selector to hide a row in a SharePoint 2010 Edit Form

In the past, I had used this code to hide a row in a SharePoint Edit Form (EditForm.aspx):

$('nobr:contains("Attendees")').closest('tr').hide();

The problem with this is that if you have two fields that contain the text “Attendees” (For example “NewAttendees” & “OldAttendees”), then it matches both of them (this always seems to to be an issue for us). So I did a little research and I found a better way to select a row (I think this was my original source)

Here is my new/better way to match a row:

 $('nobr').filter(function () { return $(this).text() === 'Attendees' }).closest('tr').hide();

If it was a required field, it would be:

 $('nobr').filter(function () { return $(this).text() === 'Attendees *' }).closest('tr').hide();

Hope that helps someone.

Using jQuery to change to the Items tab in a SharePoint 2010 list.

In my last post, I showed how to use a query string parameter to start a user out on the items tab of a SharePoint list. This is well documented, I just can’t seem to remember it (that is why I posted it!). I wanted to take it a step further and use jQuery to change to the Items tab. Here is the code to do that:

$(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(function () {
          _ribbonStartInit("Ribbon.ListItem", false, null);
    }, "sp.ribbon.js");    
});

The trick was to make sure the sp.ribbon.js script was loaded, and then use the included function to change to the preferred tab. Hope that helps someone.

Replace the New Item button on a SharePoint 2010 list with jQuery

I have a SharePoint 2010 Business Data Catalog (BDC) pointing to our MS CRM 20111 back end. This is a good way to show paged views of the database. But at the top, there is still a “New Item” button. This does not make much sense for a BDC (or External list) without update queries. I wanted a workaround. I wanted to “hijack” this button – Make it do what I want. This is the jQuery code to do that!
Basically I am hiding the existing button, and replacing it with what I want.

    $("#RibbonContainer").ready(function () {
        var imageRow = '<span class="ms-cui-ctl-large" onclick=\"window.location=\'/Destination/YouWant/NewForm.aspx?source=/Lists/BDCList/Default.aspx?InitialTabId=Ribbon.ListItem\'; \") > \
            <a class="ms-cui-ctl-a1 "  href="javascript:;" > \
            <span class="ms-cui-ctl-a1Internal" unselectable="on"> \
            <span class=" ms-cui-img-32by32 ms-cui-img-cont-float" unselectable="on"> \
            <img class="" style="left: -64px; top: -320px;" src="/_layouts/1033/images/formatmap32x32.png" /> \
            </span> \
            </span> \
            </a> \
            <a class="ms-cui-ctl-a2"><span class="ms-cui-ctl-largelabel"> New <br/> Item </span></a> \
            </span>'
        $("#s4-ribboncont .ms-cui-ctl-large:contains('New Item')").hide()
        $("#s4-ribboncont .ms-cui-ctl-large:contains('New Item')").before(imageRow)
    }); 

Quickly install the SQL powershell toolls on your local machine

I wanted to quickly install the 2012 powershell tools on to my machine. I could’t find a simple summary, so here goes:

Visit this site:
http://www.microsoft.com/en-us/download/details.aspx?id=29065

Download the following:

Microsoft® Windows PowerShell Extensions for Microsoft® SQL Server® 2012
Microsoft® SQL Server® 2012 Shared Management Objects
Microsoft® System CLR Types for Microsoft® SQL Server® 2012

Wherever you downloaded the above files to:

PS C:\Temp> .\SQLSysClrTypes.msi /qr /norestart
PS C:\Temp> .\SharedManagementObjects.msi /qr /norestart
PS C:\Temp> .\PowerShellTools.MSI /qr /norestart

Import-Module SQLPS -DisableNameChecking 

That should do it.

2013 Year in review & Goals for 2014

My blogging fell apart in 2013. I was doing well and reached a goal of 10,000 visitors in a month. Then it fell apart. I spent a lot of time trying to learn Cisco products, and I felt that I did to have anything interesting to add to the internets – it was stuff that all Cisco people already know.

And, I got lazy.

Goals for 2014:
My goals for this year are about the same: 8 posts per month (two per week). I also want to get my Microsoft Certification updated to the new MCSE track.

Anyway, here are my visits for the year:

December      4034
November      4424
October       4964
September     4600
August        5106
July          5502
June          5934
May           7409
April         10913
March         11440
February      10312
January       11256

And my Summary:
2013

And my downwards traffic trend:
Screen Shot 2014-01-14 at 10.29.22 AM