Following powershell script will provision UPA service.
Points to be noted:
1. Update $UserProfileServiceAccount with the account with respect to your environment.
2. Save the follwing script on some meaningful name like psProvisionUserProfileService.ps1
3. Call the file using bacth file & it contains follwoing and save as ProvisionUserProfileService.bat
cd /d %~dp0
powershell -noexit -file ".\psProvisionUserProfileService.ps1" "%CD%"
pause
Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0
$UserProfileServiceName ="UserProfileServiceAppPool"
$UserProfileServiceAccount = "xxxxxx"
$saAppPoolName = New-SPServiceApplicationPool -Name $UserProfileServiceName -Account $UserProfileServiceAccount
# UPA specifics
$upaInstanceName = "User Profile Service"
$upsInstanceName = "User Profile Synchronization Service"
$upaName = "User Profile Service"
$upaProfileDBName = "SP_User_Profile_DB"
$upaSocialDBName = "SP_User_Social_DB"
$upaSyncDBName = "SP_User_Sync_DB"
Write-Host "Creating $upaName Application & Proxy..."
$upa = New-SPProfileServiceApplication -Name $upaName -ApplicationPool $saAppPoolName -ProfileDBName $upaProfileDBName -SocialDBName $upaSocialDBName -ProfileSyncDBName $upaSyncDBName
New-SPProfileServiceApplicationProxy -Name "$upaName Proxy" -ServiceApplication $upa -DefaultProxyGroup
Write-Host "Starting the $upaInstanceName Instance..."
Get-SPServiceInstance | where-object {$_.TypeName -eq $upaInstanceName} | Start-SPServiceInstance
Write-Host " UPA Done!"
Remove-PSSnapin Microsoft.SharePoint.Powershell -EA 0
Points to be noted:
1. Update $UserProfileServiceAccount with the account with respect to your environment.
2. Save the follwing script on some meaningful name like psProvisionUserProfileService.ps1
3. Call the file using bacth file & it contains follwoing and save as ProvisionUserProfileService.bat
cd /d %~dp0
powershell -noexit -file ".\psProvisionUserProfileService.ps1" "%CD%"
pause
Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0
$UserProfileServiceName ="UserProfileServiceAppPool"
$UserProfileServiceAccount = "xxxxxx"
$saAppPoolName = New-SPServiceApplicationPool -Name $UserProfileServiceName -Account $UserProfileServiceAccount
# UPA specifics
$upaInstanceName = "User Profile Service"
$upsInstanceName = "User Profile Synchronization Service"
$upaName = "User Profile Service"
$upaProfileDBName = "SP_User_Profile_DB"
$upaSocialDBName = "SP_User_Social_DB"
$upaSyncDBName = "SP_User_Sync_DB"
Write-Host "Creating $upaName Application & Proxy..."
$upa = New-SPProfileServiceApplication -Name $upaName -ApplicationPool $saAppPoolName -ProfileDBName $upaProfileDBName -SocialDBName $upaSocialDBName -ProfileSyncDBName $upaSyncDBName
New-SPProfileServiceApplicationProxy -Name "$upaName Proxy" -ServiceApplication $upa -DefaultProxyGroup
Write-Host "Starting the $upaInstanceName Instance..."
Get-SPServiceInstance | where-object {$_.TypeName -eq $upaInstanceName} | Start-SPServiceInstance
Write-Host " UPA Done!"
Remove-PSSnapin Microsoft.SharePoint.Powershell -EA 0
No comments:
Post a Comment