If you want to create personal sites in bulk use the script below.
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$site = new-object Microsoft.SharePoint.SPSite(“https://mysites.contoso.com”);
$ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site);
$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext);
$AllProfiles = $ProfileManager.GetEnumerator();
#UserFormat is testUser001. Change as per your need.
$UserName = “contoso\tstUser0”
for ($i = 1; $i -lt 100; $i++)
{
[string]$ActualUser = $UserName + “0” + “$i”
#Write-Host $ActualUser
if($ProfileManager.UserExists($ActualUser))
{
try
{
$profile = $ProfileManager.GetUserProfile($ActualUser)
$AccountName = $profile[“AccountName”].Value
Write-Host “Creating Personal Site for $AccountName” -ForegroundColor Yellow
$profile.CreatePersonalSite()
write-host “Personal Site has been created.” -ForegroundColor Green
}
catch
{
write-host “Personal Site Could not be created” -ForegroundColor Red
}
}
}
#List All Sites for the user
$Databases = @();
#UserFormat is testUser001. Change as per your need.
$UserName = “contoso\tstUser0”
for ($i = 1; $i -lt 100; $i++)
{
[string]$ActualUser = $UserName + “0” + “$i”
#Write-Host $ActualUser
if($ProfileManager.UserExists($ActualUser))
{
try
{
$profile = $ProfileManager.GetUserProfile($ActualUser)
$AccountName = $profile[“AccountName”].Value
$DB = New-Object PSObject
Add-Member -input $DB noteproperty ‘AccountName’ $AccountName
Add-Member -input $DB noteproperty ‘Maximum’ $profile.PersonalSite.Url
$Databases += $DB
}
catch
{
write-host “Personal Site Could not be created” -ForegroundColor Red
}
}
}
$Databases | Out-File E:\TestUsers.csv
$Databases | Out-GridView