I am trying to automate few daily tasks for some of Tridion admins. We have 800+ publications 600+ users and more than 1000 groups. So, I am trying to automate user creation. Recently we have migrated from 2009 version, where I used COM+ to achieve this, but that code is not working anymore on 2013. I want to use core service, hence would be great if some sample project is available. I am using C# (4.0 framework).
My blog post on Setting Rights and Permissions has example code in Powershell which includes creating users and adding groups to them. It should be straightforward enough to implement similar logic in C#.
I assume you are talking about user creation that isn't covered already by synchronization with Active Directory and other such features available out-of-the-box.
To create a user using the Core Service is fairly straight-forward. It involves these steps:
- Create a new
GetDefaultDataon the client and pass in
ItemType.Useras the first parameter. This will give you a UserData object with all of the default data filled in.
- Set the properties you care about, such as
- Save the user by calling
Createon the client and passing in the user object.
The only sample code I have for this is the Tridion PowerShell Modules project I wrote. Perhaps it is still useful for you? If so, have a look at the New-User function in Trustees.ps1. You could even use these modules to automate it, if you know how to use PowerShell.
Also, be sure to download the Core Service API documentation from the 2013 SP1 documentation.