CreatePersonalSite()
- From: "peddie" <s_nujcharee@xxxxxxxxxxx>
- Date: 27 Feb 2006 00:51:29 -0800
Hi
I have the code below to create Personal Site to all users in the
profile database in one shot. I am very new to this whole coding thing.
I have no idea what so ever of where to apply this code and how to run
this code, anyone could you please help?
Thanks in advance
Peddie
public static void Create()
{
//Connect to the portal and get the portal context
TopologyManager topology = new TopologyManager();
PortalSite portal = topology.PortalSites[new
Uri("http://192.168.0.10:5555")];
PortalContext context = PortalApplication.GetContext(portal);
//initialize user profile config manager object
UserProfileManager profileManager = new
UserProfileManager(context);
foreach (UserProfile profile in profileManager)
{
Console.Writeline("Creating a Personal Site for " +
profile["PreferredName"] + "...");
try
{
profile.CreatePersonalSite();
Console.Write("Succcess!\n");
}
catch (PersonalSiteExistsException)
{
Console.Write("Site already exists!\n");
}
catch
{
//write code to Log or Display error
.
- Follow-Ups:
- RE: CreatePersonalSite()
- From: Gustavo
- RE: CreatePersonalSite()
- Prev by Date: RE: Sharepoint Portal in Virtual Machine
- Next by Date: Re: Improve Performance
- Previous by thread: Web Part and Access database
- Next by thread: RE: CreatePersonalSite()
- Index(es):
Relevant Pages
|