我们正在考虑在SP 2010中预先configuration每个用户的MySite – 我知道MS不推荐它,但是它是一个Uni安装,我们希望事先设置好学生帐户,而不是让所有的东西在香蕉所有人都在同一天出现,并开始浏览我们提供的服务。
这可以通过某种脚本来完成吗? 我认为Powershell有一些机制来触发创build,而用户不必亲自访问他们的网站?
这应该让你开始 – 你需要将网站创build部分封装在你的用户列表中的一个循环中,并且可能会添加更多的错误检查。
我知道肯定这在2007年工作,但没有在2010年testing。所有相同的东西存在,所以它应该。 最后一件事 – 这是慢 – 在我的SP2007服务器上创build一个用户需要5-10秒。 如果你的神秘农场足够强壮,你可能最好让用户创build自己的个人网站特设。
[Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") $siteurl = "http://your.mysitesurl.com" $site = New-Object Microsoft.SharePoint.SPSite($siteurl) $context = [Microsoft.Office.Server.ServerContext]::GetContext($site) $upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context) # start loop here $user = "domain\username" if ($upm.UserExists($user)) { $profile = $upm.GetUserProfile($user) # there are other exceptions you can catch, check out the UserProfiles class trap [Microsoft.Office.Server.UserProfiles.PersonalSiteExistsException] { Write-Host "personal site already exists for $user" continue } $profile.CreatePersonalSite(); } else { Write-Host: "user $user did not exist" } # end loop here $site.Dispose()