Powershell command to manually create a “My site” in SharePoint:
The “My site” in SharePoint normally gets created by the instantiation process when a user tries to access his/her “My site” for the first time .Now this process depends on how you have configured this functionality to work in your environment. It could either be configured in a way such that the “My site” is already created for the users in the FARM or may be the users need to access their “My site” for the first time and then the instantiation process would run which will then create a “My site” for the user.
This can also be done manually using Powershell .
Mentioned below is the Powershell command which is used to manually create a user’s “My site” …
$serviceContext = Get-SPServiceContext -Site $site
$userProfileConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)
$testuser = $userProfileConfigManager.GetUserProfile(“domain\username”)
Note: Please make sure that you’re logged into the SharePoint server using the FARM account while running this command .Also make sure that the account running this command has enough permissions in the user profile service application too.