Skip to main content
Boman.Biz

Boman.Biz

Go Search
Home
Mobile Monger
  

Task Scheduler failed to start - Error Value: 2147943645.

Okay – I will own up… this is a silly thing that took me a while to realise.

While trying to schedule a PowerShell script to run on a server, I kept getting this error message:

Task Scheduler failed to start "\MyTask" task for user "DOMAIN\user". Additional Data: Error Value: 2147943645.

So there I was daydreaming about the possible meanings of 2147943645 – finally could it be the answer to the LOST numbers on the hatch?

Well – no, actually it just means you are trying to run a job as someone else with the “Only run when user is logged on” flag set.  Surely someone could have made the message a little friendlier than 2147943645? Hmmm…

image

Something I didn’t know about Notepad

Recently tweeted by Darren Neimke about a presentation he saw, a little hidden feature of Notepad that has apparently been in there for years is the ability to create automated log files:

  1. Open a blank Notepad file
  2. Write .LOG (in uppercase) in the first line of the file, followed by Enter. Save the file and close it.
  3. Double-click the file to open it and notice that Notepad appends the current date and time to the end of the file and places the cursor on the line after.
  4. Type your notes and then save and close the file.
  5. Each time you open the file, Notepad repeats the process, appending the time and date to the end of the file and placing the cursor below it.
image
Update – MobileMonger 2.1

Its been a while, but I have updated MobileMonger with a new version 2.1

New to this version:

  • Ability to delete files.  After deleting a file this modifies the scan results in memory, so you don’t have to re-scan your device.
  • Improved UI.  The UI detects DPI and scales better for higher and lower resolutions, also using a less offensive set of colours for the treemap.
  • Improved stability.  Some people were experiencing problems due to files that were inaccessible on their devices causing MobileMonger to crash.  This is fixed.

If you have already purchased MobileMonger from the Windows Mobile Marketplace the update should prompt you next time you start the Marketplace application.

Get it now!

Screenshot1 Screenshot2

Windows Phone 7 – think different :)

Phones

Looking at the picture above of various SmartPhone UI’s, its clear that WP7’s one saving grace is that it certainly has a new and innovative UI.

Windows Phone 7 is due to be released November-ish this year, and straight away its going to be an easy target for criticism.  No copy/paste, no side-loading apps, no multi-tasking, no storage cards, no new hubs.  All the restrictions of the iPhone, and none of the benefits of Windows Mobile 6.5.  It will be easy for reviewers to label it as an instant FAIL. 

Microsoft has said that intend to fix functionality gaps in later releases, and this may have been good enough for the iPhone initial release – but people’s expectations have risen sharply since then.  I hope it will be enough to get it to the next release!

SharePoint Workflow tips for n00bs (like me)

Here are a couple of nuggets that I have learned while trying to get into SharePoint/Project Server workflows:

  1. If you are having trouble debugging your workflow and Visual Studio is showing you an old stale version of your workflow design surface in file from temp\Live.Workflow.tmp<number>.xoml then you need to do a few steps between each deployment:
    - Close Visual Studio
    - Stop IIS (IISRESET /STOP)
    - Delete the contents of C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root
    - Delete the contents of C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies
    - Start IIS again (IISRESET /START)
    - Load up Studio, attach and try again.
  2. Be really careful about the public properties of your workflow – make sure all properties are serializable.  I had a property of type SPUser that caused my Workflow to fail in mysterious ways.

Happy Workflowing!

J.

Project Server 2010:Deploying Workflows

I have recently been getting into the new workflow capabilities of Project Server 2010, which are basically SharePoint 2010 Workflows using Project Server activities.

There are 4 steps to creating your Project Server 2010 Workflow:

  1. Plan, Plan, Plan – you can never have enough documentation about the behaviour the customer actually wants.  Visio really helps here.
  2. Create the Project Server primitives to support your workflow, in this order; Custom Fields (CF), Project Detail Pages (PDP), Phases, Stages and finally an Enterprise Project Type.
  3. Using Visual Studio 2010, create the orchestration of your workflow, tying together all the objects you created.
  4. Packaging and deployment; use the resulting WSP to deploy to your target.

This took some time to get to step 3 using Visual Studio to test out the workflow, and when I got there I was pleasantly surprised to see the first workflow be deployed and run mostly successfully.  Obviously nothing works exactly right the first time, so as developers do, I changed some things and redeployed – this was where the fun began.

After Visual Studio retracted, redeployed and reactivated the solution the next attempt to run the workflow failed with an error indicating it couldn’t start the workflow.  I quickly found that the workflow had become disconnected from the Enterprise Project Type:

image

Once discovered, its easy to just re-attach the workflow to the Enterprise Project Type, however this happens on every redeploy!  If someone has a script to automatically hook this back up – let me know as I would be very appreciative!

 

 

 

After reattaching the workflow, it turned out that the old version of the workflow was still being initiated – so I thought an IISRESET would fix it.  Nope, still the old workflow was running, no matter how many times I IISRESET or redeployed the solution.

image

It turns out, that when you redeploy a workflow, you need to restart the Project Server Queue Service, as it has the old workflow assembly still in memory.

 

To automate this in Visual Studio you need to add the following commands to your Visual Studio post deployment steps:

net stop ProjectQueueService14
net start ProjectQueueService14

image

Hope this saves someone some time!

J.

SharePoint 2010: Some or all identity references could not be translated

Okay so my first SharePoint 2010 experience was not 100% positive – as it seems the there are no shortage of funny little problems.

One of the thing I tried to do was to use the Register Managed Account screen.  After entering in the username and password for the account I wanted to register I got the message:image

