Reputation: 1866
I know how to create components, pages, structure group but i got stuck while creating new user using core services of .net? Can anyone help me out of this?
Upvotes: 1
Views: 365
Reputation: 4316
Something like this should get you started:
public void CreateUser(string userName, string friendlyName, bool makeAdministrator)
{
var defaultReadOptions = new ReadOptions();
using (var client = GetCoreServiceClient())
{
var user = (UserData)client.GetDefaultData(ItemType.User, null);
user.Title = userName;
user.Description = friendlyName;
user.Privileges = makeAdministrator ? 1 : 0;
client.Create(user, defaultReadOptions);
}
}
Upvotes: 4