1. Assign permissions to users in user profile service application:
$ Accountname = "contoso \ testuser"
$ Claimtype = "http://schemas.microsoft.com/sharepoint/2009/08/claims/userlogonname"
$ Claimvalue = $ accountname
$ Claim = new-object Microsoft. sharepoint. administration. claims. spclaim ($ claimtype, $ claimvalue, "http://www.w3.org/2001/XMLSchema#string", [Microsoft. sharepoint. administration. claims. sporiginalissuers]: Format ("Windows "))
$ Claim. toencodedstring ()
$ Permission = [microsoft. Sharepoint. Administration. accesscontrol. spiiswebserviceapplicationrights] "fullcontrol"
$ Spaclaccessrule = [type] "Microsoft. Sharepoint. Administration. accesscontrol. spaclaccessrule ''1"
$ Specificspaclaccessrule = $ spaclaccessrule. makegenerictype ([type] "Microsoft. Sharepoint. Administration. accesscontrol. spiiswebserviceapplicationrights ")
$ Ctor = $ specificspaclaccessrule. getconstructor (@ ([type] "Microsoft. sharepoint. administration. claims. spclaim ", [type]" Microsoft. sharepoint. administration. accesscontrol. spiiswebserviceapplicationrights "))
$ Accessrule = $ ctor. Invoke (@ ([microsoft. Sharepoint. Administration. Claims. spclaim] $ claim, $ permission ))
$ Ups = Get-spserviceapplication |? {$ _. Typename-EQ 'user profile service application '}
$ Accesscontrol = $ ups. getaccesscontrol ()
$ Accesscontrol. addaccessrule ($ accessrule)
$ Ups. setaccesscontrol ($ accesscontrol)
$ Ups. Update ()
2. Start all timer services in the SharePoint field:
$ Spfarm = Get-spfarm
$ Spftimerservcicesinstance = $ spfarm. timerservice. Instances
Foreach ($ spftimerserviceinstance in $ spftimerservcicesinstances)
{
Write-host "re-starting the instance" $ spftimerserviceinstance. typename
$ Spftimerserviceinstance. Stop ()
$ Spftimerserviceinstance. Start ()
}
3. Back up solution in the SharePoint farm:
New-item $ folderpath \ $ Foldername-itemtype directory-Force
Set-location $ folderpath \ $ Foldername
(Get-spfarm ). solutions | % {$ solutions = (get-location ). path + "\" + $ _. name; $ _. solutionfile. saveas ($ solutions )}
Powershell configure the SharePoint Environment (continued)