CreatePersonalSite()

Tech-Archive recommends: Fix windows errors by optimizing your registry



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

.



Relevant Pages

  • RE: CreatePersonalSite()
    ... You need to have some experience with Visual Studio and code ... I have the code below to create Personal Site to all users in the ... profile database in one shot. ... PortalSite portal = topology.PortalSites[new ...
    (microsoft.public.sharepoint.portalserver.development)
  • Where and how to apply CreatePersonalSite()
    ... I have the code below to create Personal Site to all users in the ... profile database in one shot. ... PortalSite portal = topology.PortalSites[new ... UserProfileManager profileManager = new UserProfileManager; ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Updating of AD Attribute wwwHomePage
    ... WebSite and ... PersonalSpace (Personal site is the alias for this property, ... You can find them if you go site settings - Manage profile database - View ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Personal Sites and Name Changes
    ... User Profile and add the appropriate information. ... Mike Walsh wrote: ... WSS FAQ www.wssv3faq.com / wss.collutions.com ... When I go to the Porperties area of the Personal Site it reads: ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Personal Sites and Name Changes
    ... User Profile and add the appropriate information. ... Mike Walsh wrote: ... WSS FAQ www.wssv3faq.com / wss.collutions.com ... When I go to the Porperties area of the Personal Site it reads: ...
    (microsoft.public.sharepoint.windowsservices)