Apr8

Set user permissions for a Website with Nintex

Tags: Nintex Workflow, PowerActivity, PowerShell, SharePoint

If you use the "Create a Site" activity with Nintex Workflow 2007, there is no way to assign detailed user permissions for the newly created site - you can only choose to either inherit the permissions from the parent site or you can manually set a single user as site owner.

But here is the solution: Use the Data One PowerActivity and a few straightforward lines of PowerShell code to manage the user permissions and roles in detail!

   

$webDestination = get-spweb "{WorkflowVariable:AbsolutURL}"

$webDestination.BreakRoleInheritance($true)

$roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment -argumentList "domain\user"

$roleDefinition = $webDestination.RoleDefinitions["Contribute"]

$roleAssignment.RoleDefinitionBindings.Add($roleDefinition)

$webDestination.RoleAssignments.Add($roleAssignment)

$webDestination.Dispose()

Insert the PowerActivity after the "Create a site" activity within the Nintex Workflow Designer canvas. Paste the PowerShell snippet into the PowerActivity. Use $webDestination to set the new site's URL, which you can easily obtain from the "Create a site" activity (configuration dialog > Store URL in). Set -argumentList and RoleDefinitions["Contribute"] according to your requirements. Run your workflow and see for yourself that all permissions have been created automatically.

Regards,

Andreas

 
Feb23

Data One PowerActivity for Nintex Workflow 2007

Tags: Data One, Nintex Workflow, PowerShell, SharePoint

 

 

For advanced users who want to create individual activities for Nintex Workflow 2007
as quickly as never before, Data One offers a one-of-a-kind tool: Data One PowerActivity.

Data One PowerActivity features the seamless integration of arbitrary Windows PowerShell scripts with Nintex Workflows and offers additional functionalities to integrate PowerShell and SharePoint developments.

Use this activity to:

  • Look up data on different sites and site collections
  • Start workflows on different lists
  • Manage site permissions
  • Integrate APIs

 

 

Benefit from Nintex Workflow to automate your business processes and administrative tasks.
Reach your goals even faster now using Data One PowerActivity, the ideal tool for rapid development, prototypes, proof-of-concept studies and agile SharePoint development.

If you are interested in this product you can now download a fully functional 30 days trial version!

 

 

 
Dec15

Synchronize document versions and SharePoint versions with PowerShell

Tags: PowerShell, SharePoint

Imagine you import some documents from file system to sharepoint. You may experience that your former document versions do not match the item versions created by sharepoint. Since the version field is readonly, it is not possible for you to manipulate that value by default.

In this article, I´ll show you one possibility (there´s many) how you can solve that kind of problem. To keep it short, I decided to choose a "no build" approach and just do it with a tiny little helper called PowerShell (PoSH)! That means there´s NO visual studio involved and NO deployment is necessary to get this done.

Before we start scripting we should investigate on the way how SharePoint is handling and managing versions internally. Do to this, activated versioning on list-level is mandatory:

If we take a look at a version history inside the PoSH, we recognize a certain but unexpected pattern (at a first glance) and two relevant fields:

VersionId: 512
VersionLabel: 1.0

If you process updates on an item, the output will change as follows:

VersionId: 513
VersionLabel: 1.1

You can approve the item, and the output will be:

VersionId: 1024
VersionLabel: 2.0

You see, there´s a simple formula which we have to keep in consideration later in the script:
VersionId = (MainVersion * 512) + Subversion

Next we need to add a field to our list to store the former document version of the file system:
Name: ImportVersion, Type: Text

Now we can finally open up the PoSH. If you are working with PowerShell and SharePoint, I recommend you to modify your profile as described on iLoveSharepoint

The script is pretty straight forward though:

$web = get-spweb http://localhost/websites/spbombshell 
$list = $web.Lists["ListName"]
$item = $list.Items[0]
$importVersion = [int]$item["ImportVersion"]
$itemVersion = [int]($item.Versions[0].VersionId / 512)
 
$count = $importVersion - $itemVersion
 
for ($index = 0; $index -lt $count; $index++) {
    
$item.File.CheckOut()
    
$item.File.CheckIn("PoSH Check-In")
    
$item.File.Approve("PoSH Approve")
}

             

Check back the version history of the modified item:

We must get rid of the history lines, so we add one more line to our script:

$item.File.Versions.RecycleAll()

That´s it – your versions are synchronized.

By Markus Alt

     

Technorati-Tags: Sharepoint,Powershell

 
Dec5

Introducing: Data One PowerActivity for Nintex

Tags: Data One, Nintex Workflow, PowerShell, SharePoint, PowerActivity
Was ist die PowerActivity? Die Data One PowerActivity ist eine Aktion für Nintex Workflow, die beliebige Windows PowerShell-Skripte ausführt. So lassen sich die Vorteile des SharePoint-Objektmodells auf einfache Art und Weise mit den Vorteilen von Nintex Workflow und der Windows PowerShell kombinieren. Ideal für Rapid Development und Proof-of-Concept Studien.
 
 
Im folgenden Screencast stelle ich kurz die Data One PowerActivity für Nintex Workflow vor.

By Christian Glessner