Importing Sharepoint Sites
This is the follow-up to the Export-Sharepoint Sites post early this week.
It’s great that we can export a Sharepoint site now, and even get a nice report giving us document counts which we’ll need to validate that the import has worked correctly. But now we need to do the import, and we want it to be as easy as possible, and here’s how I did it.
Exporting Sites in Sharepoint
I think I’ve mentioned this before, but at work we are divesting one of our business units which is requiring us to split up a lot of data. One of the bigger challenges has been what to do with our Sharepoint site. At SeraCare we make very extensive use of our Sharepoint server and have a nearly 80gb database! This made the upgrade from Sharepoint 2003 (not WSS 3.0) to Sharepoint 2010 pretty challenging, let me tell you! Now I have to pick up over 800 sites from our Intranet and send it over to the IT department of this divested business unit. Here’s how I plan to do it.
Objects and Hashtables
I expect, if you got the right group of people together, you could have a good old Mac vs PC style argument over the use of Powershell Objects (PSObjects) and hashtables. And I’ll be honest, while I’ve used hashtables a lot for splatting I’ve used them very little for anything else. Time to look at the two and figure out which is better, once and for all!
Setting the Manager Field in Active Directory
One thing I like to do in Active Directory is set the Manager field. To be honest, I’m not sure why I do this because we’re not using it, it’s just something I do. I guess you could call it future proofing. But there is a problem with this and that’s what do you do when a Manager leaves the company? There’s no easy way to pick up their direct reports and transfer them to a new manager. Until now.
More Advanced Functions
Want to add some more functionality to our scripts and functions? Want your scripts to operate like the standard Powershell cmdlet’s, with the same Common Parameters? Well you can, and it’s not difficult at all. Read on to add these abilities to your scripts!
Multithreading Powershell Scripts
In your scripting journey there will come a time that you have a script that is simply running too long. Perhaps you’re wanting to gather information hourly and the script is taking two hours to run. Maybe you’re a consultant and need a discovery script to run as fast as possible so you can get out of there? Whatever it is at some point you’ll consider multithreading. Powershell has this capability baked right into it using Powershell Jobs, but .Net has a way too, and initial testing shows it might be faster! Read on to see what I mean.
Set-ShutdownComputers – Without Confirmation
A while back I wrote a script that would restart a computer, but require a very firm confirmation from the administrator. Two levels of confirmation, in fact and it’s been a fairly popular post on the blog too. Recently someone asked for a similar script to work off of a set of computers, and considering the work I’ve been doing recently with the pipeline I thought this was an ideal time to revisit that script and add some functionality. And remove the confirmations because seriously, what could go wrong?
Spiceworks Reporting and Powershell
The Spiceworks reporting engine is pretty good, and the web interface they developed for it will meet a lot of your needs. And with the ability to share your reports with others there are literally thousands of reports out there for you to choose from. Then they introduced SQL based reporting and really opened up what you could do. But wouldn’t it be nice to bring that data into Powershell? Read on to see how you can do this.