Importing Audiences using STSADM

Posted on 2 CommentsPosted in SharePoint 2007, STSADM Commands

I recently posted about exporting audiences using my gl-exportaudiences STSADM command.  Of course an export wouldn’t be of much use if you didn’t also have an import so I give you gl-importaudiences. Developing this was really easy as I already had code that created an audience and its associated rules.  All I had to do was read in the source XML file, do a little refactoring of the audience creation code and then call the […]

Exporting Audiences using STSADM

Posted on 4 CommentsPosted in SharePoint 2007, STSADM Commands

I’d been wanting to build an export and import command for Audiences for quite some time but just haven’t gotten around to it.  I’m currently looking for a good sample command to build during a possible talk at the next Best Practices conference so I decided to give this one a whack considering that I already had a good chunk of the code written and just needed to repurpose it.  I don’t know if I’ll […]

Enabling Audience Targeting on a List

Posted on 3 CommentsPosted in SharePoint 2007, STSADM Commands

I thought I was done documenting my audience related STSADM commands and then I realized that I had completely forgotten one.  The first audience related command I had created was to enable audience targeting on a list – I called it gl-listaudiencetargeting.  I needed this because my current project had tons of lists that that needed audience targeting turned on.  Eventually these lists were added via a Feature but initially I did it via the […]

Setting the Audience Compilation Schedule via STSADM

Posted on 1 CommentPosted in SharePoint 2007, STSADM Commands

In an effort to wrap up my audience related STSADM commands I created a command that allows me to set the audience compilation schedule via STSADM.  I had to do some disassembling to figure out how to do this and it turned out that the code was virtually identical to what I had done for the gl-setuserprofileimportschedule command.  So it turned out that I was able to create this command by simply coping the code […]

Deleting an Audience via STSADM

Posted on Leave a commentPosted in SharePoint 2007, STSADM Commands

Using the commands I’ve created so far you can now create audiences, add rules, and display those rules all via STSADM.  If you’re like me and you do a lot of testing of this stuff before you push out the final version then you’ll want a way to also easily delete audiences that you’ve created.  Of course you could easily do this via the browser but what if you’ve added complex rules to your audience […]

Displaying Audience Rules via STSADM

Posted on Leave a commentPosted in SharePoint 2007, STSADM Commands

Okay, so you’ve created your audience and used my gl-addaudiencerule command to add some complex rules to the audience.  Three months later you’ve forgotten what those rules are and need to see them again – unfortunately you can’t do that via the browser, so what do you do?  Simple, you run gl-enumaudiencerules, another command I’ve created to help manage audiences via STSADM. This command is really simple so I’ll be brief – I simply loop […]

Assigning Rules to Audiences via STSADM

Posted on 1 CommentPosted in SharePoint 2007, STSADM Commands

If you read my last post, Creating Audiences via STSADM, then you know that I’ve been working on a project which requires me to be able to script out the creation of audiences via STSADM.  My last post covered the creation of the audience itself, but an audience with no rules isn’t all that useful, so for this post I’ll be covering my next custom command, gl-addaudiencerule, which enables you to add complex rules to […]

Creating Audiences via STSADM

Posted on 2 CommentsPosted in SharePoint 2007, STSADM Commands

The project that I’m currently working has a need to create a ton of audiences representing divisions, departments, locations, etc.  We wanted to be able to include the creation of these audiences in our install script so that we easily recreate the audiences in various environments. To accomplish this task there were two core things I had to figure out – the first was how to create the actual audience, this was the easy part.  […]

Programmatically Setting Web Part Audience Targeting

Posted on 4 CommentsPosted in SharePoint 2007, STSADM Commands

I’ve been doing some work on my gl-exportlistitem2 and gl-addlistitem commands so that I can support the import of web part pages.  I thought I was about done until I discovered that I had an issue with pages and web parts that were using audience targeting.  There was actually two issues – one was that when I imported a page to another farm the GUID used to store the audience didn’t match up so it […]