Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sharepoint 创造;“我的网站”;通过powershell抛出错误_Sharepoint_Sharepoint 2013 - Fatal编程技术网

Sharepoint 创造;“我的网站”;通过powershell抛出错误

Sharepoint 创造;“我的网站”;通过powershell抛出错误,sharepoint,sharepoint-2013,Sharepoint,Sharepoint 2013,我试图通过powershell创建一个“mysite”,但我遇到了一个错误,我很难找到答案 这是我得到的错误: 新对象:使用“1”参数调用“.ctor”异常:“UserProfileApplicationNotAvailableException_Logging::UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache没有c05da7c0-d405-4655-a7fa-08e271f4174d” 这是我的PS代

我试图通过powershell创建一个“mysite”,但我遇到了一个错误,我很难找到答案

这是我得到的错误:

新对象:使用“1”参数调用“.ctor”异常:“UserProfileApplicationNotAvailableException_Logging::UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache没有c05da7c0-d405-4655-a7fa-08e271f4174d”

这是我的PS代码:

param
(
[Parameter(Mandatory=$true)]
[string]$username
)

asnp *sh*


$mysite = Get-SPSite "http://mysite.dev.loc"

$context = Get-SPServiceContext $mysite
$upm =  New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

#Create user profile
$profile = $upm.ResolveProfile($username)

if(!$profile)
{
Write-Host "$profile does not have a profile. Can't create personal site"
}

elseif($profile)
{
    if($profile.PersonalSite -eq $Null)
    {
     $profile.CreatePersonalSite()
     Write-Host "Personal site created"
    }
    else
    {
    Write-Warning "$username already has a personal site"
    }
}
看看这个

这看起来像是权限问题。尝试以管理员身份运行它,并使用管理员权限运行程序本身