aarebrot.net Frode's blog on Sharepoint and other stuff

Using PowerShell to retrieve Content Types and associated Fields

Posted on February 28, 2011
VN:F [1.9.22_1171]
Rating: 5.0/5 (4 votes cast)

I’ve previously posted PowerShell scripts that allow you to extract Content Types or Fields from a SharePoint site. But last week a commenter by the named Jeff posed a valid question. What if I want to extract all Content Types in a SharePoint site, and show the associated Fields for each of them?

Changing the properties of an existing Web Part using PowerShell

Posted on September 2, 2010
VN:F [1.9.22_1171]
Rating: 5.0/5 (3 votes cast)

Sometimes you need to change the properties of a Web Part without browsing to the page itself and set it. There could be numerous reasons as to why you would want or need to do this. A while back I created a really simple redirect web part for one of my clients. It had two custom properties, EnableRedirect and Url. If EnableRedirect was true, it would redirect the user to the specified Url. Obviously, if you want to change either of these properties while the EnableRedirect is true, that's going to be a problem.

Fast forward and the redirect web parts need to be changed and/or disabled. Obviously we can't navigate to the page and just change it, because the page will redirect you. But it can be done relatively easy using PowerShell.

Powershell: Retrieve Content Types and Column Fields

Posted on August 25, 2008
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

So you just found the wicked awesome list of content types and life is good, but you kinda wish you could get a hold of all those content types and column fields that you made yourself. No worries, Powershell is your trusted friend who's always ready to help.

Below are two very basic Powershell scripts. They both connect to a specified site collection, and one exports Content Types while the other exports Column Fields.

Powershell: Check-in multiple files!

Posted on June 17, 2008
VN:F [1.9.22_1171]
Rating: 1.0/5 (2 votes cast)

I do a lot of CSS styling with my current project, and with that comes a lot of trial and error. I make image files, upload them, see how they look, delete them, upload new ones, take a look again, and so on. Depending on what stage I am in designing the page, I sometimes just stick the images in the Style Library and load them from there inside my CSS.

Luckily there's a "Upload multiple files" option in Sharepoint, but unfortunately there's isn't a quick way of checking in multiple files of a single directory. Well, there sort of is... But I just like Powershell better. Anyway, for the longest time I was clicking on each file individually and checking them in one by one. I figured there has got to be an easier way! Turns out the answer is Powershell.