Tuesday, September 20, 2011

Insight to Acquire Ensynch

Insight Enterprises, Inc. (NASDAQ: NSIT) (“Insight” or “the Company”), a leading global technology provider of hardware, software and service solutions, has announced that its U.S. operating subsidiary will acquire Tempe-based Ensynch, a leading professional services firm with multiple Microsoft Gold competencies and solutions across the complete IT stack. Ensynch’s 2010 services revenue was $16.2 million. The transaction is expected to close within thirty days.

Full Press Release

Wednesday, August 24, 2011

PowerShell Script: Create Content Type, Assign Retention and Audit Policies, Publish Via Content Hub

First I need to make sure to identify the source of most of this script: Phil Childs at http://get-spscripts.com/.  He has a great site with lots o' PowerShell scripts for SharePoint.

I needed a script that could read from an input file (this case I used a CSV) and create a Content Type, assign retention and audit policies to it, and publish it afterwards (this was on a content type syndication hub).   I took several different scripts and cobbled them together for the following:

$SiteColl = read-host "What is the URL of the target site collection?";
$ParentContentType = read-host "What is the Parent Content Type?"
$CTGroup = read-host "What Content Type Group Should These Be Created Under?";

$CTList = Import-Csv ContentTypes.txt

ForEach ($item in $CTList){
$Record = $($item.Record)
$Description = $($item.Description)
$Property = $($item.Property)
$Period = $($item.Period)
$PeriodType = $($item.PeriodType)

$site = get-spsite $SiteColl
$web = $site.openweb()
$ctypeName = $Record
$ctypeParent = $web.availablecontenttypes[$ParentContentType]

<# Create Content Type #>

$ctype = new-object Microsoft.SharePoint.SPContentType($ctypeParent, $web.contenttypes, $ctypeName)
$ctype.Description = $Description
$ctype.group = $CTGroup
$ctype = $web.contenttypes.add($ctype)
write-host $Record : "Content Type Created" -foregroundcolor green;

<# Set Retention and Audit Policies #>

if (($Period -ne "IND") -or ($Period -notcontains "MAX")) {
$contentType = $web.ContentTypes[$Record];[Microsoft.Office.RecordsManagement.InformationPolicy.Policy]::CreatePolicy($contentType, $null);
$newPolicy = [Microsoft.Office.RecordsManagement.InformationPolicy.Policy]::GetPolicy($contentType);
 "<Schedules nextStageId='3'>"+
 "<Schedule type='Default'>"+
 "<data stageId='1' stageDeleted='true'></data>"+
 "<data stageId='2'>"+
 "<formula id='Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration.Formula.BuiltIn'>"+
 "<action type='action' id='Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration.Action.MoveToRecycleBin' />"+
 "<Update />"+
 "<View />"+
 "<CheckInOut />"+
 "<MoveCopy />"+
 "<DeleteRestore />"+
 write-host $Record : "Retention Policy of" $Period $PeriodType "assigned." -foregroundcolor yellow;
 write-host " ";
 write-host "No Retention Policy Required" -foregroundcolor DarkCyan;
 write-host " ";

<# Publish Content Type #>
$Publisher = New-Object Microsoft.SharePoint.Taxonomy.ContentTypeSync.ContentTypePublisher($SiteColl)
Write-Host "Publishing the content type.";


The import file had the following formatting:

Billing,Billing for Completed Invoices,Document_x0020_Date,6,years

  • Record = Name of Content Type
  • Description = Populates Description Field of Content Type
  • Property = Internal Name of Field to Base Retention Policy On
  • Period = How Long of a Retention Period
  • PeriodType = Years, Months, Days
Maybe I will work on adding exception handling on the next go around.


    PowerShell Script: Add a Site Column to Multiple Content Types

    I needed to add a single column to multiple content types but couldn't add it to the parent because not all of the child content types needed this new column.  PowerShell to the rescue!

    Obviously I created the site column first...  Then I used an import file and a ForEach loop to read each content type in by Name.

    <# Gather variables #>
    $siteColl = read-host "What is the target site collection?";
    $fieldToAdd = read-host "Which site column should be added the content types in contentTypes.txt?";

    <# Import from external CSV file #>
    $CTList = Import-Csv contentTypes.txt

    ForEach ($item in $CTList){
    $TargetCT = $($item.TargetCT)
    $web = Get-SPWeb $siteColl
    $ct = $web.ContentTypes[$TargetCT]

    <# Get link to the columnn from web #>
    $spColumn = New-Object Microsoft.SharePoint.SPFieldLink ($web.Fields[$fieldToAdd])

    <# Add the column to the content type #>
    <# Dispose #>


    Wednesday, February 16, 2011

    BCS, PeopleSoft, and the SharePoint User Profiles

    I was trying to import PeopleSoft data into SharePoint User Profiles using a BCS connection to an Oracle view that was provided by my DBA.  The only field that existed in both environments was “NTUSERNAME”.  Although not the most ideal, this would work as they are unique in their environment (Single Domain/Forest).  I had the connection working and returning data to a list so I thought I was home free.  I went into the ForeFront Identity Manager Client and made the change to my BCS Management Agent so that “NTUSERNAME” from PeopleSoft was matching up to the Metaverse “username” field populated by “sAMAccountName” from AD.  Figured I was good to go.  Kicked off a full synchronization and a whopping two accounts matched up out of almost 2000 expected.


    We started to look and see what was different about these two accounts.  Using TOAD we ran the query that was providing the View and looked for the two accounts.  Strangely enough they were lowercase and all the others returned were UPPERCASE.  I hit up my Identity guys and they said that shouldn’t matter in a Join.  For giggles though, I had my DBA re-write the query so it returned ALL values in the NTUSERNAME field as lowercase.  I ran a full synchronization and they came over like a champ!

    Just throwing it out there in case I can save anyone else from a world of frustration…