The specified user DEV001\svcSharePointServiceApp could not be found. Some or all identity references could not be translated.

 

As per usual – the error message has no significance in relation to the actual cause.  It turns out that if you reduce the length of the service account to 20 characters or less the problem goes away.  Seriously – varchar(20) for usernames? Yikes.

Taking the SSD Plunge – Intel X25 M 160GB

intel-x25-m-ssd-series Well – for me, the time has come to give Solid State Disks a go.  The speed benefits versus cost equation is now too good to ignore.

I have a new Dell XPS 16 Quad Core machine on the way and I thought I would get it an SSD so it doesn’t spend most of its time idling waiting for data from the disk.

I did a lot of research, looking at the various options based on the Indilinx Barefoot controller from OCZ, Corsair, Falcon II, Crucial etc. versus the offering from Intel.  The JMicron based drives had such a scary history of failure that I discounted them from my considerations along with anything that doesn’t support the TRIM feature. (Incidentally, not supporting TRIM is amongst the reasons I have not switched to Apple.  Windows 7, although not as exciting is actually a good quality OS)

I should explain that my primary use scenario is for the host operating system and running large IO hungry virtual machines like SharePoint 2010.

Most of the drives priced for mortals at the top of the sequential read/write throughput charts are based on the Indilinx Barefoot controller – and indeed the stats appear to say that if you spend the majority of your time copying large files from place to place, the drive you choose should probably be based on this controller.

However, a more in-depth look at the stats for more realistic use-cases show that the Intel X25 G2 is actually capable of many more small IO operations per second than other similarly priced MLC drives on the market.

Being impatient for the Dell to arrive, I have put it in my HP MINI 2140 NetBook to see how it performs.  It boots faster now and is noticeably faster doing normal things – although not blinding, because the bottleneck is now the slow Atom N270 1.6GHz CPU in this machine.

image The Intel X25 M 160GB is rated by Windows 7 at about 7.2 and since the maximum score possible is 7.9 thats not bad :)

It also shows that my NetBook has bigger issues than disk throughput!

 

 

So I look forward to plugging this baby into the Core i7 Quad Dell XPS 16 when it arrives!

Decrease the sensitivity of the ASP:Menu control in SharePoint 2007

Today’s code nugget falls into the JavaScript-hackery category:

Recently I had a problem where the fly-out menus in the Global Navigation bar in SharePoint would fly-out and block user’s access to links like “View All Site Content” because they had moved their mouse over the Global nav to get there.

Anyhow the request was to make the Global navigation fly-outs less sensitive.  So the code below inserted on a master page ensures that the fly-out menus only expand after the user has actually hovered their mouse for one second over the actual menu item.  A much less crazy behaviour if you have alot of menus.

 

<script type="text/javascript" language="javascript">
    var intNumberOfMenusToFix = 9;
    var objTimer = null;
    var activeMenu = null;
    
    var tdTopMenuItem;
    var intItemCount = 0;
    
    tdTopMenuItem = document.all.item("zz1_TopNavigationMenun" + intItemCount);
    
    while ((typeof(tdTopMenuItem) != "undefined") && (tdTopMenuItem != null)
            && (intItemCount < intNumberOfMenusToFix)) {
        tdTopMenuItem.onmouseover = function() {
                                activeMenu = this;
                                //Reset the timer
                                if (objTimer != null) {
                                    window.clearInterval(objTimer);
                                    objTimer = null;
                                }
                                objTimer = window.setInterval('HoverDelay()', 1000);
                                }
        tdTopMenuItem.onmouseout = function () {
                                //Reset the timer
                                if (objTimer != null) {
                                    window.clearInterval(objTimer);
                                    objTimer = null;
                                }
                                activeMenu = null;
                                
                                Menu_Unhover(this);
                                }
        tdTopMenuItem=null;
        intItemCount+=1;
        tdTopMenuItem = document.all.item("zz1_TopNavigationMenun" + intItemCount);            
    }

    function HoverDelay() {
        //Reset the timer
        if (objTimer != null) {
            window.clearInterval(objTimer);
            objTimer = null;
        }
        
        Menu_HoverStatic(activeMenu);
    }

</script>
HOWTO: Fake the author information for documents in SharePoint

 

When migrating data into SharePoint it is sometimes necessary to upload pages/documents and set the Created and Modified information.

This can be difficult with minor versioning turned on, so in my case I was able to temporarily switch off Minor version while updating the lists and then turn it back on again.

To actually set the Created and Modified information with out leaving any footprints can be a little tricky, but this is how I did it:

sppTargetPage.CheckOut();

//Get the underlying list item
SPListItem sliTargetPage = sppTargetPage.ListItem;

//Set the publishing contact.
sppTargetPage.Contact = <SPFieldUserValue>;
//Check-In
sliTargetPage.File.CheckIn("Checked in by Data Migration", SPCheckinType.MajorCheckIn);

//Stealth Extra update to set modification date/time
SPListItem sliStealth = sliTargetPage.ParentList.GetItemById(sliTargetPage.ID);
sliStealth[SPBuiltInFieldId.Created] = <Fake Create Date> ;
sliStealth[SPBuiltInFieldId.Created_x0020_By] = <SPFieldUserValue>;
sliStealth[SPBuiltInFieldId.Modified_x0020_By] = <SPFieldUserValue>;
sliStealth[SPBuiltInFieldId.Modified] = <Fake Modified Date>;


//Creates new version if minor versioning turned on.
sliStealth.UpdateOverwriteVersion();
1 - 10 Next

 My Employer

 Where is James?

 Skype

My status

 XBOX Live

 Visitor Locations

 ‭(Hidden)‬ Admin Links