Tag | Powershell Posts

My most recent project has been to migrate a bunch of sites from WSS 3.0 (SharePoint 2007) to SharePoint Server 2010. The users are currently working with WSS 3.0 and Office 2003, so the new ribbon based UI in 2010 will be completely new. My client wants to avoid the new SharePoint 2010 look and feel until they’ve had time to train their users, so we’ve been testing the upgrades by keeping them with the 2007 user interface. Permission to perform the Visual Upgrade One of the first things we noticed ...
MapRedux – #PowerShell and #Big Data Have you been hearing about “big data”, “map reduce” and other large scale computing terms over the past couple of years and been curious to dig into more detail? Have you read some of the Apache Hadoop online documentation and unfortunately concluded that it wasn't feasible to setup a “test” hadoop environment on your machine? More recently, I have read about some of Microsoft’s work to enable Hadoop on the Azure cloud. Being a "Microsoft"-leaning technologist, ...
I've recently had to help a couple of splinq-challenged colleagues with some caml queries. Here are some of my favourite ways to make caml edible. Use '! Too many developers seem ignorant of the fact that xml works just as well with single apostrophes as with double. This is, of course, also true for other things, like html. Use @ and multiline Use string.Format Validate the query using a simple webpart or, much better, powershell Don't use third-party clever stuff I'm not sarcastic when I say "clever," ...
Starting timer jobs from Powershell is easy.Get the job, execute:$webApp = Get-SPWebApplication "http://$($env:computername... = $webApp.JobDefinitions | Where-Object { $_.Name -eq "<timer job name>"}$job.Execute([Sys... # In my timer job I don't actually use the guid, so just create a new oneWrite-Host "Done."...mostly as a reminder to myself. :-) ...
What you need / What you've got? Pretty obvious, when a user edits/changes a page, you need someone to check its all good before it goes live! Aka Publishing Approval You can use the "Publishing site with workflow" template or enable it manually or set it up in your custom site definition. BUT...you've got an entire site collection full of web sites and you need to do it "en-mass" … step up Powershell. A common scenario could be you were working in Stage or Pre-go live and having Approval workflow ...
Recently a colleague of mine encountered the error below and wanted to know how to get past itRecently a colleague of mine encountered the error below and wanted to know how to get past it. When configuring SharePoint 2010 Publish Portal you encounter the following error “The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator. “ This issue is caused by lack of Session State Service ...
Took me a little while to figure this one out, you’ve assigned your workflow to a library and you can set all other other flags like “AllowStartChange” and “AllowStartCreate”, but cant see how to set “Start this workflow to approve publishing a major version of an item.” That’s because its a property on the library itself called “DefaultContentApprovalWork... So you might want to do something like this…where you have the WorkFlow Association object ($wfAssociation) and the list/library ($list). ...
If you have not heard the latest technical news yet, the SQL Server 2012 Virtual Launch event is today March 8, 2012! Register to not to miss this opportunity to interact with technology experts and win cool prizes! I am thrilled and excited! Why? Because like in the automotive industry, every new iteration of a vehicle is more fuel efficient, safer, more polished, looking more attractive and fun to drive. Sure, the the new version of the SQL Server is ready to take me further in what I can deliver ...
While at a client location this week I ran into the situation of their SharePoint deployment recognizing a handful of people by their Display Name and others (a lot more) by their “domain\username” account. And since they had User Profile in place they felt something was just not right, and if you combine that and the fact most of the information available around that issue tells you it is a profile issue, you can understand the frustration of going back to the sync process and correcting in AD, ...
In order to migrate (copy) an InfoPath form from one environment (say test to production), there are several things to consider. First, does your form use a data connection to retrieve or submit data? Second, if you update the form in the future, do you want all of the locations where this form is used to be updated as well? Consider these issues while reading the instructions below. Step 1: Create a form First, let’s create a simple InfoPath. For my example, I’ve created an overly simplified leave ...
I gave a SharePoint presentation at Norwegian SharePoint Community last week. I wanted to have as smooth a presentation as possible by minimizing page load times. The easiest way to do this, is to make sure that the pages you request are already cached. And the easest way to do this, is to pre-request the pages. ...and an easy way to do this, is to have a PowerShell script request these pages in the background. We just want to request the pages, we are not concerned with error status or how long ...
SharePoint 2010 developers love Powershell. It really is a huge step forward. If you still haven't started to use it, do so. But I got bit the other day, when I added a try-catch block to my code. See if you can spot it: Try { $legen = Create-Object Reidar.Husmo.AwesomeClass $legen.Dary(42) } Catch { "an error occurred" } As you no doubt immediately spotted, Powershell does not have a Create-Object. But the try-catch hides coding mistakes. There is no indication that things are not ok, not even "an ...
In the lifespan of an organisation it’s messaging environment be transitioned to a newer version several times. Whilst this is not a complicated thing to do it does require some level of planning and thought. I’ll be addressing the transitioning from Exchange 2003 to 2007 from a fairly simple view here. Since the general outlines of the process are the same for nearly every situation there is no need for different detailed documents on this. We’ll be working with the following infrastructure in this ...
I was working on a project to send a html attachment in a powershell script. I have the HTML string so all I want to do is create an attachment from the string. Here's the code: $SMTPserver = "mail.company.com"$from = "from@company.com"$to = "to@company.com"$subject = "Test PS Attachment"$emailbody = "test"$attText = "The text of the attachment"$attName = "Test.txt" $mailer = new-object Net.Mail.SMTPclient($SMTPse... = new-object Net.Mail.MailMessage($from, $to, $subject, $emailbody) $att = ...
I had originally planned to write this using the live writer, however it isn't wanting to install so I guess it will have to wait until next time.I was working along the other day and one of the users I had added in was displaying as his domain account instead of his first and last name. I was in a semi rushed mode at the time, so I decided to skip the "steps" as I call it to find out all you can about your problem user(s). But I will list out what I would have done had I had more time.Side note: ...
The awesome Azure team is at it again! Earlier this month, they released an early preview of the new Windows Azure SDK for Node.js. They have just released the December Update with several new features, including: Windows Azure PowerShell for Node.js 0.5.1 update, IISNode 0.1.13 update Node.js 0.6.6 update from Joyent, Installer in-place upgrade support for all these components Numerous bug fixes in all three components Read more about it at the Azure team blog. Haven’t tried it yet? Get started ...
Today's 50% off Deal of the day at $23.99 from Microsoft Press at http://shop.oreilly.com/pro... is Windows PowerShell™ 2.0 Best Practices "Apply best practices for automating system administration with Windows PowerShell 2.0 and optimize your operational efficiency and results. This guide captures the field-tested tips, real-world lessons, and candid advice of practitioners across the range of business and technical scenarios and across the scripting life cycle" ...
For an integration solution with lots of dependencies, it's difficult to definitively state that everything is wired up correctly and that all components in the stack are working. A while ago, Michael Stephenson proposed having a diagnostic service in a solution as a quick way of verifying that a given environment was working, end-to-end. Initially I was sceptical, on the grounds that there shouldn't be any code in a solution which isn't directly solving a business problem, but having tried it out ...
Renaming SharePoint service app databases When you install SharePoint 2010 and use the wizards, you will be asked which services you’d like to install. By default all but Lotus-Notes-Connector are preselected. SharePoint will install the services and assign a plethora of databases to serve these services. Alas, horror of horror, all these databases are named by Microsoft and all end with GUIDs. DBAs and other keepers of standards abhor it. Sometimes they even go a step further and want the DB names ...
We previously tried to use msbuild to adjust configuration files for different environments. Recently I found C onfig Transformation Tool(CTT) on CodePlex and with addition of global replace using powershell it is enough and easier to do all required modifications Content of ChangeConfig.cmd: ctt s:..\web.config t:WebConfig.CTT d:..\web.config powershell.exe -command "Get-Content ..\Remoting.config | ForEach-Object { $_ -replace '//localhost/ServicesCI/', '//ServerName01/ServicesCI/' } | Set-Content ...
I have had a total of 2 years, 3 months, 2 hours of Windows Azure developer experience and it humiliates me to suicidal extents to confess that I am hardly conversant with the platform’s native Diagnostics technicalities. “I am Tinu Thomas and I am a diagnostic-ignorant Azure Developer.” Oh my god…how could he?? Now that we have that past us <sheepish grin>, I would also like to bask in the afterglow of redemption. Thanks to a much-needed job transition phase, I was able to find enough time ...
SQL Server team has released the new SQL Server Data Tools CTP4. Congratulations and Thanks to Gert Drapers and his team with this great milestone. To lear more about this SSDT CTP4 Release, check: What’s new in SQL Server Data Tools CTP4?http://blogs.msdn.com/... Server Data Tools CTP4 vs. VS2010 Database Projectshttp://blogs.msdn.c... VSDB->SSDT ...
Microsoft Lync Server 2010 communications software and its client software, such as Microsoft Lync 2010, enable your users to connect in new ways and to stay connected, regardless of their physical location. Lync 2010 and Lync Server 2010 bring together the different ways that people communicate in a single client interface, are deployed as a unified platform, and are administered through a single management infrastructure. Workload Description IM and presence Instant messaging (IM) and presence ...
© 2011 By: Dov Trietsch. All rights reserved finding a person in the forest or Limiting the AD result in SharePoint People Picker There are times when we need to limit the SharePoint audience of certain farms or servers or site collections to a particular audience. One of my experiences involved limiting access to US citizens, another to a particular location. Now, most of us – your humble servant included – are not Active Directory experts – but we must be able to handle the “audience restrictions” ...
Sometime ago, say around mid April, 2011 I posted about Installing SharePoint 2010 on Windows 7 by going in a different path than using the standalone installation. This post is about what happens after the installation and initial configuration of your Windows 7 “development farm” gets the bits, and goes through the Central Admin and management perspective to get you to the first screen that says “Hi, SharePoint here, would you like to play a game of chess” (yeah, it does not really say that, but ...
Coming from SPC a couple of weeks ago, during the keynote there was a demo on some great Visio Diagrams. It was created using the following: http://visiospfarmaddin.cod... Expect a post here in the next week or so on how to configure it. Another great tool I came across is targeted to those who are becoming familiar with PowerShell for SharePoint, and also if you want to use PowerShell with SharePoint Online. It is a Command Builder, you pick the verbs and nouns as you would regularly do with ...
Many times I need to merge two separate datasets that have a common key column – for example: dataset 1: ID, Name, Weight, Height dataset 2: ID, Address1, Address2, Phone1, Phone2 I can’t just concat the data together, instead I need the merge to happen around the ID key, so that each ID only has a single row in the result. So, of course I wrote a powershell script to do this for me. Take a look at it below. I called it “Merge-TsvFiles”, but it takes a delimiter as one of its paramters, so you could ...
I'm a big fan of automated testing which actually proves something. Unit tests may prove all the components in a solution work independently, but that doesn't mean you have a working solution. Integration tests give you confidence in the whole solution, but the cost of having a test suite with a lot of external dependencies is the risk of false build failures and long-running test suites. To get something in between, we have acceptance tests written in SpecFlow which run tests at the highest layer ...
I got this error today while trying to access my new SharePoint 2010 environment via PowerShell: Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again. If I would have just read the error message a little more carefully, I would have realized that I should start by looking at my permissions in SQL – which my account didn’t. This happened because I installed SQL ...
I'm currently in Seattle enjoying the start of some of the activities around the SQL PASS Summit. One of the activities that I'm looking forward to is the book signing session for the MVP Deepdives Volume 2 at lunchtime on Wednesday. I was fortunate to be one of the 60 or so authors this time around with a chapter on using Powershell to manipulate Analysis Services databases. All of the proceeds from this book go to support Operation Smile. You'll find the book's website here: http://www.manning.com/dela... ...
“If only there was some way to quickly and silently install applications and tools on my windows machine.” Chocolatey is kind of like an apt-get, but for Windows. It is a machine level package manager that is built on top of NuGet command line and the NuGet infrastructure. Jason Jarrett recently described it as the free/OSS windows app store. What that means for you is that you can install and update software (applications and tools) on your machine with a few keystrokes and chocolatey does the rest! ...
Recently I was tasked with a file cleansing exercise. The endeavor looked simple, but the solution was not, I needed to prepare a file for processing, but wanted to first proof concept my approach so I opted to utilizing this opportunity to learn PoweShell. More about the task: I was supplied with a series of CSV files in which the data looked like 123,ABC,XYZ "1,2,3", ABC, "XY,Z" 123,"A,BC", XYZ As you can see this is something I think we may call alternating double-quotes comma delimited file with ...
Recently I was assigned a task of helping a developer to cope with an unusual input file processing. The file we needed to load into SQL Server had double quotes surrounding those fields that contained comma(s). So a short excerpt from it would resemble something like: 123,ABC 456,"D,E,F" "7,89",GHS Since SSIS’s Flat File Connection does not support alternating text qualifiers, the chief difficulty stems from the fact if we even only remove the quotes, the file structure becomes broken because the ...
A few weeks ago I ran into an error while setting up our test farm. I was creating the service applications and when I got to PowerPivot, I got the following error: I was able to work around this error by using PowerShell to create the service application. Background First, some details of our installation: two web front ends, two application servers, and one SQL server. All are running Windows Server 2008 R2 x64 with Service Pack1. The SQL Server is 2008 R2 with SP1. The SharePoint servers are SharePoint ...
We recently implemented an email archiving solution at work. One of the requirements was that we configure automatic purging of messages older than 6 months in Exchange. One of our IT managers spent the better part of a month moving items out of the only copy of his PST into his mailbox so that they could be captured by the archive system and free him from his PST. For whatever reason none of these messages were captured by the archive system and were purged by Exchange as per the items older than ...
Introduction The conference sessions are starting to appear on the Channel 9 RSS feeds right now. If you are like me then you probably want to download all of them and watch them later. Here is the method that I use to grab all the videos and thought that it would help others. Note: You can use either Juice or PowerShell (which is located at the bottom of this post). Let’s do this with Juice Navigate over to http://channel9.msdn.com/Ev... and select the option to Subscribe to this ...
This post is going to be the shortest of my all. Recently, to my surprise, I found myself developing quite a lot with PowerShell, it is not that I have never written scripts, but those mostly were VBScripts. To start off I can tell that there is a ton of examples on the World Wide Web, and I know of nine free PowerShell books, alas I had no time to read any due to very short project deadlines and when I needed a specific example the search results returned were exhaustive too often, yet incomplete. ...
When developing WCF services that interact with a custom Security Token Service (STS), you will need to create at least one X.509 certificate. If you have access to a trusted certificate authority – e.g. a Windows Active Directory domain – then this task is pretty simple. But if you don’t, or maybe you would just rather create a set of self-signed certificates, here is an approach that works well for me. This particular scenario utilizes three separate certificates. The first one is named “localhost” ...
Let’s define what this should mean and be about. How can I as an IT Pro be able to use TFS for the tasks and activities I normally do. Whether it is controlling a project or creating scripts and such. The vision while it goes into execution with TFS, will include a process with SharePoint somewhere in there too. Scenario #1: Change Control, Change Management or Specific no-code Project Control. As an IT Pro, what do I do? Change Control, Change Management, Project Management. The problem? Yes, we ...
I was recently asked to review Studio for Wijmo MVC by Component One and, overall, I am impressed. There are 2 major components of this. The first is Wijmo Complete which is a collection of over 30 UI widgets (very similar to jQuery UI). The second is Wijmo Scaffolding for MVC which builds upon the scaffolding that was released as part of the MVC 3 Tools Update (note: is does *not* build on top of powershell-based MVC Scaffolding which Microsoft released earlier this year). Some of the Wijmo widgets ...
Since exchange versions from 2007 and up put more emphasis on the webservices for use in the distribution of the offline address book, out of office, the scheduling assistant and autodiscover (a.k.a outlook connectivity to exchange) the correct configuration of the virtual directories and IIS components is the main key to a healthy exchange environment. It is for this reason that I have compiled a quick reference as to how these components should be configured in order to function properly and so ...
Recently, my Active Directory user account was getting locked out on a regular basis after changing my user account password. In our environment, the most two common causes for Active Directory user account lockouts are disconnected RDP sessions or an invalid password on a mobile device configured for Exchange ActiveSync access. I used the LockoutStatus.exe Tool to search for one or more disconnected RDP sessions using my old password but I was not able to find anything. So, the next thing I checked ...
Windows Server 2008 R2 has a built in Scheduled Task that defragments your hard drive sometime over night. But, I was wondering if this is actually working, and on one server I have found it isn't. So, here is my PS script that I'm working on. This is also my first "real" PowerShell script I've written. It took me some time! foreach ($computerName in Get-Content "C:\Users\matt.ladd\Desktop... { Write-Host $computerName $drive = Get-WmiObject -computerName $computerName -Class Win32_Volume ...
Its been a while since I played with Web forms, AJAX stuff. I was curious in checking out, particularly how the AJAX Control Toolkit which used to be my favorite in the past is evolving. There is a new release of AJAX Control Toolkit, just hot off the oven. You can download the binaries from http://ajaxcontroltoolkit.c... Now, while the regular way we have downloaded and used AJAX Control Toolkit is by visiting the above codeplex page and download the latest version, there is also a newer ...
I have been working with power shell quite a bit lately, I thought I’d write about 3 tips that have helped me. Notice how it is titled, "Helpful"? not "Ground breaking". It includes helpful commands that I have been using and a nice little Script editor that has one feature enough to win me over. Other's have writen about the commands (most of the time I write so I remember what I've done and how I have resolved issues) but I have not seen others write about other script editors. If you have been ...
As I get more and more proficient with Windows PowerShell, I find that my profile is getting more and more useful. I thought I’d post my current profile’s content here, in case anyone finds any of these functions useful. set-alias gh get-help set-alias gcmd get-command set-alias wo where-object set-alias ss select-string function sync {tfpt online /adds /deletes /diff "$args" /recursive /noprompt} function kil {kill -name $args[0]} function e {explorer $args[0]} function sn { & 'C:\Program Files ...
Motivation Wie gehen Sie in dieser Situation vor: Eine von Ihnen verwendete .NET-Drittbibliothek liegt in einer neuen Version vor und Sie müssen die Abhängigkeiten in all Ihren Projekte aktualisieren. Je nach Projekt und Notwendigkeit hatten wir bei ESRI Deutschland dafür bisher u.a. folgende Lösungs-Szenarien: Policy-Files Sie dienen zum „Umbiegen“ der von den eigenen Projekten verwendeten Version auf die aktuelle. Das geht allerdings nur bei GAC-basierenden Assemblies und die sollte man aus diversen ...
MvcScaffolding is a tremendous productivity improvement for MVC developers. Earlier this year, Steve Sanderson posted the definitive 7-part series on MvcScaffolding which is a must-read for anyone serious about doing scaffolding. The best part about the scaffolding infrastructure is that MvcScaffolding is actually built on top of another package called T4Scaffolding. T4Scaffolding can be used as the basis for *any* scaffolding – not just MVC projects. To that end, we can enjoy the same power of MvcScaffolding ...

Dears,

I've faced a strange exception when trying to add a list item using powershell. The exception stated that the update method cannot take 0 arguments. Resolution was pretty simple, just make sure that the user running the script is a member of the administrators group in site permissions.

Cheers,

Alot of calls I get are related to the information store service of the exchange server not starting. Since troubleshooting why this services does not start is often related to alot of stress (after all, your users and managers will be pounding your door as they cannot access their email) it is always handy to have some reference as to where you can start and what direction it can take. This is my basic modus operandi so feel free to give suggestions on how to improve it :). First of all you need ...