tag:blogger.com,1999:blog-31387537443712175702024-02-07T17:27:28.421-08:00All about SharePointVenkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.comBlogger471125tag:blogger.com,1999:blog-3138753744371217570.post-49238377259358709442022-11-22T07:42:00.008-08:002022-11-22T07:42:59.256-08:00Power Platform Audit Scripts using PowerShell -Licenses<h2 style="text-align: left;">Get Power Platform Licenses using PowerShell</h2><p><span style="color: #2b00fe;">C</span><span style="color: #2b00fe;">lear-Host</span></p><p><span style="color: #2b00fe;">Install-Module -Name Microsoft.PowerApps.Administration.PowerShell</span></p><p><span style="color: #2b00fe;">Add-PowerAppsAccount</span></p><p><span style="color: #2b00fe;">$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition</span></p><p><span style="color: #2b00fe;">$OutputFilePath = "$scriptPath\Licenses.csv"</span></p><p><span style="color: #2b00fe;">$TimeoutInMinutes = 2</span></p><p><span style="color: #2b00fe;">$ApiVersion = "2016-11-01"</span></p><p><span style="color: #2b00fe;">$getLicensesUri = "https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/scopes/admin/exportServicePlans?api-version={apiVersion}"</span></p><p><span style="color: #2b00fe;"> </span><span style="color: #2b00fe;">$getLicensesResponse = InvokeApi -Method POST -Route $getLicensesUri -ApiVersion $ApiVersion -Verbose $false</span></p><p><span style="color: #2b00fe;">if ($getLicensesResponse.StatusCode -eq 202)</span></p><p><span style="color: #2b00fe;">{</span></p><p><span style="color: #2b00fe;"> $getLicensesUri = $getLicensesResponse.Headers['Location']</span></p><p><span style="color: #2b00fe;"> $currentTime = Get-Date -format HH:mm:ss</span></p><p><span style="color: #2b00fe;"> $nextTime = Get-Date -format HH:mm:ss</span></p><p><span style="color: #2b00fe;"> $TimeDiff = New-TimeSpan $currentTime $nextTime</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> #Wait until the operation complete, there is an error, or we hit a timeout</span></p><p><span style="color: #2b00fe;"> while((-not [string]::IsNullOrEmpty($getLicensesUri)) -and ($getLicensesResponse.StatusCode -eq 202) -and ($TimeDiff.TotalMinutes -lt $TimeoutInMinutes))</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> Start-Sleep -s 5</span></p><p><span style="color: #2b00fe;"> $getLicensesResponse = InvokeApiNoParseContent -Route $getLicensesUri -Method GET -ApiVersion $ApiVersion -Verbose: $false</span></p><p><span style="color: #2b00fe;"> $nextTime = Get-Date -format HH:mm:ss</span></p><p><span style="color: #2b00fe;"> $TimeDiff = New-TimeSpan $currentTime $nextTime</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> if ($TimeDiff.TotalMinutes -ge $TimeoutInMinutes)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> Write-Error "Get-AdminPowerAppLicenses timeout."</span></p><p><span style="color: #2b00fe;"> throw</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;">}</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">if ($getLicensesResponse.Content -ne $null)</span></p><p><span style="color: #2b00fe;">{</span></p><p><span style="color: #2b00fe;"> $jobject = ConvertFrom-Json($getLicensesResponse.Content)</span></p><p><span style="color: #2b00fe;"> $csvFileUri = $jobject.sharedAccessSignature</span></p><p><span style="color: #2b00fe;"> Invoke-WebRequest $csvFileUri -OutFile $OutputFilePath</span></p><p><span style="color: #2b00fe;">}</span></p><div><br /></div>Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-42830571557999764302022-11-22T07:40:00.008-08:002022-11-22T07:40:53.812-08:00Power Platform Audit Scripts using PowerShell -All Power Automate (Running Flows)<h2 style="text-align: left;">Get All Ruining Power Automate (Flows) Using PowerShel<span style="color: #2b00fe;">l</span></h2><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">Clear-Host</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">Install-Module -Name Microsoft.PowerApps.Administration.PowerShell</span></p><p><span style="color: #2b00fe;">#Add-PowerAppsAccount</span></p><p><span style="color: #2b00fe;">$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition</span></p><p><span style="color: #2b00fe;">$OutputFilePath = "$scriptPath\FlowRuns.csv"</span></p><p><span style="color: #2b00fe;">try { Remove-Item $OutputFilePath } catch{}</span></p><p><span style="color: #2b00fe;">$flowRunHeaders = "Flow,Name,Run Count,Last Run Date, Last Run Status";</span></p><p><span style="color: #2b00fe;">Add-Content -Path $OutputFilePath -Value $flowRunHeaders</span></p><p><span style="color: #2b00fe;">function GetRuns </span></p><p><span style="color: #2b00fe;">{</span></p><p><span style="color: #2b00fe;"> param</span></p><p><span style="color: #2b00fe;"> (</span></p><p><span style="color: #2b00fe;"> [Parameter(Mandatory = $true)]</span></p><p><span style="color: #2b00fe;"> [string]$FlowName,</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> [Parameter(Mandatory = $true)]</span></p><p><span style="color: #2b00fe;"> [string]$EnvironmentName</span></p><p><span style="color: #2b00fe;"> )</span></p><p><span style="color: #2b00fe;"> process</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> if ($EnvironmentName -ne $null -and $FlowName -ne $null)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $TimeoutInMinutes = 2</span></p><p><span style="color: #2b00fe;"> $ApiVersion = "2016-11-01"</span></p><p><span style="color: #2b00fe;"> $getRunsUri = "https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/scopes/admin/environments/{environmentName}/flows/{flowName}/runs?api-version={apiVersion}" `</span></p><p><span style="color: #2b00fe;"> | ReplaceMacro -Macro "{environmentName}" -Value $environmentName `</span></p><p><span style="color: #2b00fe;"> | ReplaceMacro -Macro "{flowName}" -Value $flowName;</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">#"&`$filter=properties/startTime gt 2020-10-01" `</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> $runsResult = InvokeApi -Method GET -Route $getRunsUri -ApiVersion $ApiVersion #-Verbose $false</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"># Write-Host $runsResult.value.Count</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> Write-Output $runsResult</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;">}</span></p><p><span style="color: #2b00fe;">$flows = Get-AdminFlow</span></p><p><span style="color: #2b00fe;">foreach($flow in $flows)</span></p><p><span style="color: #2b00fe;">{</span></p><p><span style="color: #2b00fe;"> #Get the details around who created the flow</span></p><p><span style="color: #2b00fe;"> $FlowEnvironmentName = $flow.EnvironmentName</span></p><p><span style="color: #2b00fe;"> $Name = $flow.FlowName</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> if (-not [string]::IsNullOrWhiteSpace($FlowEnvironmentName)){</span></p><p><span style="color: #2b00fe;"> $runs = GetRuns -EnvironmentName $FlowEnvironmentName -FlowName $Name</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> Write-Host $flow.DisplayName " - " $runs.value.Count</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> $runProperties = $runs.value | Foreach-Object { $_.properties.startTime = [DateTime]$_.properties.startTime; $_} | Sort-Object $._.properties.startTime | Select-Object -Last 1 properties</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> $lastRun = $runProperties.startTime;</span></p><p><span style="color: #2b00fe;"> $lastStatus = $runProperties.status;</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> Add-Content -Path $OutputFilePath -Value ($flow.FlowName + ',' + ($flow.DisplayName -replace '[,]') + ',' + $runs.value.Count + ',' + $lastRun + ',' + $lastStatus)</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> #foreach ($run in $runs.value) {</span></p><p><span style="color: #2b00fe;"> # Write-Host $run.properties</span></p><p><span style="color: #2b00fe;"> #}</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;">}</span></p><p><br /></p>Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-52290444696245826392022-11-22T07:38:00.005-08:002022-11-22T07:38:34.172-08:00Power Platform Audit Scripts using PowerShell -All Environments<h2 style="text-align: left;">Get All Environments using PowerShell</h2><p> <span style="color: #2b00fe;">Clear-Host</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition</span></p><p><span style="color: #2b00fe;">$environmentsFilePath = "$scriptPath\Environments.xlsx"</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">$excel = New-Object -ComObject excel.application </span></p><p><span style="color: #2b00fe;">$workbook = $excel.Workbooks.Add()</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">$envs = Get-AdminPowerAppEnvironment</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">$wksht= $workbook.Worksheets.Add() </span></p><p><span style="color: #2b00fe;">$wksht.Name = 'Environments'</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,1) = "EnvironmentName"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,2) = "DisplayName"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,3) = "UniqueName"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,4) = "EnvironmentType"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,5) = "CommonDataServiceDatabaseType"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,6) = "IsDefault"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,7) = "Location"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,8) = "AzureRegion"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,9) = "MetadataType"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,10) = "InternalCds"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,11) = "CreatedBy"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,12) = "CreatedTime"</span></p><p><span style="color: #2b00fe;">$wksht.Cells.Item(1,13) = "CreationType"</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">$row=2</span></p><p><span style="color: #2b00fe;">foreach($env in $envs)</span></p><p><span style="color: #2b00fe;">{</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,1) = $env.EnvironmentName</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,2) = $env.DisplayName</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,3) = $env.Internal.properties.linkedEnvironmentMetadata.uniqueName</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,4) = $env.EnvironmentType</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,5) = $env.CommonDataServiceDatabaseType</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,6) = $env.IsDefault</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,7) = $env.Location</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,8) = $env.Internal.properties.azureRegionHint </span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,9) = $env.Internal.properties.linkedEnvironmentMetadata.type</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,10) = $env.InternalCds</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,11) = $env.CreatedBy.displayName</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,12) = $env.CreatedTime</span></p><p><span style="color: #2b00fe;"> $wksht.Cells.Item($row,13) = $env.CreationType</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> $row+=1</span></p><p><span style="color: #2b00fe;">}</span></p><p><span style="color: #2b00fe;">$usedRange = $wksht.UsedRange</span></p><p><span style="color: #2b00fe;">$usedRange.EntireColumn.AutoFit() | Out-Null</span></p><p><span style="color: #2b00fe;">$workbook.Worksheets.Item($workbook.Worksheets.Count).Delete()</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">$excel.visible = $True</span></p><p><span style="color: #2b00fe;">$workbook.SaveAs($environmentsFilePath)</span></p><div><br /></div>Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-12960470279652029502022-11-22T07:36:00.006-08:002022-11-22T07:36:35.725-08:00Power Platform Audit Scripts using PowerShell -All PowerApps <h2 style="text-align: left;">Get All Power Apps using PowerShell </h2><p><span style="color: #2b00fe;">Clear-Host</span></p><p><span style="color: #2b00fe;">Install-Module -Name Microsoft.PowerApps.Administration.PowerShell</span></p><p><span style="color: #2b00fe;">Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber </span></p><p>#Import-Module (Join-Path (Split-Path $script:MyInvocation.MyCommand.Path)<span style="color: #2b00fe;"> "Microsoft.PowerApps.Administration.PowerShell.psm1") -Force</span></p><p><span style="color: #2b00fe;">Add-PowerAppsAccount</span></p><p><span style="color: #2b00fe;">$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition</span></p><p><span style="color: #2b00fe;">Set-Location -Path $scriptPath</span></p><p><span style="color: #2b00fe;">$AppRoleAssignmentsFilePath = ".\AppsDetails.csv"</span></p><p># Add the header to the app roles csv file</p><p><span style="color: #2b00fe;">$appRoleAssignmentsHeaders = "EnvironmentName," `</span></p><p><span style="color: #2b00fe;"> + "AppName," `</span></p><p><span style="color: #2b00fe;"> + "AppDisplayName," `</span></p><p><span style="color: #2b00fe;"> + "SharedUsers," `</span></p><p><span style="color: #2b00fe;"> + "SharedGroups," `</span></p><p><span style="color: #2b00fe;"> + "CreatedTime," `</span></p><p><span style="color: #2b00fe;"> + "LastModifiedTime," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerObjectId," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerDisplayName," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerDisplayEmail," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerUserPrincipalName," `</span></p><p><span style="color: #2b00fe;"> + "AppConnections," `</span></p><p><span style="color: #2b00fe;"> + "RoleType," `</span></p><p><span style="color: #2b00fe;"> + "RolePrincipalType," `</span></p><p><span style="color: #2b00fe;"> + "RolePrincipalObjectId," `</span></p><p><span style="color: #2b00fe;"> + "RolePrincipalDisplayName," `</span></p><p><span style="color: #2b00fe;"> + "RolePrincipalEmail," `</span></p><p><span style="color: #2b00fe;"> + "RoleUserPrincipalName,";</span></p><p><span style="color: #2b00fe;">Add-Content -Path $AppRoleAssignmentsFilePath -Value $appRoleAssignmentsHeaders</span></p><p>#populate the app files</p><p><span style="color: #2b00fe;">$apps = Get-AdminPowerApp</span></p><p><span style="color: #2b00fe;">foreach($app in $apps)</span></p><p><span style="color: #2b00fe;">{</span></p><p><span style="color: #2b00fe;"> </span> #Get the details around who created the app</p><p><span style="color: #2b00fe;"> $AppEnvironmentName = $app.EnvironmentName</span></p><p><span style="color: #2b00fe;"> $Name = $app.AppName</span></p><p><span style="color: #2b00fe;"> $DisplayName = $app.displayName -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $OwnerObjectId = $app.owner.id</span></p><p><span style="color: #2b00fe;"> $OwnerDisplayName = $app.owner.displayName -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $OwnerDisplayEmail = $app.owner.email</span></p><p><span style="color: #2b00fe;"> $CreatedTime = $app.CreatedTime</span></p><p><span style="color: #2b00fe;"> $LastModifiedTime = $app.LastModifiedTime</span></p><p><span style="color: #2b00fe;"> $userOrGroupObject = Get-UsersOrGroupsFromGraph -ObjectId $OwnerObjectId</span></p><p><span style="color: #2b00fe;"> $OwnerUserPrincipalName = $userOrGroupObject.UserPrincipalName</span></p><p><span style="color: #2b00fe;"> $SharedUsers = $app.Internal.properties.sharedUsersCount</span></p><p><span style="color: #2b00fe;"> $SharedGroups = $app.Internal.properties.sharedGroupsCount</span></p><p><span style="color: #2b00fe;"> </span> #Get the list of connections for the app</p><p><span style="color: #2b00fe;"> $connectionList = ""</span></p><p><span style="color: #2b00fe;"> foreach($conRef in $app.Internal.properties.connectionReferences)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> foreach($connection in $conRef)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> foreach ($connId in ($connection | Get-Member -MemberType NoteProperty).Name) </span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $connDetails = $($connection.$connId)</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> $connDisplayName = $connDetails.displayName -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $connIconUri = $connDetails.iconUri</span></p><p><span style="color: #2b00fe;"> $isOnPremiseConnection = $connDetails.isOnPremiseConnection</span></p><p><span style="color: #2b00fe;"> $connId = $connDetails.id</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> $connectionList += $connDisplayName + "; "</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> } </span></p><p><span style="color: #2b00fe;"> } </span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> </span> #Get all of the details for each user the app is shared with</p><p><span style="color: #2b00fe;"> $principalList = ""</span></p><p><span style="color: #2b00fe;"> $appRoles = ($app | Get-AdminPowerAppRoleAssignment)</span></p><p><span style="color: #2b00fe;"> Write-Host $DisplayName ':' $appRoles.Count ' Shares'</span></p><p><span style="color: #2b00fe;"> $appShares = $appRoles.Count</span></p><p><span style="color: #2b00fe;"> foreach($appRole in $appRoles)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $RoleEnvironmentName = $appRole.EnvironmentName</span></p><p><span style="color: #2b00fe;"> $RoleType = $appRole.RoleType</span></p><p><span style="color: #2b00fe;"> $RolePrincipalType = $appRole.PrincipalType</span></p><p><span style="color: #2b00fe;"> $RolePrincipalObjectId = $appRole.PrincipalObjectId</span></p><p><span style="color: #2b00fe;"> $RolePrincipalDisplayName = $appRole.PrincipalDisplayName -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $RolePrincipalEmail = $appRole.PrincipalEmail</span></p><p><span style="color: #2b00fe;"> $CreatedTime = $app.CreatedTime</span></p><p><span style="color: #2b00fe;"> $LastModifiedTime = $app.LastModifiedTime</span></p><p><span style="color: #2b00fe;"> If($appRole.PrincipalType -eq "Tenant")</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $RolePrincipalDisplayName = "Tenant"</span></p><p><span style="color: #2b00fe;"> $RoleUserPrincipalName = ""</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> If($appRole.PrincipalType -eq "User")</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $userOrGroupObject = Get-UsersOrGroupsFromGraph -ObjectId $appRole.PrincipalObjectId </span></p><p><span style="color: #2b00fe;"> $RoleUserPrincipalName = $userOrGroupObject.UserPrincipalName </span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> </span> # Write this permission record </p><p><span style="color: #2b00fe;"> $row = $AppEnvironmentName + "," `</span></p><p><span style="color: #2b00fe;"> + $Name + "," `</span></p><p><span style="color: #2b00fe;"> + $DisplayName + "," `</span></p><p><span style="color: #2b00fe;"> + $SharedUsers + "," `</span></p><p><span style="color: #2b00fe;"> + $SharedGroups + "," `</span></p><p><span style="color: #2b00fe;"> + $CreatedTime + "," `</span></p><p><span style="color: #2b00fe;"> + $LastModifiedTime + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerObjectId + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerDisplayName + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerDisplayEmail + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerUserPrincipalName + "," `</span></p><p><span style="color: #2b00fe;"> + $connectionList + "," `</span></p><p><span style="color: #2b00fe;"> + $RoleType + "," `</span></p><p><span style="color: #2b00fe;"> + $RolePrincipalType + "," `</span></p><p><span style="color: #2b00fe;"> + $RolePrincipalObjectId + "," `</span></p><p><span style="color: #2b00fe;"> + $RolePrincipalDisplayName + "," `</span></p><p><span style="color: #2b00fe;"> + $RolePrincipalEmail + "," `</span></p><p><span style="color: #2b00fe;"> + $RoleUserPrincipalName;</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> Add-Content -Path $AppRoleAssignmentsFilePath -Value $row </span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;">} </span></p><div><br /></div>Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-3684133201729825652022-11-22T07:33:00.007-08:002022-11-22T07:33:56.463-08:00Power Platform Audit Scripts using PowerShell -All PowerApps Summary<p><span style="color: #2b00fe;"> Get all Power Apps by Summary</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;">Clear-Host</span></p><p>#Install-Module -Name Microsoft.PowerApps.Administration.PowerShell</p><p>#Add-PowerAppsAccount</p><p><span style="color: #2b00fe;">$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition</span></p><p><span style="color: #2b00fe;">Set-Location -Path $scriptPath</span></p><p><span style="color: #2b00fe;">$AppRoleAssignmentsFilePath = ".\Apps.csv"</span></p><p><span style="color: #2b00fe;">try { Remove-Item $AppRoleAssignmentsFilePath } catch{}</span></p><p># Add the header to the app roles csv file</p><p><span style="color: #2b00fe;">$appRoleAssignmentsHeaders = "EnvironmentName," `</span></p><p><span style="color: #2b00fe;"> + "AppName," `</span></p><p><span style="color: #2b00fe;"> + "AppDisplayName," `</span></p><p><span style="color: #2b00fe;"> + "Description," `</span></p><p><span style="color: #2b00fe;"> + "AppType," `</span></p><p><span style="color: #2b00fe;"> + "UsesOnPremiseGateway," `</span></p><p><span style="color: #2b00fe;"> + "UsesPremiumApi," `</span></p><p><span style="color: #2b00fe;"> + "UsesCustomApi," `</span></p><p><span style="color: #2b00fe;"> + "SharedUsers," `</span></p><p><span style="color: #2b00fe;"> + "SharedGroups," `</span></p><p><span style="color: #2b00fe;"> + "SharedWithTenant," `</span></p><p><span style="color: #2b00fe;"> + "CreatedTime," `</span></p><p><span style="color: #2b00fe;"> + "LastModifiedTime," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerObjectId," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerDisplayName," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerDisplayEmail," `</span></p><p><span style="color: #2b00fe;"> + "AppOwnerUserPrincipalName," `</span></p><p><span style="color: #2b00fe;"> + "AppConnections";</span></p><p><span style="color: #2b00fe;">Add-Content -Path $AppRoleAssignmentsFilePath -Value $appRoleAssignmentsHeaders</span></p><p>#populate the app files</p><p><span style="color: #2b00fe;">$apps = Get-AdminPowerApp</span></p><p><span style="color: #2b00fe;">foreach($app in $apps)</span></p><p><span style="color: #2b00fe;">{</span></p><p><span style="color: #2b00fe;"> #Get the details around who created the app</span></p><p><span style="color: #2b00fe;"> $AppEnvironmentName = $app.EnvironmentName</span></p><p><span style="color: #2b00fe;"> $Name = $app.AppName</span></p><p><span style="color: #2b00fe;"> $DisplayName = $app.displayName -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $OwnerObjectId = $app.owner.id</span></p><p><span style="color: #2b00fe;"> $OwnerDisplayName = $app.owner.displayName -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $OwnerDisplayEmail = $app.owner.email</span></p><p><span style="color: #2b00fe;"> $CreatedTime = $app.CreatedTime</span></p><p><span style="color: #2b00fe;"> $LastModifiedTime = $app.LastModifiedTime</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> $Description = $app.Internal.properties.description -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $AppType = $app.Internal.appType</span></p><p><span style="color: #2b00fe;"> $UsesOnPremiseGateway = $app.Internal.properties.usesOnPremiseGateway</span></p><p><span style="color: #2b00fe;"> $UsesPremiumApi = $app.Internal.properties.usesPremiumApi</span></p><p><span style="color: #2b00fe;"> $UsesCustomApi = $app.Internal.properties.usesCustomApi</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> Write-Host $DisplayName</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> if (-not [string]::IsNullOrWhiteSpace($OwnerObjectId))</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $userOrGroupObject = Get-UsersOrGroupsFromGraph -ObjectId $OwnerObjectId</span></p><p><span style="color: #2b00fe;"> $OwnerUserPrincipalName = $userOrGroupObject.UserPrincipalName</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> $SharedUsers = $app.Internal.properties.sharedUsersCount</span></p><p><span style="color: #2b00fe;"> $SharedGroups = $app.Internal.properties.sharedGroupsCount</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> </span> #Get the list of connections for the app</p><p><span style="color: #2b00fe;"> $connectionList = ""</span></p><p><span style="color: #2b00fe;"> foreach($conRef in $app.Internal.properties.connectionReferences)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> foreach($connection in $conRef)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> foreach ($connId in ($connection | Get-Member -MemberType NoteProperty).Name) </span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $connDetails = $($connection.$connId)</span></p><p><span style="color: #2b00fe;"><br /></span></p><p><span style="color: #2b00fe;"> $connDisplayName = $connDetails.displayName -replace '[,]'</span></p><p><span style="color: #2b00fe;"> $connIconUri = $connDetails.iconUri</span></p><p><span style="color: #2b00fe;"> $isOnPremiseConnection = $connDetails.isOnPremiseConnection</span></p><p><span style="color: #2b00fe;"> $connId = $connDetails.id</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> $connectionList += $connDisplayName + "; "</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> } </span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> </span><span style="color: #2b00fe;"> $appRoles = ($app | Get-AdminPowerAppRoleAssignment)</span></p><p><span style="color: #2b00fe;"> </span><span style="color: #2b00fe;"> $SharedWithTenant = 'No'</span></p><p><span style="color: #2b00fe;"> foreach($appRole in $appRoles)</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> If($appRole.PrincipalType -eq "Tenant")</span></p><p><span style="color: #2b00fe;"> {</span></p><p><span style="color: #2b00fe;"> $SharedWithTenant = 'Yes'</span></p><p><span style="color: #2b00fe;"> break</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> }</span></p><p><span style="color: #2b00fe;"> $CreatedTime = $app.CreatedTime</span></p><p><span style="color: #2b00fe;"> $LastModifiedTime = $app.LastModifiedTime</span></p><p><span style="color: #2b00fe;"> </span> # Write this permission record </p><p><span style="color: #2b00fe;"> $row = $AppEnvironmentName + "," `</span></p><p><span style="color: #2b00fe;"> + $Name + "," `</span></p><p><span style="color: #2b00fe;"> + $DisplayName + "," `</span></p><p><span style="color: #2b00fe;"> + $Description + "," `</span></p><p><span style="color: #2b00fe;"> + $AppType + "," `</span></p><p><span style="color: #2b00fe;"> + $UsesOnPremiseGateway + "," `</span></p><p><span style="color: #2b00fe;"> + $UsesPremiumApi + "," `</span></p><p><span style="color: #2b00fe;"> + $UsesCustomApi + "," `</span></p><p><span style="color: #2b00fe;"> + $SharedUsers + "," `</span></p><p><span style="color: #2b00fe;"> + $SharedGroups + "," `</span></p><p><span style="color: #2b00fe;"> + $SharedWithTenant + "," `</span></p><p><span style="color: #2b00fe;"> + $CreatedTime + "," `</span></p><p><span style="color: #2b00fe;"> + $LastModifiedTime + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerObjectId + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerDisplayName + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerDisplayEmail + "," `</span></p><p><span style="color: #2b00fe;"> + $OwnerUserPrincipalName + "," `</span></p><p><span style="color: #2b00fe;"> + $connectionList;</span></p><p><span style="color: #2b00fe;"> </span></p><p><span style="color: #2b00fe;"> Add-Content -Path $AppRoleAssignmentsFilePath -Value $row </span></p><p><span style="color: #2b00fe;">} </span></p><div><br /></div>Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-24119794518475340492022-11-22T07:31:00.001-08:002022-11-22T07:31:13.142-08:00Power Platform Audit Scripts using PowerShell -All PowerApps By Owner<h2 style="text-align: left;"> Get All PowerApps By Owner Using PowerShell</h2><div><div><span style="color: #2b00fe;">Clear-Host</span></div><div><span style="color: #2b00fe;"><br /></span></div><div><span style="color: #2b00fe;">$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition</span></div><div><span style="color: #2b00fe;">Set-Location -Path $scriptPath</span></div><div><span style="color: #2b00fe;"><br /></span></div><div>#Add-PowerAppsAccount</div><div><span style="color: #2b00fe;"><br /></span></div><div><span style="color: #2b00fe;">$users = Get-AdminPowerApp | Select –ExpandProperty Owner | Select –ExpandProperty displayname | Group | Sort-Object -Property @{Expression = "Count"; Descending = $True} </span></div><div><span style="color: #2b00fe;"><br /></span></div><div><span style="color: #2b00fe;">$appsByOwnerFilePath = "$scriptPath\AppsByOwner.csv"</span></div><div><span style="color: #2b00fe;"><br /></span></div><div><span style="color: #2b00fe;">Remove-Item $appsByOwnerFilePath</span></div><div><span style="color: #2b00fe;"><br /></span></div><div><span style="color: #2b00fe;">$appsByOwnerHeaders = "User,App Count";</span></div><div><span style="color: #2b00fe;">Add-Content -Path $appsByOwnerFilePath -Value $appsByOwnerHeaders</span></div><div><span style="color: #2b00fe;"><br /></span></div><div><span style="color: #2b00fe;">foreach ($user in $users) {</span></div><div><span style="color: #2b00fe;"> $name = $user.Name -replace ',',';'</span></div><div><span style="color: #2b00fe;"> Add-Content -Path $appsByOwnerFilePath -Value ($name + ',' + $user.Count)</span></div><div><span style="color: #2b00fe;">}</span></div></div><h2 style="text-align: left;"><br /></h2>Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-10464347611648572282020-03-09T09:34:00.002-07:002020-03-09T09:57:26.991-07:00 How to find out Current Usage per user in One-drive using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
Run the below power shell commands , it will give you the storage information and set storage quota.<br />
<br />
<b>Get current usage per user in Onedrive</b><br />
<br />
<span style="color: blue;">Get-SPOSite </span><br />
<span style="color: blue;">-IncludePersonalSite $true</span><br />
<span style="color: blue;">-Limit all </span><br />
<span style="color: blue;">-Filter "url - like '-my-sharepoint.com/personal/'"</span><br />
<span style="color: blue;">| Select url, StorageUsageCurrent</span><br />
<span style="color: blue;">| Sort-Object StorageUsageCurrent -Descending</span><br />
<span style="color: blue;">| Format-Table -wrap -Autosize</span><br />
<span style="color: blue;"><br /></span>
<b>Set Onedrive storage limit to 1TB (1024 GB) using powershell </b><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"></span><br />
<span style="color: blue;">Set-SPOTenant - OneDriveStorageQuira 1048576</span><br />
<span style="color: blue;"><br /></span>
<b>Set Onedrive storage quota for specific user</b><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;">Set-SPOSite</span><br />
<span style="color: blue;">-Identity https://healthtest-my.sharepoint.com/personal/venkat_healthtest_onmicrosoft_com</span><br />
<span style="color: blue;">-StorageQuota 1024</span>
<span style="color: blue;"><br /><b style="color: black;">Reset storage quota for specific user</b></span><br />
<span style="color: blue;"><b style="color: black;"><br /></b></span>
<span style="color: blue;">Set-SPOSite</span><br />
<span style="color: blue;">-Identity https://healthtest-my.sharepoint.com/personal/venkat_healthtest_onmicrosoft_com</span><br />
<span style="color: blue;">-StorageQuotaReset</span><br />
<br />
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-72225604862471668272020-03-05T09:19:00.005-08:002020-03-05T09:19:40.035-08:00How to export SharePoint list data to Excel using Flow(Power automate)<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Daily export the SharePoint list items to excel format, send an email.</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglcVSkbhQ-TFKgSReX3zi_addC8cNaXFxW38WQIWDtvVvRazWA7LrY2N-moQyY5wROz9EgZ54sh_2CQC6JwqJoZYFCkMjOVKkiL5PwPn2UvxuFB0-d9NzT8NVKhhVMn09xuvyue2DP8Wi8/s1600/FlowFinalOutput.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="861" data-original-width="1287" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglcVSkbhQ-TFKgSReX3zi_addC8cNaXFxW38WQIWDtvVvRazWA7LrY2N-moQyY5wROz9EgZ54sh_2CQC6JwqJoZYFCkMjOVKkiL5PwPn2UvxuFB0-d9NzT8NVKhhVMn09xuvyue2DP8Wi8/s320/FlowFinalOutput.JPG" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhplllWZHTJhQwWnuJ2QOM3TOvKicF5CdIHgfZGtAqzaBoVg6MoSiRO2uGcHgR-ZNcpBfDtye_XM3ccG9l5XB_8QBl7UPZaX2ZzsdaPk8zpL8wg-iGhDujFUutmCKyUWM7Pf6bQRAEAtjoV/s1600/Excel.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="266" data-original-width="956" height="89" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhplllWZHTJhQwWnuJ2QOM3TOvKicF5CdIHgfZGtAqzaBoVg6MoSiRO2uGcHgR-ZNcpBfDtye_XM3ccG9l5XB_8QBl7UPZaX2ZzsdaPk8zpL8wg-iGhDujFUutmCKyUWM7Pf6bQRAEAtjoV/s320/Excel.JPG" width="320" /></a></div>
<br />
<br />
<b>Step 1</b>:Create SharePoint List and add items.<br />
<br />
What Is A<b> SharePoint</b> List?<br />
<br />
A SharePoint list is similar to an Excel Table, it’s a container for data.<br />
SharePoint lists allow you to store data in list format with rows and columns.<br />
<br />
From the homepage of your SharePoint site, press the New button then choose List from the options. Give the list a name(CLF Data) and description and press the Create button.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWGIJ3HNWm3szkVuipjExx4iPbXzXD2QPnlaVfBWjCQxnojRRY9bazxkMYDh3ePrRO0hjRCWY4AD5jrtw_bbLiry1m_xcAx-e8Yn8mpn_p9yaZ0EG4soH_BJ2mjIG1dy-jFhgQZctWU-84/s1600/ListCreation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="421" data-original-width="870" height="154" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWGIJ3HNWm3szkVuipjExx4iPbXzXD2QPnlaVfBWjCQxnojRRY9bazxkMYDh3ePrRO0hjRCWY4AD5jrtw_bbLiry1m_xcAx-e8Yn8mpn_p9yaZ0EG4soH_BJ2mjIG1dy-jFhgQZctWU-84/s320/ListCreation.png" width="320" /></a></div>
<b>Step 2</b> : Go to flow <a href="https://flow.microsoft.com/">https://flow.microsoft.com/</a> and use your credentials to create a flow.<br />
<br />
<b>Step 3</b>: Use "<b>Recurrence</b>" action to run flow on specific time for daily/weekly/monthly.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA3ZTtZ32xLlHn88dGJ1nj_UE-584UtbroJejdDlRInSn-gw1XUU7ChVgZnvePJs06UOp224nkr0nOWyj2FwL3nIBPrxq1QoGFldZ9bLSccmsBS40KqoBa6buENJkIOjPHVfRiQ26cwjtK/s1600/Recurrence.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="218" data-original-width="558" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA3ZTtZ32xLlHn88dGJ1nj_UE-584UtbroJejdDlRInSn-gw1XUU7ChVgZnvePJs06UOp224nkr0nOWyj2FwL3nIBPrxq1QoGFldZ9bLSccmsBS40KqoBa6buENJkIOjPHVfRiQ26cwjtK/s320/Recurrence.JPG" width="320" /></a></div>
<b>Step 4 </b>: Create a excel file in your desktop and insert <b>table </b>,add columns then upload to SharePoint Document Library.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAXduDhL9ljL32H03fCQo89F7V2q1yi2EyV1L3wXzsnIlXA8yzKhtCI_1eXTpQb5OylKtkoe1A2-21q8Ok5SzDCOZ_Mw68nBtcE8gX6mHz2KC-iAIYerid0ETEioWfs5R0QUkjxLfdyeFW/s1600/excelinput.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="194" data-original-width="1600" height="38" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAXduDhL9ljL32H03fCQo89F7V2q1yi2EyV1L3wXzsnIlXA8yzKhtCI_1eXTpQb5OylKtkoe1A2-21q8Ok5SzDCOZ_Mw68nBtcE8gX6mHz2KC-iAIYerid0ETEioWfs5R0QUkjxLfdyeFW/s320/excelinput.JPG" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-E3jw0PQsZLuRAgDxYAJH5GesnWO3BeR772XfTIbIjmx1Dz0c26RWgxtzTIcwJqSMG_2GWqXAnhuhgCR24cl8QnK1WJG-7lAHYUFRyr43LIkBDTOzKeK4KZczdJAQ12FtdFHbxRxcANZ_/s1600/Exportexcel.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="265" data-original-width="531" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-E3jw0PQsZLuRAgDxYAJH5GesnWO3BeR772XfTIbIjmx1Dz0c26RWgxtzTIcwJqSMG_2GWqXAnhuhgCR24cl8QnK1WJG-7lAHYUFRyr43LIkBDTOzKeK4KZczdJAQ12FtdFHbxRxcANZ_/s320/Exportexcel.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 5</b> : Add " <b>List rows present in a table</b>" action in flow to identify your table.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhWYqUIkiMzGHghf9Nb3qvOzwxVXQ7372F9DfJS59uIpNXNwTBRhQdh6nu53qS8W4ixDDx0avKVLvIxCOENs27CyNL3ukSW14uXB15CfAtARDuflzAaYJM0nc20HatQKF8nIvqGG8IXemo/s1600/ListRows.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="439" data-original-width="888" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhWYqUIkiMzGHghf9Nb3qvOzwxVXQ7372F9DfJS59uIpNXNwTBRhQdh6nu53qS8W4ixDDx0avKVLvIxCOENs27CyNL3ukSW14uXB15CfAtARDuflzAaYJM0nc20HatQKF8nIvqGG8IXemo/s320/ListRows.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 6</b> : Insert "<b>Apply to each</b>" control to delete existing records.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOEXTyNt8GLPljIWJpnyfMllgKOkYo8RzW-oUXDK1e5OFz-lOPUt4U1Ml6f3np2CLvEG2aQ1PtsRO5ujMvygViannP8lVNj-2RwOwRJJU28uNvuTRNdMpUhKyarmXMqk89e1K7ghpxEtIO/s1600/DeleteRow.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="289" data-original-width="617" height="149" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOEXTyNt8GLPljIWJpnyfMllgKOkYo8RzW-oUXDK1e5OFz-lOPUt4U1Ml6f3np2CLvEG2aQ1PtsRO5ujMvygViannP8lVNj-2RwOwRJJU28uNvuTRNdMpUhKyarmXMqk89e1K7ghpxEtIO/s320/DeleteRow.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 7</b> : Insert "<b>Get items</b>"action to get SharePoint list data.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWWwOi8KpykAaFircZZGTSLlHRZcnZsKIMKnmbf4vUIBcdtstdgTWvPz8OhX2iS8XksxS157tj2YT6iJI73ku7OSjTe_nqoP4WqGeF0EcuDOxfgp7l5LMyI8A10L6Vujj46bAJPAxT2NtY/s1600/ListRows.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="332" data-original-width="576" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWWwOi8KpykAaFircZZGTSLlHRZcnZsKIMKnmbf4vUIBcdtstdgTWvPz8OhX2iS8XksxS157tj2YT6iJI73ku7OSjTe_nqoP4WqGeF0EcuDOxfgp7l5LMyI8A10L6Vujj46bAJPAxT2NtY/s320/ListRows.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 8</b> : Insert "<b>Apply to each</b>" control to get SharePoint list data output and add output to rows in excel file.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNYedLMUGMAjZfdMxJiDQ_THk0MWKQ0_rTpKWcyzd5v7oP0d-mSUWYYdAJAUp06OLYBgps_gWMzOwIVwcVwk1w0Wj-NOHw32l44T7_0C69rXaT-WJD0bKnK7w69FwI5Fyx2wqNehruQCom/s1600/Addrows.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="690" data-original-width="891" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNYedLMUGMAjZfdMxJiDQ_THk0MWKQ0_rTpKWcyzd5v7oP0d-mSUWYYdAJAUp06OLYBgps_gWMzOwIVwcVwk1w0Wj-NOHw32l44T7_0C69rXaT-WJD0bKnK7w69FwI5Fyx2wqNehruQCom/s320/Addrows.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 9</b> : Insert "<b>Get file content using path</b>" action to get newly created excel file(included SharePoint List data).</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgBZKBxNnefgxkbxEun2Y3YKaFtii0rsmlGMbys1k9HST9N14-e16KNQm8q26Z-77UCq95bjrBgmmIelb_ocOGQ7hjuhbcvmcyBG9I8fgZPTLPVspUFMwoag-m2dhlOHnpSwvTckSLORYj/s1600/ContentPath.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="297" data-original-width="634" height="149" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgBZKBxNnefgxkbxEun2Y3YKaFtii0rsmlGMbys1k9HST9N14-e16KNQm8q26Z-77UCq95bjrBgmmIelb_ocOGQ7hjuhbcvmcyBG9I8fgZPTLPVspUFMwoag-m2dhlOHnpSwvTckSLORYj/s320/ContentPath.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 10</b> : Insert "<b>Apply to each</b>" control to select get file path output to send an email.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtCmn4zAUV6VvVfsxgL9TOfRHErfjxUffhvzzDbYY-kk_3mohgsCIR3oxZmOfF76JZcw3kDXbvEX68Zqsp9XvoL1BkrtKR2iUalKYTDnc4DG-_j10ovkcBFcsrT7FLeIsMeVDw9NNXoT1D/s1600/ContentOutput.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="224" data-original-width="584" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtCmn4zAUV6VvVfsxgL9TOfRHErfjxUffhvzzDbYY-kk_3mohgsCIR3oxZmOfF76JZcw3kDXbvEX68Zqsp9XvoL1BkrtKR2iUalKYTDnc4DG-_j10ovkcBFcsrT7FLeIsMeVDw9NNXoT1D/s320/ContentOutput.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 11</b> : Insert "<b>Send an email</b>"to send excel file to others.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiL1sMQKKlj3ZTrOYgZHKNQBDoArwqYJtJ7bUik5NPZw2aqWl1UCkzCUCkFuqpp4-L7mRKIjGXh4pQd1TM5-ML5bD0O5pwV1SzVcx3k-4QdldiHaY3BYr2fSxZ9NzpaeO_HAX2rgR6afMR/s1600/Send+An+email.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="707" data-original-width="634" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiL1sMQKKlj3ZTrOYgZHKNQBDoArwqYJtJ7bUik5NPZw2aqWl1UCkzCUCkFuqpp4-L7mRKIjGXh4pQd1TM5-ML5bD0O5pwV1SzVcx3k-4QdldiHaY3BYr2fSxZ9NzpaeO_HAX2rgR6afMR/s320/Send+An+email.png" width="286" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwMWvfKvUxiGVTZDSNtMov-rJqexga8CNuKnQ8fA2JlIGHhv8RyBRDMdz3CYS1o7OJF6Oxt-x2EIQaZMCCcbB7ty-mTncq0J-IwxkhcesR8lnQ0vS1mjO75LdSWAEhbl1V3PmuCPeZ5lLi/s1600/Get+Currentdate.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="497" data-original-width="369" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwMWvfKvUxiGVTZDSNtMov-rJqexga8CNuKnQ8fA2JlIGHhv8RyBRDMdz3CYS1o7OJF6Oxt-x2EIQaZMCCcbB7ty-mTncq0J-IwxkhcesR8lnQ0vS1mjO75LdSWAEhbl1V3PmuCPeZ5lLi/s320/Get+Currentdate.JPG" width="237" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 12</b> : If you want you can clear the excel file after sending an email to others.</div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 13 </b>:Just add "<b>list rows present in table</b>" action to identify your excel file.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKGeznFZGdfzdLQHBJw0ez2Mcq6rhy32zaHw_JFCSZW0qNEgi8-l4mzK_ZqeF215gfq5zP6K7BXvMTAENZbprQVPbyBuhDSsbIdO0d9Nvg7oiGKPfRnrpdi43vIhfSwZpR7oVC1Njb_Uzr/s1600/Send+An+email.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="381" data-original-width="568" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKGeznFZGdfzdLQHBJw0ez2Mcq6rhy32zaHw_JFCSZW0qNEgi8-l4mzK_ZqeF215gfq5zP6K7BXvMTAENZbprQVPbyBuhDSsbIdO0d9Nvg7oiGKPfRnrpdi43vIhfSwZpR7oVC1Njb_Uzr/s320/Send+An+email.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="color: red;">Note</span></b>:<span style="color: blue;"> If more than 250 rows , use threshold value(Go to settings) in the above action.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTdxHyqmhXwf34pcB7l8o9Bx6-d6DPOxWcziDq7e23vElF4LUuMZuT4T0LEGS1yfCtU-o5ojNBhyxLxO8ziqrTkjMfu9fnlj6UYQiqSqiuD1D5LTDApJEqdj0EeFKWPn5JP4FSKXE3i8kq/s1600/LisstrowsThres.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="554" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTdxHyqmhXwf34pcB7l8o9Bx6-d6DPOxWcziDq7e23vElF4LUuMZuT4T0LEGS1yfCtU-o5ojNBhyxLxO8ziqrTkjMfu9fnlj6UYQiqSqiuD1D5LTDApJEqdj0EeFKWPn5JP4FSKXE3i8kq/s320/LisstrowsThres.JPG" width="238" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 14</b> : Insert "<b>Apply to each</b>" control to get the above step output then insert "<b>delete a row"</b> action to delete rows in excel file.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8giY23Yiz6gabaVa1-BxZbgHe_zFrT03573I2iwFiGQsBxUhiMP70bRCwVXvbqLDc90V28mqn8OeTnrix9YURczyz_HCCpINQnjeBoa_CEe9DYua9Liy48WFj0iqOtYpyQffBvPJL3fio/s1600/Send+An+email.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="496" data-original-width="591" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8giY23Yiz6gabaVa1-BxZbgHe_zFrT03573I2iwFiGQsBxUhiMP70bRCwVXvbqLDc90V28mqn8OeTnrix9YURczyz_HCCpINQnjeBoa_CEe9DYua9Liy48WFj0iqOtYpyQffBvPJL3fio/s320/Send+An+email.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
That's it.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-40743920720335356272019-09-18T12:58:00.003-07:002019-09-18T12:58:43.297-07:00Resize Picture Slideshow Web part in SharePoint 2013 without resizing the original images<div dir="ltr" style="text-align: left;" trbidi="on">
The JavaScript code described below allows to display original images (without re-sizing) in Slideshow Web Part. In order to display original image the technique is to override the ShowPic function. For embedding JavaScript on page, use Content Editor web part (CEWP) on the same page where you have also inserted your SlideShow web part.<br />
<br />
<br />
<span style="color: #d5a6bd;"><script type="text/javascript"></span><br />
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;">function SlideshowObjectInitializer() {</span><br />
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;"> ShowPic = (function(ShowPicOrig) {</span><br />
<span style="color: #d5a6bd;"> return function() {</span><br />
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;"> var ssObj = arguments[0]; </span><span style="color: blue;">//SlideShow object</span><br />
<span style="color: #d5a6bd;"> var curPicIdx=ssObj.index; </span><span style="color: blue;">//current picture index</span><br />
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;"> ShowPicOrig.apply(this, arguments); </span><span style="color: blue;">//call original ShowPic</span><br />
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;"> </span><span style="color: blue;"> //apply some changes to display original picture in SlideShow control</span><br />
<span style="color: #d5a6bd;"> ssObj.image.src = ssObj.linkArray[curPicIdx]; </span><span style="color: blue;">//display original image instead of web image</span><br />
<span style="color: blue;"> //change picture & container size to auto instead of fixed (by default web image size is used)</span><br />
<span style="color: #d5a6bd;"> ssObj.image.setAttribute('height','100%'); </span><br />
<span style="color: #d5a6bd;"> ssObj.image.setAttribute('width','100%'); </span><br />
<span style="color: #d5a6bd;"> var cell = ssObj.cell; </span><br />
<span style="background-color: white;"><span style="font-family: Arial, Helvetica Neue, Helvetica, sans-serif;"><span style="font-size: 13px;"><span style="color: #d5a6bd;"> </span><span style="color: blue;"> //On the page I added this to the images were resizing, to prevent this, add the below highlighted line of code.</span></span></span></span><br />
<span style="color: #d5a6bd;"><span style="white-space: pre;"> </span> <span style="background-color: yellow;"> cell.parentNode.parentNode.parentNode.parentNode.style.width = "100%";</span></span><br />
<span style="color: #d5a6bd;"> cell.style.width = 'auto';</span><br />
<span style="color: #d5a6bd;"> cell.style.height = 'auto';</span><br />
<span style="color: #d5a6bd;"> cell.style.display = '';</span><br />
<span style="color: #d5a6bd;"> var pcell = ssObj.cell.parentNode; </span><br />
<span style="color: #d5a6bd;"> pcell.style.width = 'auto';</span><br />
<span style="color: #d5a6bd;"> pcell.style.height = 'auto';</span><br />
<span style="color: #d5a6bd;"> };</span><br />
<span style="color: #d5a6bd;"> })(ShowPic);</span><br />
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;">} </span><br />
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;"><br /></span>
<span style="color: #d5a6bd;">ExecuteOrDelayUntilScriptLoaded(SlideshowObjectInitializer, 'imglib.js');</span><br />
<span style="color: #d5a6bd;"></script></span></div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-40109045122042192112019-08-02T11:22:00.000-07:002019-08-02T11:22:07.965-07:00To update Created, Created By, Modified, Modified in SharePoint document library/list using Client Object Model -CSOM<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #333333; font-family: "Segoe UI", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; font-size: 14px;">The changes to the "Author" and "Editor" metadata are done under an user account with "site owner" privileges. That is the app pool's custom user account.</span><br />
<span style="background-color: white; color: #333333; font-family: "Segoe UI", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; font-size: 14px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: "Segoe UI", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; font-size: 14px;"><br /></span>
<span style="color: blue; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.min.js"></script></span></span><br />
<span style="color: blue; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><script type="text/javascript"></span></span><br />
<span style="color: #333333; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #333333; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">// When the body is loaded, the onload event handler executes each function whose name is contained in this array.</span></span><br />
<span style="color: magenta; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">_spBodyOnLoadFunctionNames.push("callCSOM");</span></span><br />
<span style="color: #333333; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">function callCSOM()</span></span><br />
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">{</span></span><br />
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> $("#Button1").click(function()</span></span><br />
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> {</span></span><br />
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> // Make sure the SharePoint script file 'sp.js' is loaded before your code runs.</span></span><br />
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> ExecuteOrDelayUntilScriptLoaded(updateUser, "sp.js");</span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"> </span></span><br />
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> }); </span></span><br />
<span style="color: #38761d; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">}</span></span><br />
<span style="color: #333333; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">function updateUser()</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">{</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">var clientContext = new SP.ClientContext.get_current();</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> var web = clientContext.get_web();</span></span><br />
<br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> var currentUser = web.ensureUser('User Name here');</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> clientContext.load(web);</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> clientContext.load(currentUser);</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> clientContext.executeQueryAsync( </span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> function () {</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> // now you have the user id and correct login name, update author</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> var userField = currentUser.get_id() + ";#" + currentUser.get_loginName();</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> updateListItem(userField);</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> //alert(currentUser.get_title());</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> },</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> function (sender, args) {</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> console.log('Error retrieving user properties');</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> }</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> );</span></span><br />
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #990000; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">}</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">function updateListItem(userField) {</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">var siteUrl = 'https://sharepoint2013/sites/PnP';</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> var clientContext = new SP.ClientContext(siteUrl);</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> var oList = clientContext.get_web().get_lists().getByTitle('List/library Name');</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> //Item ID</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> var oListItem = oList.getItemById(4);</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> //oListItem.set_item('TriageLookup', '');</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> oListItem.set_item('Deleted', 'No');</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> oListItem.set_item('Modified', '05-30-2019');</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> oListItem.set_item('Editor', userField);</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> oListItem.update();</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> clientContext.executeQueryAsync( </span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> function (sender, args) {</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> alert('Item updated!');</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> }, </span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> function (sender, args) {</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> alert('Request failed, Updating new list item'); </span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> }</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"> );</span></span><br />
<span style="color: #3d85c6; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;">}</span></span><br />
<span style="color: blue; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 14px;"></script></span></span><br />
<span style="color: #333333; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 14px;"></span></span><br />
<span style="color: #351c75; font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 14px;"><input id="Button1" type="button" value="Run Code"/></span></span><br />
<div>
<br /></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-50371242765487026942018-07-16T16:46:00.001-07:002019-01-04T11:05:54.597-08:00Video Carousel In SharePoint <div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="background-color: #fffffe; font-family: Consolas, "Courier New", monospace; line-height: 19px; text-align: left; white-space: pre;">
<b><span style="color: blue;">Play Multiple Videos Continuously in a SharePoint Page </span></b></h2>
<div style="background-color: #fffffe; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
Please follow below steps to do,<br />
<br /></div>
<div style="background-color: #fffffe; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
Step 1 : Create a "Assets" Media Library in SharePoint.</div>
<div style="background-color: #fffffe; line-height: 19px;">
<span style="font-family: "consolas" , "courier new" , monospace;"><span style="font-size: 14px; white-space: pre;">Step 2 : Download "</span></span><span style="color: blue; font-family: "consolas" , "courier new" , monospace; font-size: 14px; white-space: pre;">video-js.css" , "</span><span style="color: blue; font-family: "consolas" , "courier new" , monospace; font-size: 14px; white-space: pre;">video.js" & "</span><span style="color: blue; font-family: "consolas" , "courier new" , monospace; font-size: 14px; white-space: pre;">jquery-3.3.1.min.js" from <a href="https://drive.google.com/open?id=1iMXZ_vVK6pWec4id7xwjSl35S29uPcud" target="_blank">Google Drive</a>(</span><span style="background-color: transparent; font-size: 14px; white-space: pre;"><span style="color: blue; font-family: "consolas" , "courier new" , monospace;">https://drive.google.com/open?id=1iMXZ_vVK6pWec4id7xwjSl35S29uPcud)</span></span></div>
<div style="background-color: #fffffe; line-height: 19px;">
<span style="background-color: transparent; font-size: 14px; white-space: pre;"><span style="color: blue; font-family: "consolas" , "courier new" , monospace;">Step 3 : Create a HTML file and update your HTML code(VideoCarousel.HTML)</span></span></div>
<div style="background-color: #fffffe; line-height: 19px;">
<span style="background-color: transparent; font-size: 14px; white-space: pre;"><span style="color: blue; font-family: "consolas" , "courier new" , monospace;">Step 4 : Add HTML file into SharePoint Page via Content Editor Webpart.</span></span></div>
<div style="background-color: #fffffe; line-height: 19px;">
<span style="color: grey; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;"><!DOCTYPE</span><span style="color: red; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;"> html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"</span><span style="color: grey; font-family: consolas, "courier new", monospace; font-size: 14px; white-space: pre;">></span><br />
<div style="font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<span style="color: grey;"><!DOCTYPE</span><span style="color: red;"> html</span><span style="color: grey;">></span><br />
<span style="color: #383838;"><</span><span style="color: maroon;">html</span><span style="color: #383838;">></span><br />
<span style="color: #383838;"><</span><span style="color: maroon;">head</span><span style="color: #383838;">></span><br />
<span style="color: #383838;"><</span><span style="color: maroon;">link</span> <span style="color: red;">href</span><span style="color: #383838;">=</span><span style="color: blue;">"https://PravahamInfo.sharepoint.com/sites/Home/Style Library/VideoCarousel/video-js.css"</span> <span style="color: red;">rel</span><span style="color: #383838;">=</span><span style="color: blue;">"stylesheet"</span><span style="color: #383838;">></span> <br />
<span style="color: green;"><!-- If you'd like to support IE8 (for Video.js versions prior to v7) --></span><br />
<span style="color: #383838;"><</span><span style="color: maroon;">script</span> <span style="color: red;">src</span><span style="color: #383838;">=</span><span style="color: blue;">"https://PravahamInfo.sharepoint.com/sites/Home/Style Library/VideoCarousel/video.js"</span><span style="color: #383838;">></</span><span style="color: maroon;">script</span><span style="color: #383838;">></span><br />
<span style="color: #383838;"><</span><span style="color: maroon;">script</span> <span style="color: red;">src</span><span style="color: #383838;">=</span><span style="color: blue;">"https://PravahamInfo.sharepoint.com/sites/Home/Style Library/VideoCarousel/jquery-3.3.1.min.js"</span><span style="color: #383838;">></</span><span style="color: maroon;">script</span><span style="color: #383838;">></span><br />
<span style="color: #383838;"><</span><span style="color: maroon;">style</span><span style="color: #383838;">></span><br />
<span style="color: maroon;">.video-holder</span> <span style="color: maroon;">.vjs-big-play-button</span> <br />
{<br />
<span style="color: red;">left:</span> <span style="color: #09885a;">50%</span>;<br />
<div>
<span style="color: red;">width:</span> <span style="color: #09885a;">100px</span>;</div>
<div>
<span style="color: red;">margin-left:</span> <span style="color: #09885a;">-50px</span>;</div>
<div>
<span style="color: red;">height:</span> <span style="color: #09885a;">80px</span>;</div>
<div>
<span style="color: red;">top:</span> <span style="color: #09885a;">50%</span>;</div>
<div>
<span style="color: red;">margin-top:</span> <span style="color: #09885a;">-40px;</span></div>
<div>
} </div>
<div>
<span style="color: green;">/* CUSTOM BUTTONS */</span></div>
<div>
[<span style="color: #0451a5;">class</span>^="<span style="color: #0451a5;">icon-</span>"]<span style="color: maroon;">:before</span>, [<span style="color: #0451a5;">class</span>*=" <span style="color: #0451a5;">icon-</span>"]<span style="color: maroon;">:before</span> </div>
<div>
{</div>
<div>
<span style="color: red;">font-family:</span> <span style="color: #0451a5;">VideoJS</span>;</div>
<div>
<span style="color: red;">font-weight:</span> <span style="color: #0451a5;">normal</span>;</div>
<div>
<span style="color: red;">font-style:</span> <span style="color: #0451a5;">normal</span>;</div>
<div>
<span style="color: red;">display:</span> <span style="color: #0451a5;">inline-block</span>;</div>
<div>
<span style="color: red;">text-decoration:</span> <span style="color: #0451a5;">inherit</span>;</div>
<div>
}</div>
<div>
<span style="color: maroon;">.icon-angle-left:before</span> </div>
<div>
{</div>
<div>
<span style="color: red;">content:</span> <span style="color: #a31515;">"\f120"</span>;</div>
<div>
<span style="color: red;">font-size:</span> <span style="color: #09885a;">2em</span>;</div>
<div>
<span style="color: red;">margin-top:</span> <span style="color: #09885a;">2px</span>;</div>
<div>
}</div>
<div>
<span style="color: maroon;">.icon-angle-right:before</span> </div>
<div>
{</div>
<div>
<span style="color: red;">content:</span> <span style="color: #a31515;">"\f11f"</span>;</div>
<div>
<span style="color: red;">font-size:</span> <span style="color: #09885a;">2em</span>;</div>
<div>
<span style="color: red;">margin-top:</span> <span style="color: #09885a;">2px</span>;</div>
<div>
}</div>
<div>
<span style="color: maroon;">.video-js</span> <span style="color: maroon;">.icon-angle-right</span>, <span style="color: maroon;">.video-js</span> <span style="color: maroon;">.icon-angle-left</span> </div>
<div>
{</div>
<div>
<span style="color: red;">cursor:</span> <span style="color: #0451a5;">pointer</span>;</div>
<div>
<span style="color: red;">-webkit-box-flex:</span> <span style="color: #0451a5;">none</span>;</div>
<div>
<span style="color: red;">-moz-box-flex:</span> <span style="color: #0451a5;">none</span>;</div>
<div>
<span style="color: red;">-webkit-flex:</span> <span style="color: #0451a5;">none</span>;</div>
<div>
<span style="color: red;">-ms-flex:</span> <span style="color: #0451a5;">none</span>;</div>
<div>
<span style="color: red;">flex:</span> <span style="color: #0451a5;">none</span>;</div>
<div>
}</div>
<span style="color: #383838;"></</span><span style="color: maroon;">style</span><span style="color: #383838;">></span> <br />
<div>
<span style="color: #383838;"><</span><span style="color: maroon;">meta</span> <span style="color: red;">charset</span><span style="color: #383838;">=</span><span style="color: blue;">"utf-8"</span> <span style="color: #383838;">/></span></div>
<div>
<span style="color: #383838;"><</span><span style="color: maroon;">title</span><span style="color: #383838;">></</span><span style="color: maroon;">title</span><span style="color: #383838;">></span></div>
<div>
<span style="color: #383838;"></</span><span style="color: maroon;">head</span><span style="color: #383838;">></span></div>
<div>
<span style="color: #383838;"><</span><span style="color: maroon;">body</span><span style="color: #383838;">></span></div>
<div>
<span style="color: #383838;"><</span><span style="color: maroon;">h2</span><span style="color: #383838;">></span>Video Player<span style="color: #383838;"></</span><span style="color: maroon;">h2</span><span style="color: #383838;">></span></div>
<div>
<span style="color: #383838;"><</span><span style="color: maroon;">video</span> <span style="color: red;">id</span><span style="color: #383838;">=</span><span style="color: blue;">"myplayer"</span> <span style="color: red;">class</span><span style="color: #383838;">=</span><span style="color: blue;">"video-js"</span> <span style="color: red;">controls</span> <span style="color: red;">preload</span><span style="color: #383838;">=</span><span style="color: blue;">"auto"</span> <span style="color: red;">width</span><span style="color: #383838;">=</span><span style="color: blue;">"1200"</span> <span style="color: red;">height</span><span style="color: #383838;">=</span><span style="color: blue;">"700"</span> <span style="color: red;">data-setup</span><span style="color: #383838;">=</span><span style="color: blue;">"{}"</span> <span style="color: red;">muted</span><span style="color: #383838;">=</span><span style="color: blue;">"muted"</span><span style="color: #383838;">></span></div>
<span style="color: #383838;"><</span><span style="color: maroon;">p</span> <span style="color: red;">class</span><span style="color: #383838;">=</span><span style="color: blue;">"vjs-no-js"</span><span style="color: #383838;">></span><br />
<div>
To view this video please enable JavaScript, and consider upgrading to a web browser that</div>
<span style="color: #383838;"><</span><span style="color: maroon;">a</span> <span style="color: red;">href</span><span style="color: #383838;">=</span><span style="color: blue;">"http://videojs.com/html5-video-support/"</span> <span style="color: red;">target</span><span style="color: #383838;">=</span><span style="color: blue;">"_blank"</span><span style="color: #383838;">></span>supports HTML5 video<span style="color: #383838;"></</span><span style="color: maroon;">a</span><span style="color: #383838;">></span><br />
<span style="color: #383838;"></</span><span style="color: maroon;">p</span><span style="color: #383838;">></span><br />
<div>
<span style="color: #383838;"></</span><span style="color: maroon;">video</span><span style="color: #383838;">></span></div>
<div>
<span style="color: #383838;"></</span><span style="color: maroon;">body</span><span style="color: #383838;">></span></div>
<div>
<span style="color: #383838;"></</span><span style="color: maroon;">html</span><span style="color: #383838;">></span></div>
<div>
<span style="color: #383838;"><</span><span style="color: maroon;">script</span> <span style="color: red;">type</span><span style="color: #383838;">=</span><span style="color: blue;">"text/javascript"</span><span style="color: #383838;">></span></div>
<div>
<span style="color: blue;">var</span> videoList = []; </div>
<div>
<span style="color: blue;">var</span> index = -<span style="color: #09885a;">1</span>; </div>
<div>
$(document).ready</div>
<div>
(</div>
<div>
<span style="color: blue;">function</span> () </div>
<div>
{</div>
<div>
<span style="color: green;">//videoList.push("https://PravahamInfo.sharepoint.com/sites/Home/Assets/Video Short/Video Short.mp4"); </span></div>
<span style="color: green;">//videoList.push("https://PravahamInfo.sharepoint.com/sites/Home/Assets/Youtube 1/Youtube 1.mp4");</span><br />
<span style="color: blue;">var</span> url = _spPageContextInfo.webAbsoluteUrl + <span style="color: #a31515;">"/_api/web/GetFolderByServerRelativeUrl('Assets')?$expand=Folders,Files"</span>;<br />
<span style="color: blue;">var</span> siteUrl = _spPageContextInfo.siteAbsoluteUrl;<br />
<span style="color: green;">/// set request data </span><br />
<span style="color: blue;">var</span> queryText =<span style="color: #a31515;">"<Where><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq></Where>"</span>;<br />
<span style="color: blue;">var</span> folderUrl =<span style="color: #a31515;">""</span>;<br />
<span style="color: blue;">var</span> viewXml = <span style="color: #a31515;">'<View Scope="RecursiveAll" ><Query>'</span> + queryText + <span style="color: #a31515;">'</Query></View>'</span>;<br />
<span style="color: blue;">var</span> queryPayload = { <br />
<div>
<span style="color: #a31515;">'query'</span> : {</div>
<span style="color: #a31515;">'__metadata'</span>: { <span style="color: #a31515;">'type'</span>: <span style="color: #a31515;">'SP.CamlQuery'</span> }, <br />
<span style="color: #a31515;">'ViewXml'</span> : viewXml, <br />
}<br />
<div>
};</div>
<span style="color: green;">/// make an ajax call</span><br />
<div>
listName =<span style="color: #a31515;">"Assets"</span></div>
$.ajax({<br />
url: _spPageContextInfo.webAbsoluteUrl +<span style="color: #a31515;">"/_api/web/lists/GetByTitle('"</span>+ listName +<span style="color: #a31515;">"')/GetItems?$select=*,Properties,FieldValuesAsHtml,ServerRelativeUrl&$expand=File,Properties,FieldValuesAsHtml"</span>,<br />
method: <span style="color: #a31515;">"POST"</span>,<br />
data: JSON.stringify(queryPayload),<br />
<span style="color: blue;">async</span>:<span style="color: blue;">false</span>,<br />
headers: {<br />
<span style="color: #a31515;">"X-RequestDigest"</span>: $(<span style="color: #a31515;">"#__REQUESTDIGEST"</span>).val(),<br />
<span style="color: #a31515;">'content-type'</span>: <span style="color: #a31515;">'application/json;odata=verbose'</span>,<br />
<span style="color: #a31515;">'accept'</span>: <span style="color: #a31515;">'application/json;odata=verbose'</span><br />
},<br />
success: <span style="color: blue;">function</span> (response) {<br />
<span style="color: green;">///do your code</span><br />
<span style="color: blue;">var</span> results = response.d.results;<br />
$.each(results,<span style="color: blue;">function</span>(i,e){<br />
<span style="color: blue;">var</span> fileurl = e.File.ServerRelativeUrl;<br />
videoList.push(fileurl); <br />
});<br />
},<br />
error: <span style="color: blue;">function</span> (data) {<br />
<span style="color: green;">///do your code</span><br />
}<br />
}); <br />
<span style="color: blue;">var</span> Button = videojs.getComponent(<span style="color: #a31515;">'Button'</span>);<br />
<span style="color: green;">/* ADD PREVIOUS */</span><br />
<span style="color: blue;">var</span> PrevButton = videojs.extend(Button, {<br />
<span style="color: blue;">constructor</span>: <span style="color: blue;">function</span>() {<br />
Button.apply(<span style="color: blue;">this</span>, arguments);<br />
<span style="color: blue;">this</span>.addClass(<span style="color: #a31515;">'icon-angle-left'</span>);<br />
<span style="color: blue;">this</span>.controlText(<span style="color: #a31515;">"Previous"</span>);<br />
},<br />
handleClick: <span style="color: blue;">function</span>() {<br />
PlayPrevious()<br />
}<br />
});<br />
<span style="color: green;">/* ADD NEXT */</span><br />
<span style="color: blue;">var</span> NextButton = videojs.extend(Button, {<br />
<span style="color: blue;">constructor</span>: <span style="color: blue;">function</span>() {<br />
Button.apply(<span style="color: blue;">this</span>, arguments);<br />
<span style="color: blue;">this</span>.addClass(<span style="color: #a31515;">'icon-angle-right'</span>);<br />
<span style="color: blue;">this</span>.controlText(<span style="color: #a31515;">"Next"</span>);<br />
},<br />
handleClick: <span style="color: blue;">function</span>() {<br />
PlayNext();<br />
}<br />
});<br />
<span style="color: green;">// Register the new component</span><br />
videojs.registerComponent(<span style="color: #a31515;">'NextButton'</span>, NextButton);<br />
videojs.registerComponent(<span style="color: #a31515;">'PrevButton'</span>, PrevButton);<br />
<span style="color: blue;">var</span> player = videojs(<span style="color: #a31515;">'myplayer'</span>);<br />
player.getChild(<span style="color: #a31515;">'controlBar'</span>).addChild(<span style="color: #a31515;">'PrevButton'</span>, {}, <span style="color: #09885a;">0</span>);<br />
player.getChild(<span style="color: #a31515;">'controlBar'</span>).addChild(<span style="color: #a31515;">'NextButton'</span>, {});<br />
player.on<br />
(<br />
<span style="color: #a31515;">'ended'</span>, <br />
<span style="color: blue;">function</span>() <br />
{<br />
<div>
PlayNext();</div>
}<br />
); <br />
PlayNext();<br />
}<br />
);<br />
<span style="color: blue;">function</span> PlayNext()<br />
<div>
{</div>
<div>
index = index+<span style="color: #09885a;">1</span>;</div>
<div>
<span style="color: blue;">if</span>(index >= videoList.length)</div>
<div>
index = <span style="color: #09885a;">0</span>;</div>
<div>
<span style="color: blue;">var</span> player = videojs(<span style="color: #a31515;">'myplayer'</span>);</div>
<div>
player.src(videoList[index]);</div>
<div>
player.ready(<span style="color: blue;">function</span>() {</div>
<div>
player.play();</div>
<div>
}); </div>
<div>
} </div>
<div>
<span style="color: blue;">function</span> PlayPrevious()</div>
<div>
{</div>
index = index-<span style="color: #09885a;">1</span>;<br />
<div>
<span style="color: blue;">if</span>(index < <span style="color: #09885a;">0</span>)</div>
<div>
index = videoList.length - <span style="color: #09885a;">1</span>; </div>
<div>
<span style="color: blue;">var</span> player = videojs(<span style="color: #a31515;">'myplayer'</span>);</div>
<div>
player.src(videoList[index]);</div>
<div>
player.ready(<span style="color: blue;">function</span>() {</div>
<div>
player.play();</div>
<div>
}); </div>
<div>
} </div>
<span style="color: #383838;"></</span><span style="color: maroon;">script</span><span style="color: #383838;">></span></div>
</div>
<div style="background-color: #fffffe; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;">
<div style="line-height: 19px;">
<div>
<span style="color: #383838;">Output :</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrW_mjf9g3D7-tZ89O-lutZMlsMtq0S-IGb1Dm4QtoAMDwvV2Jz7xnEWoG0HNKhkRqdPijCqC-ZamQWuBEGgdCqwDQTCRjSRZUgdi9iQ_qpKWwxy9MRFH23dk35jnTqLlMn_XsgT9UfFoZ/s1600/SharePoint+Video+Carousel.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="399" data-original-width="616" height="412" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrW_mjf9g3D7-tZ89O-lutZMlsMtq0S-IGb1Dm4QtoAMDwvV2Jz7xnEWoG0HNKhkRqdPijCqC-ZamQWuBEGgdCqwDQTCRjSRZUgdi9iQ_qpKWwxy9MRFH23dk35jnTqLlMn_XsgT9UfFoZ/s640/SharePoint+Video+Carousel.PNG" width="640" /></a></div>
<div>
<span style="color: #383838;"><br /></span></div>
</div>
</div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com1tag:blogger.com,1999:blog-3138753744371217570.post-4168111628582195252018-05-09T13:17:00.004-07:002018-05-09T13:17:38.498-07:00Copy Outlook data to SharePoint online List using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="color: blue;">I want to copy an outlook email data into a SharePoint online list. To achieve this, we can use CSOM /Power shell.</span></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0gZKGzpe0pBKRIuNEIjY_pzF0DN1r8Ap24Xxpzjz5Z8V76CDOnrgZ-JrQ4rgsdB9DeZzMWTKzEcen9E92DtkS4ONtwERtaJkLie-BF7EfBt2dTWZjQbtSn1QkXj2NUzMh5DccyQ4tFRzf/s1600/OutlookSharePoint.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="505" data-original-width="706" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0gZKGzpe0pBKRIuNEIjY_pzF0DN1r8Ap24Xxpzjz5Z8V76CDOnrgZ-JrQ4rgsdB9DeZzMWTKzEcen9E92DtkS4ONtwERtaJkLie-BF7EfBt2dTWZjQbtSn1QkXj2NUzMh5DccyQ4tFRzf/s400/OutlookSharePoint.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
Here I am showing to copy outlook data to SharePoint List using Power shell.<br />
<br />
<b>Step 1</b> : Create a SharePoint List and columns(Question-Multi line text , CretaedBy - People Picker).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-gHth4PJhr1m9RPcrKH5L2PqmLLyL6utMYUlzO-TNMx0uW1mhQDJuRgnd5J7SgZF78aw_Fggs8kWa6Lbr0CbU47Y0YxzVuBr-V4wBpb9LIwNDaupwxw6YAPVf0um8Uqt1-oJFhHhu5JuB/s1600/SharePointOnline.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="260" data-original-width="716" height="145" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-gHth4PJhr1m9RPcrKH5L2PqmLLyL6utMYUlzO-TNMx0uW1mhQDJuRgnd5J7SgZF78aw_Fggs8kWa6Lbr0CbU47Y0YxzVuBr-V4wBpb9LIwNDaupwxw6YAPVf0um8Uqt1-oJFhHhu5JuB/s400/SharePointOnline.jpg" width="400" /></a></div>
<b>Step 2 : </b>Download and install the below tools.<br />
1.SharePoint Online Management shell - <b><span style="color: blue;">https://www.microsoft.com/en-in/download/details.aspx?id=42038</span></b><br />
2. Exchange Web service- EWS API is found at: <b><span style="color: blue;">http://www.microsoft.com/en-us/download/details.aspx?id=28952</span></b><br />
<b><span style="color: blue;"><br /></span></b>
<b>Step 3 : Open your Windows Powershell ISE and run the follwing script.</b><br />
<b><span style="color: #38761d;"><br /></span></b>
<span style="color: #38761d;">#---Outlook mail box name, Username, password and domain ---#</span><br />
<span style="color: #38761d;"><br /></span>
$MailboxName = "AllHandsQuestions@ftech.com"<br />
$LoginId="venkat.m";<br />
$Password='P@ssw0rd';<br />
$Domain='FTech';<br />
<br />
<span style="color: #274e13;">#---Log file location ---#</span><br />
<br />
$downloadDirectory = "C:\OutlookLogs_Test\"<br />
$currentDate = Get-Date -UFormat "%Y%m%d"<br />
$Logfile = "Archiving_"+$currentDate+".txt"<br />
$LogFullPath = "C:\OutlookLogs_Test\"<br />
$LogFilePath = $LogFullPath+ $Logfile<br />
$emailFrom = "AllHandsQuestions@ftech.com"<br />
$emailTo = "AllHandsQuestions@ftech.com"<br />
$UserName="venkat.m@ftech.com"<br />
$SecurePassword="P@ssw0rd"<br />
<br />
<span style="color: #274e13;">#--SharePoint Site Collection URL ---#</span><br />
<br />
$SPOSiteUrl ="https://ftech.sharepoint.com/sites/Test"<br />
<br />
<span style="color: #38761d;">#--SharePoint List Name --#</span><br />
<br />
$ListTitle= "All Hands Questions"<br />
<br />
<br />
<span style="color: #274e13;">#--Loading SharePoint APIS</span><br />
#Import-Module "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.PowerShell.dll"<br />
Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"<br />
Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"<br />
$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force<br />
$Credentials = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword<br />
<br />
if(![System.IO.File]::Exists($LogFilePath))<br />
{<br />
New-Item -Path $LogFullPath -Name $Logfile -ItemType File<br />
}<br />
<br />
function Write-Log {<br />
[CmdletBinding()]<br />
param(<br />
[Parameter()]<br />
[ValidateNotNullOrEmpty()]<br />
[string]$Message<br />
<br />
)<br />
[string]$logMessage = $(Get-Date -Format "d") + " " + $(Get-Date -Format "T") +" "+ $Message<br />
Add-Content -Path $LogFilePath -Value $logMessage <br />
} <br />
<br />
<span style="color: #274e13;"> Write-Log -Message "***** ARCHIVING POWERSHELL SCRIPT STARTED *****"</span><br />
<br />
<span style="color: #274e13;">#################PRE REQUISISTE to install ###############################</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">#Load the EWS API and connect to the CAS/EWS</span><br />
<span style="color: #274e13;"># EWS API is found at: http://www.microsoft.com/en-us/download/details.aspx?id=28952</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">################################################</span><br />
<span style="color: #274e13;"><br /></span>
<span style="color: #274e13;">################################################</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">#Accept any certificates presented by the CAS</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">################################################</span><br />
<span style="color: #274e13;"><br /></span>
<span style="color: #274e13;">## Create a compilation environment</span><br />
$Provider=New-Object Microsoft.CSharp.CSharpCodeProvider<br />
$Compiler=$Provider.CreateCompiler()<br />
$Params=New-Object System.CodeDom.Compiler.CompilerParameters<br />
$Params.GenerateExecutable=$False<br />
$Params.GenerateInMemory=$True<br />
$Params.IncludeDebugInformation=$False<br />
$Params.ReferencedAssemblies.Add("System.DLL") | Out-Null<br />
<br />
$TASource=@'<br />
namespace Local.ToolkitExtensions.Net.CertificatePolicy{<br />
public class TrustAll : System.Net.ICertificatePolicy {<br />
public TrustAll() {<br />
}<br />
public bool CheckValidationResult(System.Net.ServicePoint sp,<br />
System.Security.Cryptography.X509Certificates.X509Certificate cert,<br />
System.Net.WebRequest req, int problem) {<br />
return true;<br />
}<br />
}<br />
}<br />
'@<br />
$TAResults=$Provider.CompileAssemblyFromSource($Params,$TASource)<br />
$TAAssembly=$TAResults.CompiledAssembly<br />
<br />
<span style="color: #274e13;">## We now create an instance of the TrustAll and attach it to the ServicePointManager</span><br />
$TrustAll=$TAAssembly.CreateInstance("Local.ToolkitExtensions.Net.CertificatePolicy.TrustAll")<br />
[System.Net.ServicePointManager]::CertificatePolicy=$TrustAll<br />
<br />
<span style="color: #274e13;">################################################</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">#Load the EWS API and connect to the CAS/EWS</span><br />
<span style="color: #274e13;"># EWS API is found at: http://www.microsoft.com/en-us/download/details.aspx?id=28952</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">################################################</span><br />
<span style="color: #274e13;"><br /></span>
<span style="color: #274e13;">## Load Managed API dll</span><br />
Add-Type -Path "C:\Program Files\Microsoft\Exchange\Web Services\1.2\Microsoft.Exchange.WebServices.dll"<br />
$ModuleDllPath="C:\Program Files\Microsoft\Exchange\Web Services\1.2\Microsoft.Exchange.WebServices.dll"<br />
Import-Module -Name:$ModuleDllPath -ErrorAction:Stop<br />
<br />
<span style="color: #274e13;">## Set Exchange Version (Exchange2010, Exchange2010_SP1 or Exchange2010_SP2)</span><br />
<br />
$ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP2<br />
<span style="color: #274e13;"><br /></span>
<span style="color: #274e13;">## Create Exchange Service Object</span><br />
$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService($ExchangeVersion)<br />
<br />
<span style="color: #274e13;">## Set Credentials to use two options are availible Option1 to use explict credentials or Option 2 use the Default (logged On) credentials</span><br />
<span style="color: #274e13;">#Credentials Option 1 using UPN for the windows Account</span><br />
$creds = New-Object System.Net.NetworkCredential($LoginId,$Password,$Domain)<br />
$service.Credentials = $creds <br />
<br />
<span style="color: #274e13;">#Credentials Option 2</span><br />
$service.UseDefaultCredentials = $true<br />
<br />
<span style="color: #274e13;">## Set the URL of the CAS (Client Access Server) to use two options are availbe to use Autodiscover to find the CAS URL or Hardcode the CAS to use</span><br />
<span style="color: #274e13;"><br /></span>
<span style="color: #274e13;">#CAS URL Option 1 Autodiscover</span><br />
$service.AutodiscoverUrl($MailboxName,{$true})<br />
"Using CAS Server : " + $Service.url<br />
<br />
<span style="color: #274e13;">#CAS URL Option 2 Hardcoded </span><br />
$uri=[system.URI] $Service.url<br />
$service.Url = $uri <br />
Write-Log -Message ("GET Exchange Web service URL "+ $service.Url)<br />
<br />
<br />
<span style="color: #274e13;">#Bind to the Inbox folder</span><br />
$Sfha = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo([Microsoft.Exchange.WebServices.Data.EmailMessageSchema]::HasAttachments, $false)<br />
$folderid= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$MailboxName) <br />
$Inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid) <br />
<br />
#Get the ID of the folder to move to <br />
$fvFolderView = New-Object Microsoft.Exchange.WebServices.Data.FolderView(100) <br />
$fvFolderView.Traversal = [Microsoft.Exchange.WebServices.Data.FolderTraversal]::Shallow;<br />
<br />
<br />
<br />
Write-Log -Message "GET PROCESSED FOLDER"<br />
<br />
<span style="color: #274e13;">####################################################################################################</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">#This section finds attachments and copies the attachment to the download directory</span><br />
<span style="color: #274e13;">#</span><br />
<span style="color: #274e13;">####################################################################################################</span><br />
<br />
<br />
$ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(10)<br />
<br />
$psPropset = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.ItemSchema]::MimeContent)<br />
$psPropsetSubject = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.ItemSchema]::Subject)<br />
$psPropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)<br />
$psPropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)<br />
$psPropertySet.RequestedBodyType = [Microsoft.Exchange.WebServices.Data.BodyType]::Text;<br />
<br />
<br />
$errorMessage =''<br />
$attachmentCount = 0;<br />
$findItemsResults = $Inbox.FindItems($ivItemView)<br />
$service.LoadPropertiesForItems($findItemsResults,$psPropertySet)<br />
<br />
<span style="color: #274e13;">#Connection Sharepoint online</span><br />
<span style="color: blue;">$creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName,$SecurePassword);</span><br />
<span style="color: blue;">$Context= New-Object Microsoft.SharePoint.Client.ClientContext($SPOSiteUrl); </span><br />
<span style="color: blue;">$Context.Credentials=$creds;</span><br />
<span style="color: blue;">$testWeb = $Context.Web;</span><br />
<span style="color: blue;">$Context.Load($testWeb);</span><br />
<span style="color: blue;">$Context.Load($testWeb.Lists);</span><br />
<span style="color: blue;">$Context.ExecuteQuery();</span><br />
<span style="color: blue;">$tuitionFeed=$testWeb.Lists.GetByTitle($ListTitle)</span><br />
<span style="color: blue;">$Context.Load($tuitionFeed)</span><br />
<span style="color: blue;">$Context.ExecuteQuery()</span><br />
<span style="color: blue;">Write-Host "Credentials verified successfully!!"</span><br />
<br />
foreach($miMailItems in $findItemsResults.Items){<br />
try{<br />
<br />
<span style="white-space: pre;"> </span><br />
$subject = $miMailItems.Subject.ToString()<br />
$body = $miMailItems.Body.Text<br />
$sender = $miMailItems.Sender.Address<br />
$from = $miMailItems.From.Name<br />
<br />
Write-Log -Message ("Downloading E-Mail: " + $subject) <br />
$lici =New-Object Microsoft.SharePoint.Client.ListItemCreationInformation<br />
$listItem = $tuitionFeed.AddItem($lici)<br />
<span style="color: blue;"> $listItem["Question"]=$body </span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"> $listItem["CreatedBy"] = $testWeb.EnsureUser($from)</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"> $listItem.Update()</span><br />
<span style="color: blue;"> </span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"> $Context.ExecuteQuery()</span><br />
# $miMailItems.IsRead=$true<br />
# $miMailItems.Update(Microsoft.Exchange.WebServices.Data.<br />
<br />
}<br />
catch [System.Net.WebException],[System.Exception]<br />
{<br />
$ErrorMessage = $_.Exception.Message<br />
Write-Log -Message $_.Exception.Message<br />
<span style="white-space: pre;"> </span><br />
<span style="white-space: pre;"> </span>Write-Log -Message "***** ERROR OCCURED *****"<br />
$failedCount++;<br />
$ErrorMessage = $_.Exception.Message<br />
Write-Log -Message $_.Exception.Message <br />
Write-Log -Message "***** ERROR CLOSED *****"<br />
$errorMessage +=$_.Exception.Message<br />
}<br />
<br />
<br />
}<br />
$comments=''<br />
try<br />
{ <br />
<span style="white-space: pre;"> </span>$message ='';<br />
if($errorMessage -eq '')<br />
{<br />
$message="Job result: Succeeded"<br />
}<br />
else<br />
{<br />
$message="Job result: Failed"<br />
$comments = "`nError Message: " +$errorMessage<br />
<br />
}<br />
<br />
<br />
<br />
<span style="color: #274e13;"> Write-Log -Message "***** SENDING CONFIRMATION EMAIL *****"</span><br />
<br />
# $smtpServer = "mail.ftech.com "<br />
# $subject = "EFT Invoice mailbox archive job report"<br />
# $body = $message +"`nComments: "+$comments<br />
# Send-MailMessage -To $emailTo -From $emailFrom -Subject $subject -Body $body -SmtpServer $smtpServer<br />
Write-Log -Message "***** SENT CONFIRMATION EMAIL *****"<br />
<br />
}<br />
catch [System.Net.WebException],[System.Exception]<br />
{<br />
Write-Log -Message "***** ERROR OCCURED *****"<br />
<br />
$ErrorMessage = $_.Exception.Message<br />
Write-Log -Message $_.Exception.Message <br />
Write-Log -Message "***** ERROR CLOSED *****"<br />
}<br />
<br />
<span style="color: #274e13;">Write-Log -Message "***** ARCHIVING POWERSHELL SCRIPT END *****"</span><br />
<br />
<br />
<b>Step 4:</b> Run the above script and followed by output.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3Zr_lS1Rao4uuH6fnSRN7DUNL6dKZevlhsyw__yUb1D9XFj5R8Cy2YZ3YOaxSjA8gt4jh8-1foHbgVmzKENhc5PpYPQLMP5EEQEEFrKU0huzKoiyzefJjeRLBnNeInJj3wh1rXjo2R8-s/s1600/SharePointOutlook.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="492" data-original-width="656" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3Zr_lS1Rao4uuH6fnSRN7DUNL6dKZevlhsyw__yUb1D9XFj5R8Cy2YZ3YOaxSjA8gt4jh8-1foHbgVmzKENhc5PpYPQLMP5EEQEEFrKU0huzKoiyzefJjeRLBnNeInJj3wh1rXjo2R8-s/s400/SharePointOutlook.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 5 </b>: Check SharePoint List now.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQcvu7YPlNjhyphenhyphenOJEw2deNpEfWOUd2m7EKPOzY6I1hNJgODPZMzcKOZV2pOZ6wkOiU3OpVzRRDMyz2G5ipoBw6gOKv9lLkjldhMtCa1wB8hCVI55yVZ4zIwBZEHGXSbhEsvSI0ygBYLitK5/s1600/SharePoint+List.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="273" data-original-width="790" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQcvu7YPlNjhyphenhyphenOJEw2deNpEfWOUd2m7EKPOzY6I1hNJgODPZMzcKOZV2pOZ6wkOiU3OpVzRRDMyz2G5ipoBw6gOKv9lLkjldhMtCa1wB8hCVI55yVZ4zIwBZEHGXSbhEsvSI0ygBYLitK5/s400/SharePoint+List.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="color: blue;">Happy Coding..!</span></b></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com1tag:blogger.com,1999:blog-3138753744371217570.post-90645586596000910592018-05-04T15:03:00.003-07:002018-05-04T15:11:14.735-07:00Get User Profile data in SharePoint Designer 2013 Workflow<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div class="MsoNormal">
</div>
<div class="MsoNormal" style="text-align: left;">
<span style="background: white; color: #444444; font-family: "segoe ui" , sans-serif; line-height: 107%;">SharePoint Designer 2010
supported out of box activity to access user profile fields. However, User
Profile service option is not present in SharePoint 2013 Designer workflows.</span><o:p></o:p></div>
<div class="MsoNormal" style="text-align: left;">
<span style="background: white; color: #444444; font-family: "segoe ui" , sans-serif; line-height: 107%;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="background: white; color: #444444; font-family: "segoe ui" , sans-serif; line-height: 107%;">In SharePoint 2013
workflow type ,we do not have any Lookup Manager for User activity. For this,
SharePoint 2013 workflow you will need to use the Call HTTP Web Service
activity, with the following end point URL.</span><o:p></o:p><br />
<br />
<span style="background: white; color: #444444; font-family: "segoe ui" , sans-serif; line-height: 107%;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="background: white; color: #444444; font-family: "segoe ui" , sans-serif; line-height: 107%;"><br /></span></div>
<div class="MsoNormal" style="text-align: left;">
<span style="background: white; color: #444444; font-family: "segoe ui" , sans-serif; line-height: 107%;"></span></div>
<div class="MsoNormal">
<em><b><span style="background: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; font-style: normal; line-height: 107%;"><a href="http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v=%27i:0%23.f|membership|venkat@technologies.com">http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v='i:0%23.f|membership|venkat@technologies.com</a></span></b></em><em><b><span style="background: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;">'<o:p></o:p></span></b></em></div>
<div class="MsoNormal">
<em><b><span style="background: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></b></em></div>
<div class="MsoNormal">
<em><b><span style="background: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;">Follow the below steps to get
manager:</span></b></em><br />
<em><b><span style="background: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></b></em></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="background: white; color: #212121; line-height: 107%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Step 1</b> : </span></span><span style="background: white; color: #212121; line-height: 107%;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Activate site level feature - Workflows can use
app permissions.</span></span></div>
<div class="MsoNormal">
<span style="background: white; color: #212121; line-height: 107%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif;"><b>1. </b>Go to Site Settings and click
Manage site features under Site Actions.</span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif;">2. Activate feature Workflows can
use app permissions.</span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif;"><br /></span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG_FvG8X0uvxXMyJl5pvN_XcAEfcHlHTW1guNPFXWO5_OVfezuvMvUWc-QwuidcWCTVE0S8TTbeqcUDE1j2DUPf5aN8zmNmixwdKnbku0FmKohh_gEDoJSHqfR2qxE_ss-LrZt4uX_de0e/s1600/SharePoint+Manager.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="54" data-original-width="624" height="33" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG_FvG8X0uvxXMyJl5pvN_XcAEfcHlHTW1guNPFXWO5_OVfezuvMvUWc-QwuidcWCTVE0S8TTbeqcUDE1j2DUPf5aN8zmNmixwdKnbku0FmKohh_gEDoJSHqfR2qxE_ss-LrZt4uX_de0e/s400/SharePoint+Manager.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal">
<b>Step 2 :</b> App
Permission – To ensure that workflow can access user profiles.</div>
<div class="MsoNormal">
<span style="background-color: white;"><b>1. </b></span><span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">Go to Site Settings and click
Site app permissions under Users and Permissions.</span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><span style="background-color: white;">2. </span>Make a note of the App ID
for your Workflow – portion of the Workflow App Identifier between | and @.</span><br />
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2pyTxisdDgMoYzRKm3VTl8LQ96sHWv0hm0sIRSvrflQ91rs2LVbVh2N201MT6H8mfwlzMWKumK7Bib-Xq-KhVIGnQZwftIzW9bYaEgkhBuvKMtxTY9SzJEuTkHwvmIvPrD9bk-RXxxbTV/s1600/SharePoint+App.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="72" data-original-width="1111" height="25" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2pyTxisdDgMoYzRKm3VTl8LQ96sHWv0hm0sIRSvrflQ91rs2LVbVh2N201MT6H8mfwlzMWKumK7Bib-Xq-KhVIGnQZwftIzW9bYaEgkhBuvKMtxTY9SzJEuTkHwvmIvPrD9bk-RXxxbTV/s400/SharePoint+App.png" width="400" /></a></div>
<br />
<br />
<br />
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">3.With the tenant/Farm admin
account, go to <site-url> /_layouts/15/appinv.aspx.</span><br />
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;">At the appinv.aspx page,
fill in the Application ID and click the search button next to the ID box</span><br />
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Ielt0DUiw1iNUiPyfTT3hcN479VOReKQKJL7lUDEvs0XgvCUQtUwSP8SAxvmDn64Mqr6Sar8gMz_Evx3XWdZ21ZbW95mQITB3ogSffioH17r4E9qoTDGkQ8ZVC5rAbCvn52Hl0RKTEPx/s1600/Apps_SharePoint+Online.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="475" data-original-width="696" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0Ielt0DUiw1iNUiPyfTT3hcN479VOReKQKJL7lUDEvs0XgvCUQtUwSP8SAxvmDn64Mqr6Sar8gMz_Evx3XWdZ21ZbW95mQITB3ogSffioH17r4E9qoTDGkQ8ZVC5rAbCvn52Hl0RKTEPx/s400/Apps_SharePoint+Online.png" width="400" /></a></div>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBqUmCZkcyxyCY8AxZBrdaGNjkkEm_2yzJmrGQdy55hbnzJe2IqcSU1RnfXLIqQR8u6MnqOAlTe1IPuUxS1CMhdZZ34XDadqKn-GGGfYbpzLIEecB5eJGc-vVHAtIqaqiDllMRoL7Jrm7/s1600/App+Model+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="472" data-original-width="660" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBqUmCZkcyxyCY8AxZBrdaGNjkkEm_2yzJmrGQdy55hbnzJe2IqcSU1RnfXLIqQR8u6MnqOAlTe1IPuUxS1CMhdZZ34XDadqKn-GGGfYbpzLIEecB5eJGc-vVHAtIqaqiDllMRoL7Jrm7/s400/App+Model+SharePoint.png" width="400" /></a></div>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">4. Copy below xml to App’s Permission
Request XML box,</span><br />
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: .5in; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="color: #5b9bd5; font-family: "arial" , sans-serif; font-size: 10.5pt;"><AppPermissionRequests> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: .5in; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="color: #5b9bd5; font-family: "arial" , sans-serif; font-size: 10.5pt;">
<AppPermissionRequest
Scope="http://sharepoint/social/tenant" Right="Manage"
/> <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: .5in; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="color: #5b9bd5; font-family: "arial" , sans-serif; font-size: 10.5pt;"></AppPermissionRequests> </span><br />
<span style="color: #212121; font-family: "arial" , sans-serif; text-indent: -0.25in;"><span style="font-family: "times new roman"; font-stretch: normal; line-height: normal;"><br /></span></span>
<span style="color: #212121; font-family: "arial" , sans-serif; text-indent: -0.25in;"><span style="font-family: "times new roman"; font-stretch: normal; line-height: normal;">5. </span></span><span style="color: #212121; font-family: "arial" , sans-serif; text-indent: -0.25in;">Click Create. </span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; text-indent: -0.25in;">6. </span><span style="color: #212121; font-family: "arial" , sans-serif; text-indent: -0.25in;">Click Trust It, when prompted.</span><span style="color: #5b9bd5; font-family: "arial" , sans-serif; text-indent: -0.25in;"> </span></div>
<div class="MsoListParagraphCxSpFirst" style="background: white; line-height: normal; text-align: left; text-indent: -0.25in;">
<span style="color: #5b9bd5; font-family: "arial" , sans-serif; text-indent: -0.25in;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3VThJo1Ral9cWvJ45uQHirn-ZpmDPP-l8bK9ODN1j63gvfGrbDSpArfkz-oJentUG96AZXxxd-s5-FrtWUGc3Vmq7P7NvB3xWgakWhx4LUb8nCstCfzU1vRU9WtzxjiFkvEX2uo7I6aGH/s1600/Workflow+App.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="261" data-original-width="523" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3VThJo1Ral9cWvJ45uQHirn-ZpmDPP-l8bK9ODN1j63gvfGrbDSpArfkz-oJentUG96AZXxxd-s5-FrtWUGc3Vmq7P7NvB3xWgakWhx4LUb8nCstCfzU1vRU9WtzxjiFkvEX2uo7I6aGH/s400/Workflow+App.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;">
<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; line-height: 107%;"><b>Step 3</b><span style="font-size: 10.5pt;"> : Create a Workflow to get user profiles data.</span></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">1. Open the site in SharePoint
designer and create workflow on designed list or document library.</span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif;"><span style="font-size: 14px;">2. </span>Add app step and Set up a
workflow variable emailid </span><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"> </span><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">that
stores the target user’s login name.</span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXbe_HaHK_isvZVYFpXnuX2BSST-sjACl1VEUNKUBVwx-YfntyNA9T2m7wERPfYo0KY31lNnEYD1ITqpHtE6ZbS0duXHYAVxF8sQn2A5SvFsiinEmoKYdr6wQJTc8EWTOI4e94vn1anVhR/s1600/Workflow+Variable.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="56" data-original-width="310" height="72" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXbe_HaHK_isvZVYFpXnuX2BSST-sjACl1VEUNKUBVwx-YfntyNA9T2m7wERPfYo0KY31lNnEYD1ITqpHtE6ZbS0duXHYAVxF8sQn2A5SvFsiinEmoKYdr6wQJTc8EWTOI4e94vn1anVhR/s400/Workflow+Variable.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span>
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif;"><span style="font-size: 14px;">3.We will encode the variable as below.</span></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtXT0M7NoTdbN_f3I_TbwVYcyUjnQqcC-vDgCQ4DW939CGCNjAVBKgHQ4-UjddyMzjb1F78T1OYoUbgc4HwxpyTCYem46GSqu4TjFHw7hzy4gbVflI-TJ-pxmT46iQDpnmmh4JT0TbGe6f/s1600/SharePoint+Online+Variable.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="42" data-original-width="430" height="38" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtXT0M7NoTdbN_f3I_TbwVYcyUjnQqcC-vDgCQ4DW939CGCNjAVBKgHQ4-UjddyMzjb1F78T1OYoUbgc4HwxpyTCYem46GSqu4TjFHw7hzy4gbVflI-TJ-pxmT46iQDpnmmh4JT0TbGe6f/s400/SharePoint+Online+Variable.png" width="400" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtXT0M7NoTdbN_f3I_TbwVYcyUjnQqcC-vDgCQ4DW939CGCNjAVBKgHQ4-UjddyMzjb1F78T1OYoUbgc4HwxpyTCYem46GSqu4TjFHw7hzy4gbVflI-TJ-pxmT46iQDpnmmh4JT0TbGe6f/s1600/SharePoint+Online+Variable.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtXT0M7NoTdbN_f3I_TbwVYcyUjnQqcC-vDgCQ4DW939CGCNjAVBKgHQ4-UjddyMzjb1F78T1OYoUbgc4HwxpyTCYem46GSqu4TjFHw7hzy4gbVflI-TJ-pxmT46iQDpnmmh4JT0TbGe6f/s1600/SharePoint+Online+Variable.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<br />
<br />
<br />
<br />
4.Build dictionary to set up the RequestHeaders<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRirI85AR3B0mrqhxJbhmPS9NxF-92h4HU8XvdaPf1E5WOW0zIsxO1QoG6qqTo7Xf52dkOPJnzEKkdAlDY8qdQGj4-NN707gHOYbH9yXvlKV8weLUYnuy2NM-mhEYkiEW5Lysuuk6wk6wN/s1600/Build+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="41" data-original-width="339" height="47" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRirI85AR3B0mrqhxJbhmPS9NxF-92h4HU8XvdaPf1E5WOW0zIsxO1QoG6qqTo7Xf52dkOPJnzEKkdAlDY8qdQGj4-NN707gHOYbH9yXvlKV8weLUYnuy2NM-mhEYkiEW5Lysuuk6wk6wN/s400/Build+SharePoint.png" width="400" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRirI85AR3B0mrqhxJbhmPS9NxF-92h4HU8XvdaPf1E5WOW0zIsxO1QoG6qqTo7Xf52dkOPJnzEKkdAlDY8qdQGj4-NN707gHOYbH9yXvlKV8weLUYnuy2NM-mhEYkiEW5Lysuuk6wk6wN/s1600/Build+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRirI85AR3B0mrqhxJbhmPS9NxF-92h4HU8XvdaPf1E5WOW0zIsxO1QoG6qqTo7Xf52dkOPJnzEKkdAlDY8qdQGj4-NN707gHOYbH9yXvlKV8weLUYnuy2NM-mhEYkiEW5Lysuuk6wk6wN/s1600/Build+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRirI85AR3B0mrqhxJbhmPS9NxF-92h4HU8XvdaPf1E5WOW0zIsxO1QoG6qqTo7Xf52dkOPJnzEKkdAlDY8qdQGj4-NN707gHOYbH9yXvlKV8weLUYnuy2NM-mhEYkiEW5Lysuuk6wk6wN/s1600/Build+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRirI85AR3B0mrqhxJbhmPS9NxF-92h4HU8XvdaPf1E5WOW0zIsxO1QoG6qqTo7Xf52dkOPJnzEKkdAlDY8qdQGj4-NN707gHOYbH9yXvlKV8weLUYnuy2NM-mhEYkiEW5Lysuuk6wk6wN/s1600/Build+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRirI85AR3B0mrqhxJbhmPS9NxF-92h4HU8XvdaPf1E5WOW0zIsxO1QoG6qqTo7Xf52dkOPJnzEKkdAlDY8qdQGj4-NN707gHOYbH9yXvlKV8weLUYnuy2NM-mhEYkiEW5Lysuuk6wk6wN/s1600/Build+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<br />
<br />
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;">5. Set the values as
below to dictionary.</span><br />
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span>
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="background: white; border-collapse: collapse; margin-left: 58.1pt; mso-yfti-tbllook: 1184; width: 59%px;">
<tbody>
<tr>
<td style="border: dashed #ABABAB 1.0pt; mso-border-alt: dashed #ABABAB .75pt; padding: .75pt .75pt .75pt .75pt; width: 30.7%;" width="30%"><div class="MsoNormal" style="line-height: normal; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt;">
<span style="color: #333333; font-family: "arial" , sans-serif; font-size: 10.5pt;">Accept<o:p></o:p></span></div>
</td>
<td style="border-left: none; border: dashed #ABABAB 1.0pt; mso-border-alt: dashed #ABABAB .75pt; mso-border-left-alt: dashed #ABABAB .75pt; padding: .75pt .75pt .75pt .75pt; width: 69.3%;" width="69%"><div class="MsoNormal" style="line-height: normal; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt;">
<span style="color: #333333; font-family: "arial" , sans-serif; font-size: 10.5pt;">application/json;odata=verbose<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: dashed #ABABAB 1.0pt; mso-border-alt: dashed #ABABAB .75pt; mso-border-top-alt: dashed #ABABAB .75pt; padding: .75pt .75pt .75pt .75pt; width: 30.7%;" width="30%"><div class="MsoNormal" style="line-height: normal; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt;">
<span style="color: #333333; font-family: "arial" , sans-serif; font-size: 10.5pt;">Content-Type<o:p></o:p></span></div>
</td>
<td style="border-bottom: dashed #ABABAB 1.0pt; border-left: none; border-right: dashed #ABABAB 1.0pt; border-top: none; mso-border-alt: dashed #ABABAB .75pt; mso-border-left-alt: dashed #ABABAB .75pt; mso-border-top-alt: dashed #ABABAB .75pt; padding: .75pt .75pt .75pt .75pt; width: 69.3%;" width="69%"><div class="MsoNormal" style="line-height: normal; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 12.0pt;">
<span style="color: #333333; font-family: "arial" , sans-serif; font-size: 10.5pt;">application/json;odata=verbose<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #212121; font-family: "arial" , sans-serif;"><span style="font-size: 14px;">6. </span></span><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;">We will use the REST
API to get UserProfile Properties.</span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span>
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;">7. Set workflow variable
servicecall to RESTAPI.</span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxikaLSBZnaZfNeYshBip_n_q0fzpKHajVLfCvpV63X1tSlS1D3zc5hEmBLSjxPY54OwGLeC_sx3ESq_D0IY0ZI09SNABN_cX4EotDFYe_pVrngljckpm2GkVfWqNMm6pjjLniebBQwGRE/s1600/SharePoint+Webservice+call.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="38" data-original-width="397" height="37" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxikaLSBZnaZfNeYshBip_n_q0fzpKHajVLfCvpV63X1tSlS1D3zc5hEmBLSjxPY54OwGLeC_sx3ESq_D0IY0ZI09SNABN_cX4EotDFYe_pVrngljckpm2GkVfWqNMm6pjjLniebBQwGRE/s400/SharePoint+Webservice+call.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhnKxJFS1VMnBMMCUP7C1T2Qd4z7I7iSwISMZxp0d4ymcTpt9Llth404-AyE4b8QR6IY7e5QwURD7mjOOaUi9zQrFph9ZVSvV9oX1-otgcQufTyWJphElO5aRLvKr9rwONRJyRkJZcpSFb/s1600/SharePoint+String+builder.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="180" data-original-width="499" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhnKxJFS1VMnBMMCUP7C1T2Qd4z7I7iSwISMZxp0d4ymcTpt9Llth404-AyE4b8QR6IY7e5QwURD7mjOOaUi9zQrFph9ZVSvV9oX1-otgcQufTyWJphElO5aRLvKr9rwONRJyRkJZcpSFb/s400/SharePoint+String+builder.png" width="400" /></a></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoNormal">
<i><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; line-height: 107%;"><a href="http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v=%27i:0%23.f|membership|venkat@technologies.com">http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v='i:0%23.f|membership|venkat@technologies.com</a></span></i></div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21g59y85kt0zkhKFleqSr5QZ0tjhC1mcAyVIfktQxm1K2QflaJ_GimXh-zPM-FBTZwpFBKx075dJUvIDsEtjan1GNPGt-TqhLMNQhKPlM73-VM3Guq4ShgB63L7iA8DBtdXZmfhDTjthyphenhyphen/s1600/SharePoint+Manager.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="141" data-original-width="1206" height="46" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21g59y85kt0zkhKFleqSr5QZ0tjhC1mcAyVIfktQxm1K2QflaJ_GimXh-zPM-FBTZwpFBKx075dJUvIDsEtjan1GNPGt-TqhLMNQhKPlM73-VM3Guq4ShgB63L7iA8DBtdXZmfhDTjthyphenhyphen/s400/SharePoint+Manager.png" width="400" /></a></div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span style="color: #212121; font-family: "arial" , sans-serif;">1<span style="font-family: "times new roman"; font-stretch: normal; line-height: normal;"> </span></span><br />
<span style="color: #212121; font-family: "arial" , sans-serif; text-indent: -0.25in;"><span style="font-family: "times new roman"; font-stretch: normal; line-height: normal;"> 8. </span></span><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;">Call Http Web Service to invoke the REST API</span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">9</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_o1WRuK069FjwDo_i8gDDJxPFMgpsBYrbkwzR-S2bjUxebvZkGyA7UhNQ8bC3_nzXEbGcm9ai4bvemyXgpWwg5gPD_iBlLYmBp0NU44UREim8AKIdhBCnxN1Dthrgg7gdl5kiQaRiME9z/s1600/call+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="42" data-original-width="1055" height="15" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_o1WRuK069FjwDo_i8gDDJxPFMgpsBYrbkwzR-S2bjUxebvZkGyA7UhNQ8bC3_nzXEbGcm9ai4bvemyXgpWwg5gPD_iBlLYmBp0NU44UREim8AKIdhBCnxN1Dthrgg7gdl5kiQaRiME9z/s400/call+SharePoint.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDQ2lj8PA9B659xg4Exnu0GaCqiHFuGT6ZvBsulP9b6T3sjRrky_ZRvOF2vRyi5JBwJkr7vyLgPmLi5mzf5H4oxdCd0jVQkNY-0PDCgevgQtv7i7ldxw-M2Dupgs5Qnc-l8T7YsaYMHCeH/s1600/REST+API+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="506" data-original-width="1054" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDQ2lj8PA9B659xg4Exnu0GaCqiHFuGT6ZvBsulP9b6T3sjRrky_ZRvOF2vRyi5JBwJkr7vyLgPmLi5mzf5H4oxdCd0jVQkNY-0PDCgevgQtv7i7ldxw-M2Dupgs5Qnc-l8T7YsaYMHCeH/s400/REST+API+SharePoint.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9wSW-GHzF-ulo3BIblZ3szVKXmTdiuw_lkfxHIwYwb-lYI_Fm5x6xSIwQI46kRryReCcasnwOCLw-ZmXLcHPtbWNlD3_i4K2Slor0nFdQF_cfOx0Z2l04-Hl0bzjfPPeRKrxu7RX5zY3_/s1600/Get+Call+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="38" data-original-width="495" height="30" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9wSW-GHzF-ulo3BIblZ3szVKXmTdiuw_lkfxHIwYwb-lYI_Fm5x6xSIwQI46kRryReCcasnwOCLw-ZmXLcHPtbWNlD3_i4K2Slor0nFdQF_cfOx0Z2l04-Hl0bzjfPPeRKrxu7RX5zY3_/s400/Get+Call+SharePoint.png" width="400" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9wSW-GHzF-ulo3BIblZ3szVKXmTdiuw_lkfxHIwYwb-lYI_Fm5x6xSIwQI46kRryReCcasnwOCLw-ZmXLcHPtbWNlD3_i4K2Slor0nFdQF_cfOx0Z2l04-Hl0bzjfPPeRKrxu7RX5zY3_/s1600/Get+Call+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9wSW-GHzF-ulo3BIblZ3szVKXmTdiuw_lkfxHIwYwb-lYI_Fm5x6xSIwQI46kRryReCcasnwOCLw-ZmXLcHPtbWNlD3_i4K2Slor0nFdQF_cfOx0Z2l04-Hl0bzjfPPeRKrxu7RX5zY3_/s1600/Get+Call+SharePoint.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<br />
<br />
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<br /></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"> </span><br />
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">9.</span><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;">The workflow variable Manager should get populated with the Title</span><br />
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Q9RV8wJTuxpCrvFHzQBLy5Oyo2bA_zhOlFn9SxG3I6Et3_2KuFqcR5buWILDvdZHBc4n-3vnmIzCTLVyhQrhTff6mlNb1441UooqJEJ75sUhdLY0d977qdpyLVF9nxTp0n6N5kcZdzya/s1600/Get+Manager+Workflow.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="545" data-original-width="1151" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Q9RV8wJTuxpCrvFHzQBLy5Oyo2bA_zhOlFn9SxG3I6Et3_2KuFqcR5buWILDvdZHBc4n-3vnmIzCTLVyhQrhTff6mlNb1441UooqJEJ75sUhdLY0d977qdpyLVF9nxTp0n6N5kcZdzya/s400/Get+Manager+Workflow.png" width="400" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Q9RV8wJTuxpCrvFHzQBLy5Oyo2bA_zhOlFn9SxG3I6Et3_2KuFqcR5buWILDvdZHBc4n-3vnmIzCTLVyhQrhTff6mlNb1441UooqJEJ75sUhdLY0d977qdpyLVF9nxTp0n6N5kcZdzya/s1600/Get+Manager+Workflow.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7Q9RV8wJTuxpCrvFHzQBLy5Oyo2bA_zhOlFn9SxG3I6Et3_2KuFqcR5buWILDvdZHBc4n-3vnmIzCTLVyhQrhTff6mlNb1441UooqJEJ75sUhdLY0d977qdpyLVF9nxTp0n6N5kcZdzya/s1600/Get+Manager+Workflow.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;">10.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;">Updated one of the
list filed with Title.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxD9grNJWHcwbwSe4kO1FAGnAnHaRWQkc29KG7H7d208cnW5PPFziJUdlt-lm06NzElGGCrSLeFM4CrMKxNG93SdcjwN60vgv3KOv6rexdaok9tHqXNQw6qGZ6xG_n_i8iX3YH6ulNLZXE/s1600/Update+List+Item+Title+Variable.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="34" data-original-width="251" height="54" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxD9grNJWHcwbwSe4kO1FAGnAnHaRWQkc29KG7H7d208cnW5PPFziJUdlt-lm06NzElGGCrSLeFM4CrMKxNG93SdcjwN60vgv3KOv6rexdaok9tHqXNQw6qGZ6xG_n_i8iX3YH6ulNLZXE/s400/Update+List+Item+Title+Variable.png" width="400" /></a></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt; text-indent: -0.25in;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9CqXTxF_B28PJwgOSpEVtMupy16EF2-PcX4F5wQv1_Neww3K-Ni9QH3waW4VMA4LgzXLGhJvnhRRyc9FC8yaGI1mr9hdXYUFoZXhdgcZy2SMvndAUjlqhXFevmNik_oWFXpiv9ZnrIt_z/s1600/Update+SharePoint++List.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="72" data-original-width="356" height="80" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9CqXTxF_B28PJwgOSpEVtMupy16EF2-PcX4F5wQv1_Neww3K-Ni9QH3waW4VMA4LgzXLGhJvnhRRyc9FC8yaGI1mr9hdXYUFoZXhdgcZy2SMvndAUjlqhXFevmNik_oWFXpiv9ZnrIt_z/s400/Update+SharePoint++List.png" width="400" /></a></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<br /></div>
<div class="MsoListParagraph" style="background: white; line-height: normal; mso-add-space: auto; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #212121; font-family: "arial" , sans-serif; font-size: 10.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #212121; font-family: "arial" , sans-serif; line-height: 107%;"></span></div>
<span style="font-size: 10.5pt;"></span><br />
<ol start="1" type="1">
</ol>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com9tag:blogger.com,1999:blog-3138753744371217570.post-37115129554244265182018-04-17T13:28:00.001-07:002018-05-16T14:40:25.277-07:00Get user's manager and insert into a column in SharePoint Online<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: blue;"><b>Get user's manager name and insert into a list column for SharePoint Online</b></span><br />
<br />
<div style="text-align: left;">
<span style="background-color: white; color: #333333; display: inline; float: none; font-family: "segoe ui" , "lucida grande" , "verdana" , "arial" , "helvetica" , sans-serif; font-size: 14px; font-style: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="font-family: "trebuchet ms" , sans-serif;">We can use SharePoint2013 designer workflow/MS Flow to achieve it and also we can use REST API to get user's manager details.</span></span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidwVBsufORSd7iQ5V-ZZ-NitH1k1q37CdQlmlOujNRtaG0P7iFDndTf_Ivx0WtCVnoIXNeMXQVtSkZcEtmfde2IGOhObuZBbYXW19-QiRiPaBn1k2T3ojRkh54kAds9i792dsPJhNFLjcA/s1600/Owner_Office+365.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="68" data-original-width="633" height="67" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidwVBsufORSd7iQ5V-ZZ-NitH1k1q37CdQlmlOujNRtaG0P7iFDndTf_Ivx0WtCVnoIXNeMXQVtSkZcEtmfde2IGOhObuZBbYXW19-QiRiPaBn1k2T3ojRkh54kAds9i792dsPJhNFLjcA/s640/Owner_Office+365.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZgs6KykXOoqBBL6pt6iDe2aaAs3E5d8yNZB2E9olJMdrJTHjBRElOsGkqYPGvsyEpsYYBzu7ihFAv54tkh1eGkKovoOAJwYbRAa3M3SdQFWPKOr87O4bAErqQ4gz3m3D8pxTS3MT8KSdk/s1600/Manager_SharePoint+Online.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="68" data-original-width="633" height="67" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZgs6KykXOoqBBL6pt6iDe2aaAs3E5d8yNZB2E9olJMdrJTHjBRElOsGkqYPGvsyEpsYYBzu7ihFAv54tkh1eGkKovoOAJwYbRAa3M3SdQFWPKOr87O4bAErqQ4gz3m3D8pxTS3MT8KSdk/s640/Manager_SharePoint+Online.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script><br />
<script type="text/javascript"><br />
<br />
<span style="color: blue;"><b>GetCurrentUser(encodeURIComponent($.parseJSON($("[title='Owner'] input").val())[0].Key));</b></span><br />
//<br />
<br />
function <span style="color: blue;"><b>GetCurrentUser(loginName)</b></span> {<br />
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v=" + "'" + loginName + "'";<br />
var requestHeaders = { "accept" : "application/json;odata=verbose" };<br />
$.ajax({<br />
url : requestUri,<br />
method: "GET",<br />
async:false,<br />
headers : requestHeaders,<br />
success : onSuccess,<br />
error : onError<br />
});<br />
<br />
}<br />
function onSuccess(data){<br />
var department = decodeURIComponent(data.d.GetUserProfilePropertyFor)<br />
SetUserFieldValue("<b>OwnerManager</b>",department);<br />
<br />
return true;<br />
} <br />
function SetUserFieldValue(fieldName, userName) {<br />
var _PeoplePicker = $("div[title='" + fieldName + "']");<br />
var _PeoplePickerTopId = _PeoplePicker.attr('id');<br />
var _PeoplePickerEditer = $("input[title='" + fieldName + "']");<br />
_PeoplePickerEditer.val(userName);<br />
var _PeoplePickerOject = SPClientPeoplePicker.SPClientPeoplePickerDict[_PeoplePickerTopId];<br />
_PeoplePickerOject.AddUnresolvedUserFromEditor(true);<br />
}<br />
function onError(jqxr,errorCode,errorThrown){<br />
alert("Error: " + jqxr.responseText)<br />
}<br />
<br />
</script></div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-34285517720653291282017-12-22T16:53:00.000-08:002017-12-22T16:53:18.051-08:00Create a SharePoint Online Site - Office 365 using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="color: purple; font-family: Trebuchet MS, sans-serif;"><b>Create a SharePoint Online Site - Office 365 using Powershell</b></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"># Usage</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"># .\create-site-csom.ps1 -siteTitle "new site2" -siteUrl "newsite2" -cred $false -parent "https://pravahaminfo.sharepoint.com/teams/appdev1/"</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;">#</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"># .\create-site-csom.ps1 -siteTitle "new site2" -siteUrl "newsite2" -cred $true -parent "https://pravahaminfo.sharepoint.com/teams/appdev1/"</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"># Will ask for Credentials</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">Param(</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> [Parameter(Mandatory=$true)] [string] $parent, </span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>[Parameter(Mandatory=$true)] [string] $siteTitle,</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>[Parameter(Mandatory=$true)] [string] $siteUrl,</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>[string] $siteDescription,</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> [string] $template = "STS#0",</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="color: blue;"> [bool] $cred</span> <span style="color: #38761d;">#Use custom Credentials</span></span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">)</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;">#Clear-Host</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: red; font-family: Trebuchet MS, sans-serif;">Write-Host</span><span style="color: blue; font-family: Trebuchet MS, sans-serif;"> "Initializing..."</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">$resources = split-path $script:MyInvocation.MyCommand.Definition</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">if(-not $(Test-Path "$resources\bin"))</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">{</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$resources = split-path $script:MyInvocation.MyCommand.Definition | split-path -parent</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">}</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">try {</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> if ($cred)</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> {</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Add-Type -Path "$resources\bin\2013\Microsoft.SharePoint.Client.dll" </span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Add-Type -Path "$resources\bin\2013\Microsoft.SharePoint.Client.Runtime.dll" </span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Add-Type -Path "$resources\bin\2013\Microsoft.SharePoint.Client.Publishing.dll"</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $Username = Read-Host -Prompt "Please enter your username"</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $Password = Read-Host -Prompt "Please enter your password" -AsSecureString</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $Context = New-Object Microsoft.SharePoint.Client.ClientContext($parent)</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username,$Password)</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $Context.Credentials = $Creds</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> }</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> else {</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Add-Type -Path "$resources\bin\2010\Microsoft.SharePoint.Client.dll"</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Add-Type -Path "$resources\bin\2010\Microsoft.SharePoint.Client.Runtime.dll"</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #38761d;"> #Add-Type -Path "$resources\sp2010\Microsoft.SharePoint.Client.Publishing.dll"</span></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: blue;"> Add-Type -Path "$resources\bin\2013\ClaimsAuth.dll"</span></span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $context = [MSDN.Samples.ClaimsAuth.ClaimClientContext]::GetAuthenticatedContext($parent);</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> }</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">}</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">catch [System.Exception] {</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Write-Host "Error when connecting to parent site: " $_.Exception.Message -ForegroundColor Red</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> return</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">}</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: red; font-family: Trebuchet MS, sans-serif;">Write-Host</span><span style="color: blue; font-family: Trebuchet MS, sans-serif;"> "Creating..."</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">try {</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: #274e13;"> #Create SubSite</span></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"> <span style="color: blue;">$WCI = New-Object Microsoft.SharePoint.Client.WebCreationInformation</span></span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $WCI.WebTemplate = $template</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $WCI.Description = $siteDescription</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $WCI.Title = $siteTitle</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $WCI.Url = $siteUrl</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $WCI.Language = "1033"</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $SubWeb = $Context.Web.Webs.Add($WCI)</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $Context.ExecuteQuery()</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span><span style="color: #38761d;"><#</span></span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$tenant = New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Context)</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$scProps = New-Object Microsoft.Online.SharePoint.TenantAdministration.SiteCreationProperties</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$scProps.Url = $siteUrl</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$scProps.Title = $siteTitle</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$scProps.Owner = $Username</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>#$scProps.StorageMaximumLevel = 100</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>#$scProps.UserCodeMaximumLevel = 50</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$scProps.Template = $template</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$scProps.Lcid = 1033</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$operation = $tenant.CreateSite($scProps)</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$Context.Load($scProps)</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>$Context.ExecuteQuery()</span></div>
<div style="text-align: left;">
<span style="color: #38761d; font-family: Trebuchet MS, sans-serif;"><span style="white-space: pre;"> </span>#></span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">}</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">catch [System.Exception] {</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Write-Host "Error when creating site: " $_.Exception.Message -ForegroundColor Red</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> return</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">}</span></div>
<div style="height: 0px; text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-73193753404173769602017-12-14T12:19:00.002-08:002017-12-18T09:23:33.494-08:00Get List of Site owners from all web applications in SharePoint using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<b style="background-color: white; color: #333333; font-family: "Helvetica Neue Light", HelveticaNeue-Light, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;"><span style="color: blue;">List of Site owners from all web applications in SharePoint using Powershell</span></b><br />
<br style="background-color: white; color: #333333; font-family: "Helvetica Neue Light", HelveticaNeue-Light, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;" />
<span style="background-color: white; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif; font-size: 14px;"><span style="color: #351c75;">Add-PSSnapin "Microsoft.SharePoint.Powershell"</span></span><br />
<span style="background-color: white; color: #333333; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif; font-size: 14px;"><span style="color: #073763;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">function CreateReportObject($url = $null, $title = $null, $desc = $null, $IsRoot = $null, $groupname = $null, $loginname = $null, $dg = $null, $email = $null, $ucount = $null, $created = $null, $farm = $null,$isreadonly = $null) </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">{ </span></span><br />
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: #073763; white-space: pre;"> </span><span style="color: #3d85c6;">$newreportobj = new-object psobject </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> $newreportobj | add-member noteproperty -name "URL" -value $url </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Title" -value $title </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Description" -value $desc </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "IsRootWeb" -value $IsRoot </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> $newreportobj | add-member noteproperty -name "Groups" -value $groupname<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> $newreportobj | add-member noteproperty -name "Owners" -value $loginname</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "DomainGroups" -value $dg</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Farm" -value $farm<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "ITO" -value ''<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Owners Email" -value $email</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Additional Owners" -value ''</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "User Count" -value $ucount<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Created" -value $created </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Is Read-Only" -value $isreadonly</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> return ($newreportobj) </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #274e13; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><b>#Get all members of the domain group</b></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">function GetDomainGroupUsers($web = $null, $domaingroup = $null) </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">{ </span></span><br />
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: #073763; white-space: pre;"> </span><span style="color: #0b5394;">$_domaingroupusers = "" </span></span></span><br />
<span style="color: #0b5394; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> $reachedMax = $false</span></span><br />
<span style="color: #0b5394; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$adusers = [Microsoft.SharePoint.Utilities.SPUtility]::GetPrincipalsInGroup($web, $domaingroup, 50, [ref]$reachedMax)</span></span><br />
<span style="color: #0b5394; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach ($aduser in $adusers) </span></span><br />
<span style="color: #0b5394; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="color: #0b5394; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>if($aduser.Email -ne '' -AND $aduser.LoginName -like '*i:0#.w*') { $_domaingroupusers += "$($aduser.LoginName);" }</span></span><br />
<span style="color: #0b5394; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #0b5394; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> return ($_domaingroupusers) </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$global:_Loginname = ""</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$global:_dg = ""<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$global:_email = ""<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #0c343d; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><b>#Add all users to the "user" variable</b></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">function AddUsers($user) </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">{ </span></span><br />
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: #073763; white-space: pre;"> </span><span style="color: #3d85c6;">if($user.Email -ne '' -AND $user.LoginName -like '*i:0#.w*') { </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>if($global:_Loginname -notlike "*$($user.LoginName);*")</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$global:_Loginname += "$($user.LoginName);" </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$global:_email += "$($user.Email);"</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>else { </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>if($user.IsDomainGroup -eq 'True') { </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>if($global:_dg -notlike "*$($user.Name);*")</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$global:_dg += "$($user.Name);" </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>} </span></span><br />
<span style="color: #3d85c6; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$fName = [System.IO.Path]::GetRandomFileName() + ".csv"</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$ReportPath =".\" + $fName; </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$SiteReportCollection= @() </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$SiteReportCollection+=CreateReportObject -url $date -title '' -desc '' -IsRoot '' -groupname '' -loginname '' -dg '' -email '' -ucount '' -created '' -farm '' -isreadonly ''</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$WebAppUrls = "http://webapplication1.com;http://webapplication2.com"</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$WebApps = $WebAppUrls.split(";")</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">foreach($WebApp in $WebApps){</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>if($WebApp){</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$_farm = ""</span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$webs = Get-SPWebApplication $WebApp | Get-SPSite -Limit All | Get-SPWeb -Limit All | where { $_.IsAppWeb -ne 'True' }</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: #073763; white-space: pre;"> </span><b><span style="color: #274e13;">#Iterate through all the sub sites except the app web</span></b></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach($web in $webs){</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$webGroups = $web.Groups; <span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$_IsRootWeb = $web.IsRootWeb <span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$_Groups<span style="white-space: pre;"> </span>= ""</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$global:_Loginname = ""</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$global:_dg = ""<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$global:_email = ""<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$_usercount = $web.Users.Count<span style="white-space: pre;"> </span></span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach($webGroup in $webGroups)</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$_usercount += $webGroup.Users.Count</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: #073763; white-space: pre;"> </span><span style="color: #0c343d;"><b>#Get all the users and groups having FULLMASK BasePermission </b></span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach($rAssignment in $web.RoleAssignments)</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach($roleDefinition in $rAssignment.RoleDefinitionBindings | Where {$_.BasePermissions -eq [Microsoft.SharePoint.SPBasePermissions]::FullMask})</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$member = $rAssignment.Member<span style="white-space: pre;"> </span></span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>if($member.GetType() -eq [Microsoft.SharePoint.SPUser])</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>AddUsers $member</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>else<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>if($member.GetType() -eq [Microsoft.SharePoint.SPGroup])</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach ($user in $member.Users) </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>AddUsers $user</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$_Groups += "$($member.Name);"<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: #073763; white-space: pre;"> </span><b><span style="color: #274e13;">#Get all the users from groups having full control or owner permission</span></b></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach($mywebGroup in $webGroups | foreach { $Groups = $_; $_ } | where {$_.Roles -like '*owner*'} )</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach ($user in $mywebGroup.Users) </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>AddUsers $user</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$_Groups += "$($mywebGroup.Name);"<span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>} <span style="white-space: pre;"> </span></span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: #073763; white-space: pre;"> </span><b><span style="color: #0c343d;">#Get all the full control users directly added to the site</span></b></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>foreach($user in $web.Users | foreach { $users = $_; $_ } | where {$_.Roles -like '*owner*'})</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>{ <span style="white-space: pre;"> </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>AddUsers $user</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>} </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$SiteReportCollection += CreateReportObject -url $web.Url -title $web.Title -desc $web.Description -IsRoot $_IsRootWeb -groupname $_Groups -loginname $global:_Loginname -dg $global:_dg -email $global:_email -ucount $_usercount -created $web.Created -farm $_farm -isreadonly $web.Site.ReadOnly<span style="white-space: pre;"> </span></span></span><br />
<span style="font-size: 14px; white-space: pre;"><span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>$web.Dispose();</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="white-space: pre;"> </span>}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">}</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"> </span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$SiteReportCollection+=CreateReportObject -url $date -title '' -desc '' -IsRoot '' -groupname '' -loginname '' -dg '' -email '' -ucount '' -created '' -farm '' -isreadonly ''</span></span><br />
<br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$SiteReportCollection | export-csv $ReportPath -notypeinformation</span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: blue;">Write-host</span><span style="color: #073763;"> "SharePoint site owners data is exported to a CSV file at:"$ReportPath -ForegroundColor Green </span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><span style="color: blue;">Write-Host</span><span style="color: #073763;"> "Press any key to continue ..."</span></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;"><br /></span></span>
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="background-color: white; font-size: 14px;"></span></span><br />
<span style="color: #073763; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 14px;">$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")</span></span></div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-67818948919340219742017-12-13T11:49:00.003-08:002017-12-18T09:23:57.936-08:00Get List of Site collection owners from all web applications in SharePoint using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="color: blue;">List of Site collection owners from all web applications in SharePoint using Powershell</span></b><br />
<br />
<span style="background-color: white;"><span style="color: #073763;">Add-PSSnapin "Microsoft.SharePoint.Powershell"</span></span><br />
<br />
<span style="color: #073763;">function</span> CreateReportObject($url = $null, $title = $null, $loginname = $null, $dg = $null, $created = $null, $isreadonly = $null, $email = $null)<br />
{<br />
<span style="white-space: pre;"> </span><span style="color: #3d85c6;">$newreportobj = new-object psobject </span><br />
<span style="color: #3d85c6;"> $newreportobj | add-member noteproperty -name "URL" -value $url </span><br />
<span style="color: #3d85c6;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Title" -value $title <span style="white-space: pre;"> </span></span><br />
<span style="color: #3d85c6;"> $newreportobj | add-member noteproperty -name "Owners" -value $loginname</span><br />
<span style="color: #3d85c6;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "DomainGroups" -value $dg<span style="white-space: pre;"> </span></span><br />
<span style="color: #3d85c6;"> $newreportobj | add-member noteproperty -name "Email" -value $email</span><br />
<span style="color: #3d85c6;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Created" -value $created </span><br />
<span style="color: #3d85c6;"><span style="white-space: pre;"> </span>$newreportobj | add-member noteproperty -name "Is Read-Only" -value $isreadonly</span><br />
<span style="color: #3d85c6;"> return ($newreportobj) </span><br />
}<br />
<br />
$global:_Loginname = ""<br />
$global:_dg = ""<span style="white-space: pre;"> </span><br />
$global:_email = ""<span style="white-space: pre;"> </span><br />
<br />
<span style="color: #274e13;">#Add all users to the "user" variable</span><br />
function AddUsers($user)<br />
{<br />
<span style="white-space: pre;"> </span><span style="color: #0b5394;">if($user.Email -ne '' -AND $user.LoginName -like '*i:0#.w*') { </span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>if($global:_Loginname -notlike "*$($user.LoginName);*")</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>{</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>$global:_Loginname += "$($user.LoginName);" </span><br />
<span style="color: #0b5394;"> $global:_email += "$($user.Email);"<span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>}</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>else { </span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>if($user.IsDomainGroup -eq 'True') { </span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>if($global:_dg -notlike "*$($user.Name);*")</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>{</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>$global:_dg += "$($user.Name);" <span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>} </span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>}</span><br />
}<br />
<br />
$fName = [System.IO.Path]::GetRandomFileName() + ".csv"<br />
<br />
$ReportPath =".\" + $fName;<br />
<br />
$SiteReportCollection= @()<br />
<br />
$SiteReportCollection+=CreateReportObject -url $date -title '' -loginname '' -dg '' -created '' -isreadonly '' -email ''<br />
<br />
$WebAppUrls = "http://webapplication1.com;http://webapplication2.com"<br />
<br />
$WebApps = $WebAppUrls.split(";")<br />
<br />
foreach($WebApp in $WebApps){<br />
<br />
<span style="white-space: pre;"> </span><span style="color: #0b5394;">if($WebApp){<span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><br /></span>
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>$sites = Get-SPWebApplication $WebApp | Get-SPSite -Limit All</span><br />
<span style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>#Iterate through all the sub sites </span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>foreach($site in $sites)</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>{</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>$global:_Loginname = ""</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>$global:_dg = ""<span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"> $global:_email = ""</span><br />
<span style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>foreach($siteAdmin in $site.RootWeb.SiteAdministrators)</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>{<span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>AddUsers $siteAdmin<span style="white-space: pre;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>}</span><br />
<span style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>$SiteReportCollection += CreateReportObject -url $site.Url -title $site.RootWeb.Title -loginname $global:_Loginname -dg $global:_dg -created $site.RootWeb.Created -isreadonly $site.ReadOnly -email $global:_email<span style="white-space: pre;"> </span></span><br />
<span style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>$site.Dispose()</span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>}</span><br />
<span style="white-space: pre;"><span style="color: #0b5394;"> </span></span><br />
<span style="color: #0b5394;"><span style="white-space: pre;"> </span>}</span><br />
<span style="white-space: pre;"> </span><br />
}<br />
<br />
$SiteReportCollection+=CreateReportObject -url $date -title '' -loginname '' -dg '' -created '' -isreadonly '' - email''<br />
<br />
$SiteReportCollection | export-csv $ReportPath -notypeinformation<br />
<br />
<span style="color: #073763;">Write-host</span> "SharePoint site collection owner list is exported to a CSV file at:"$ReportPath -ForegroundColor Green<br />
<br />
<span style="color: #073763;">Write-Host</span> "Press any key to continue ..."<br />
<br />
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-24597001594028247252017-12-01T09:15:00.002-08:002017-12-01T09:15:13.247-08:00Error message : The file name or path does not exist; The file is being used by another program; The workbook you are trying to save has the same name as currently open workbook". While opening Excel file in SharePoint<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><b style="color: #3d85c6;">Issue :</b><span style="color: #3d85c6;"> Trying to download files from SharePoint through either IE or Chrome, however, getting this message: "</span><b><span style="color: red;">The file name or path does not exist; The file is being used by another program; The workbook you are trying to save has the same name as currently open workbook</span></b><span style="color: #3d85c6;">"</span></span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">this happens to any file I try to download </span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;"><b>Solution :</b></span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">Local office cache was the root cause of the problem only regular users who kept accessing the same files on SharePoint were the ones experiencing this issue. Excel and Word would refer to the office cache files and wouldn't find the documents.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">Below are the steps to resolve this issue. Follow steps from 1 to 4 if you need to unhide folders.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">1.Right-Click on Start and choose 'Open Windows Explorer'</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">2.Tools > Folder Options. Choose the View tab.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">3.In 'Hidden Files and folders ' select 'Show hidden files, folders and drives.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">4.Uncheck 'Hide protected operating system files(Recommended)'</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">5.Go to C:\Users\username\AppData\Local\Microsoft\Office\14.0\OfficeFileCache</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">6.Delete the FSD and FSF files from there. There might be one or two files which you might not be able to delete because they are currently being used.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">7.Open Internet Explorer browser.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">8.Got to Tools>Internet Options>Advanced.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">9.Click on the 'Restore advanced settings' button.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">10.Close the IE browser.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">11.Open the Excel or Word documents from SharePoint as a test.</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">12.Close the documents.Follow steps 1 - 4 </span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">13.In 'Hidden Files and Folders' select 'Don't show hidden files, folders, or drives'</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">14.Check the 'Hide protected operating system files(Recommended)'</span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #3d85c6; font-family: Trebuchet MS, sans-serif;">Finally you need clear the browser history then try to access the document, It will work.</span></div>
<div>
<br /></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com1tag:blogger.com,1999:blog-3138753744371217570.post-7496575556952566252017-11-29T13:24:00.002-08:002017-11-29T13:24:27.084-08:00Remove "Access Requests" without any email sending to the users<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Trebuchet MS, sans-serif;">Remove <b>"<span style="color: blue;">Access Requests</span>" </b>without any email sending to the users.</span><br />
<br />
<br />
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;">There is no deletion option in browser UI, howeever There are two ways you can work with this.</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><b>1. Using SharePoint Designer</b></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;">Need to add AllItems.aspx view using SharePoint Designer, deleting requests one by one would’ve taken very long time, as while the All Items view allowed me to select multiple rows, there was no Delete button in any toolbar nor ribbon.</span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"> Reference Link : http://johnlearnt.blogspot.com/2014/07/how-to-delete-access-request.html</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><b>2. Powershell Script</b></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">$web = Get-SPWeb https://sharepoint.com/sites/siteA</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">$items = $web.Lists["Access Requests"].Items</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">while($items.Count -gt 0)</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">{</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> Write-Host "Deleting: $($items[0].Title)"</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;"> $items[0].Delete()</span></div>
<div style="text-align: left;">
<span style="color: blue; font-family: Trebuchet MS, sans-serif;">}</span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Trebuchet MS, sans-serif;">Happy scripting :)</span></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-61265840746476413082017-08-13T21:29:00.000-07:002017-08-13T21:47:02.234-07:00Step by step Office Online Server(OOS) Installation for SharePoint 2016<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: blue;"><b>Step by step Office Online Server(OOS) Installation for SharePoint 2016</b></span><br />
<br />
<div style="text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">You can create, share and collaborate on Word, PowerPoint, Excel and OneNote files in your browser. Most notably, OOS with SharePoint lets multiple people work in a document at the same time and see everyone’s changes as they happen.Office Online Server 2016 needs to be installed on its own server, and cannot coexist with a SharePoint installation. It can still be used as a standalone installation.</span></div>
<div style="text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">The farm we are using here is a one SQL Server with the SharePoint 2016 Application Server MinRole installed on, a Web-Front end (MinRole), and a standalone Office Online Server (OOS) node.</span></div>
<br />
<span style="font-family: "trebuchet ms" , sans-serif;"><span style="background-color: white; color: #2f2f2f; font-size: 15px;">We can download OOS from the </span><a href="https://www.microsoft.com/Licensing/servicecenter/default.aspx" rel="noopener noreferrer" style="background-color: white; box-sizing: inherit; color: #0067b8; font-size: 15px;" target="_blank">Volume License Servicing Center</a><span style="background-color: white; color: #2f2f2f; font-size: 15px;"> at no cost. </span></span><br />
<span style="background-color: white; font-family: "raleway" , "helvetica neue" , "arial" , "helvetica" , "verdana" , sans-serif; font-size: 16px;"><br /></span>
<span style="background-color: white;"><span style="color: blue; font-family: "trebuchet ms" , sans-serif;"><b>Pre-requisites:</b></span></span><br />
<span style="background-color: white; font-size: 16px;"><span style="font-family: "trebuchet ms" , sans-serif;">Step Install these software packages on your Office Online Server(s).</span></span><br />
<br style="background-color: white; font-family: Raleway, "Helvetica Neue", Arial, Helvetica, Verdana, sans-serif; font-size: 16px;" />
<a href="http://go.microsoft.com/fwlink/p/?LinkId=510096" style="-webkit-tap-highlight-color: rgb(102, 102, 102); background: rgb(255, 255, 255); color: #0072c6; font-family: Raleway, "Helvetica Neue", Arial, Helvetica, Verdana, sans-serif; font-size: 16px; margin: 0px; padding: 0px; text-decoration-line: none; transition: all 0.25s ease-in-out; vertical-align: baseline;" target="_blank">.NET Framework 4.5.2</a><br />
<a href="https://www.microsoft.com/download/details.aspx?id=40784" style="-webkit-tap-highlight-color: rgb(102, 102, 102); background: rgb(255, 255, 255); color: #0072c6; font-family: Raleway, "Helvetica Neue", Arial, Helvetica, Verdana, sans-serif; font-size: 16px; margin: 0px; padding: 0px; text-decoration-line: none; transition: all 0.25s ease-in-out; vertical-align: baseline;" target="_blank">Visual C++ Redistributable Packages for Visual Studio 2013</a><br />
<a href="http://go.microsoft.com/fwlink/p/?LinkId=620071" style="-webkit-tap-highlight-color: rgb(102, 102, 102); background: rgb(255, 255, 255); color: #0072c6; font-family: Raleway, "Helvetica Neue", Arial, Helvetica, Verdana, sans-serif; font-size: 16px; margin: 0px; padding: 0px; text-decoration-line: none; transition: all 0.25s ease-in-out; vertical-align: baseline;" target="_blank">Visual C++ Redistributable for Visual Studio 2015</a><br />
<a href="http://go.microsoft.com/fwlink/p/?LinkId=620072" style="-webkit-tap-highlight-color: rgb(102, 102, 102); background: rgb(255, 255, 255); color: #0072c6; font-family: Raleway, "Helvetica Neue", Arial, Helvetica, Verdana, sans-serif; font-size: 16px; margin: 0px; padding: 0px; text-decoration-line: none; transition: all 0.25s ease-in-out; vertical-align: baseline;" target="_blank">Microsoft.IdentityModel.Extention.dll</a><br />
<b><span style="color: blue;"><br /></span></b>
<span style="color: blue; font-family: "trebuchet ms" , sans-serif;"><b>Steps:</b></span><br />
<span style="font-family: "trebuchet ms" , sans-serif;">1.<span style="font-size: 11pt; text-indent: -0.25in;">Enable
web server role and features:</span></span><br />
<span style="font-size: 11pt; text-indent: -0.25in;"><span style="font-family: "trebuchet ms" , sans-serif;">Open Powershell then rub the below script.</span></span><br />
<span style="font-family: "calibri" , sans-serif; font-size: 11pt; text-indent: -0.25in;"><br /></span>
<br />
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "courier new"; font-size: 8.0pt;"><span style="color: blue;">Install-WindowsFeature Web-Server, Web-Mgmt-Tools,
Web-Mgmt-Console, Web-WebServer, Web-Common-Http, Web-Default-Doc,
Web-Static-Content, Web-Performance, Web-Stat-Compression, Web-Dyn-Compression,
Web-Security, Web-Filtering, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext45,
Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Includes,
InkandHandwritingServices, Windows-Identity-Foundation</span><o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "courier new"; font-size: 8.0pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8NJ7wu8Gn29bLQNc4Tf2X2HD9JB4fxfEBEUkFcvdaI1neQ_2dGHwp3NbJhK6QEXdJhseI3CFDTGIAEYYhyFyPEBgMShVyQ0akOdLzarqwVC1DSAe_d9YHqeF4bkWOrhp1kx8G2naIiVn6/s1600/Webfeatures.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="104" data-original-width="630" height="52" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8NJ7wu8Gn29bLQNc4Tf2X2HD9JB4fxfEBEUkFcvdaI1neQ_2dGHwp3NbJhK6QEXdJhseI3CFDTGIAEYYhyFyPEBgMShVyQ0akOdLzarqwVC1DSAe_d9YHqeF4bkWOrhp1kx8G2naIiVn6/s320/Webfeatures.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtIJwKKqqBRpLGed6zMVxNz-riO3GDxLFE63ZD47QRKsBWhVuhGBpGIn3p_iNTjXIkcyNeJcj-uq3sX55dfkau1gCcMxL5vD8TEbM4vYeXH3heG4gdjrHExTcwa1Ie6sJrX6oEhPHvC2AR/s1600/WebfeaturesProgress.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="70" data-original-width="630" height="35" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtIJwKKqqBRpLGed6zMVxNz-riO3GDxLFE63ZD47QRKsBWhVuhGBpGIn3p_iNTjXIkcyNeJcj-uq3sX55dfkau1gCcMxL5vD8TEbM4vYeXH3heG4gdjrHExTcwa1Ie6sJrX6oEhPHvC2AR/s320/WebfeaturesProgress.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">2.Restart the server.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">3.Download OOS from MSDN and click on setup file.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi_7TOkTIZljXjmSHq6pstEPDrDVLjPdXliOwXHYeEvS5DQ8yeQXLHtLA0_mlzQqXjP36eakU8Fe5K8BNJFezWwL9PDCUyib1_MI7vGUSR-fPU-9LvzCFamaS8c713ML4LWpdPWuf3FpKp/s1600/OOS+setup.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="281" data-original-width="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi_7TOkTIZljXjmSHq6pstEPDrDVLjPdXliOwXHYeEvS5DQ8yeQXLHtLA0_mlzQqXjP36eakU8Fe5K8BNJFezWwL9PDCUyib1_MI7vGUSR-fPU-9LvzCFamaS8c713ML4LWpdPWuf3FpKp/s1600/OOS+setup.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinjFQH5JnSeazs5_OIBCa5yz9CLl1g7SGRvNFbBp6R6PahxD0xjFngEK-B8wey08BcUuQtE3vEJ4NAPLJSWKhPJgd64hAs8GlH1pRB5ijHYBs0ZQAr_itpeES2Ypn-5mBtUg0dF3DWIPIL/s1600/OOS+setup+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="187" data-original-width="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinjFQH5JnSeazs5_OIBCa5yz9CLl1g7SGRvNFbBp6R6PahxD0xjFngEK-B8wey08BcUuQtE3vEJ4NAPLJSWKhPJgd64hAs8GlH1pRB5ijHYBs0ZQAr_itpeES2Ypn-5mBtUg0dF3DWIPIL/s1600/OOS+setup+1.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-BpO1fIA0StpBYswTZqdVEy0qiUHuFfNsr3MA-wv2axM_qlihOtyztTJnF8jJr0AXB9LgiuZ_A1LhBAVMUqpCwz08ieN_yv92fWFW7kWC1c4va7O0VR9Qz9-FJyuy4xdMhuZ0cQH2su3U/s1600/OOS+setup+2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="288" data-original-width="314" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-BpO1fIA0StpBYswTZqdVEy0qiUHuFfNsr3MA-wv2axM_qlihOtyztTJnF8jJr0AXB9LgiuZ_A1LhBAVMUqpCwz08ieN_yv92fWFW7kWC1c4va7O0VR9Qz9-FJyuy4xdMhuZ0cQH2su3U/s1600/OOS+setup+2.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">4. <span style="font-size: 11pt;">Keep the drive location to default C Drive.</span></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrhw-BS4ev1JqtETSvNxvVViSTDoGUMLMKzCUkXTZjM21m8_Ax-bwkTT5d6U6duQQS0Cp3KRo6UEALehgbU03-gm9g6GS-gVPssZXB1joQjPG9pLhbYia-StFMvRwEzjZbbTx_cP64ga_H/s1600/OOS+setup+3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrhw-BS4ev1JqtETSvNxvVViSTDoGUMLMKzCUkXTZjM21m8_Ax-bwkTT5d6U6duQQS0Cp3KRo6UEALehgbU03-gm9g6GS-gVPssZXB1joQjPG9pLhbYia-StFMvRwEzjZbbTx_cP64ga_H/s1600/OOS+setup+3.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmJhmo4ua3s24ve9rM8eN0jd4tvZRHppg9lzx1l3dPy_JZDiBy2EYxzyFzFFXeCK6Tr51Epx00ONnhuQz-M9L1w2lDCT8-aKMGJDIwEZt6egiYx8YKY-8uuWFG8LMR-BUpj3zPuAl9JvmX/s1600/OOS+setup+4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmJhmo4ua3s24ve9rM8eN0jd4tvZRHppg9lzx1l3dPy_JZDiBy2EYxzyFzFFXeCK6Tr51Epx00ONnhuQz-M9L1w2lDCT8-aKMGJDIwEZt6egiYx8YKY-8uuWFG8LMR-BUpj3zPuAl9JvmX/s1600/OOS+setup+4.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">5.Do the same setting for another server if you have.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">6.<span style="font-size: 11pt;">If we don’t have certificate we need to
configure it , in this case we have ‘OOSCert’. or Create Self signed certificate.</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: 11pt;"><span style="font-family: "trebuchet ms" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: 11pt;"><span style="font-family: "trebuchet ms" , sans-serif;">Import your Personal certificate:</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8JJS5L8e-oNlRXlurjMjFaPcONgiyRNz1_TU8F00mob6TMQU3m1Caex79mUloRvgnJjaVVDviWs4S4pCkWmSWPkE6xJqw2kqigVLsr0VzuUoSCE3qZveiERGDBONLHt8M34lqf4kS45rm/s1600/OOSCert1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="599" data-original-width="800" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8JJS5L8e-oNlRXlurjMjFaPcONgiyRNz1_TU8F00mob6TMQU3m1Caex79mUloRvgnJjaVVDviWs4S4pCkWmSWPkE6xJqw2kqigVLsr0VzuUoSCE3qZveiERGDBONLHt8M34lqf4kS45rm/s320/OOSCert1.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY2pV8usHkkFtpGe5Ov6k7PQy3IyOPCYJr-ATwkuvEN5WZlFDG7BxNNTcdWpX5QfcDdaIr4jSAaJhoRLsti3whF7vjwwORJxdOcID_cB_Fbpg3fr6WFs4Joe_OOyeSW1QoeUUdgFpP00Le/s1600/OOSCert2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="388" data-original-width="532" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY2pV8usHkkFtpGe5Ov6k7PQy3IyOPCYJr-ATwkuvEN5WZlFDG7BxNNTcdWpX5QfcDdaIr4jSAaJhoRLsti3whF7vjwwORJxdOcID_cB_Fbpg3fr6WFs4Joe_OOyeSW1QoeUUdgFpP00Le/s320/OOSCert2.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg058XawbG0-xoflR45b8gB7CPiJPHwu-LrkOKVP3riBK_LUgB6Oa_gSIeYTFIc5UJ3wfa3cOJaoXd9qH0Sm16InSC8y9gGahqdKwd7kFoiRuMB8OQwXB5OKJQy2dJmBpO_9B8RvHrOF2za/s1600/OOSCert3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="599" data-original-width="800" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg058XawbG0-xoflR45b8gB7CPiJPHwu-LrkOKVP3riBK_LUgB6Oa_gSIeYTFIc5UJ3wfa3cOJaoXd9qH0Sm16InSC8y9gGahqdKwd7kFoiRuMB8OQwXB5OKJQy2dJmBpO_9B8RvHrOF2za/s320/OOSCert3.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: 11pt;"><span style="font-family: "trebuchet ms" , sans-serif;">7.Go to OOS server the run the following script.</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: 14.6667px;"><span style="font-family: "trebuchet ms" , sans-serif;">Add the parameter -externalURL to define a different URL for accessing your Office Online Server farm. Shouldn’t be needed in most cases because you’re already using a FQDN with your internal URL. The parameter –CertificateName reflects the friendly name of your certificate.</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "calibri" , sans-serif; font-size: 11pt;"><br /></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: blue; font-family: "lucida console"; font-size: 9.0pt;">Import-Module</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: navy;">-Name</span> <span style="color: blueviolet;">OfficeWebApps</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: darkgreen; font-family: "lucida console"; font-size: 9.0pt;"># OWA Parameters </span><span style="font-family: "lucida console"; font-size: 9.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$InternalURL</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"https://sp-oos.sharepoint.com"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$ExternalURL</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"</span></span><span style="color: darkred; font-family: "lucida console"; font-size: 12px;">https://sp-oos.sharepoint.com</span><span style="font-family: "lucida console"; font-size: 9.0pt;"><span style="color: darkred;">"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$CertName</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"OOSCert"</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$LogLocation</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"E:\OfficeOnlineServerLogs\LogsOS"</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$maxMemoryCacheSizeInMB</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: purple;">75</span> <span style="color: darkgreen;">#Default 75 </span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$CacheSizeInGB</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: purple;">15</span> <span style="color: darkgreen;">#Default 15 </span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$CacheLocation</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"E:\OfficeServer\DiskCache"</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$RenderingLocalCacheLocation</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"E:\OfficeServer\RenderingCache"</span> <o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: darkgreen; font-family: "lucida console"; font-size: 9.0pt;"># Create the farm </span><span style="font-family: "lucida console"; font-size: 9.0pt;"><o:p></o:p></span></div>
<div class="separator" style="clear: both;">
</div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: blue; font-family: "lucida console"; font-size: 9.0pt;">New-OfficeWebAppsFarm</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: navy;">-InternalUrl</span> <span style="color: orangered;">$internalURL</span>
<span style="color: navy;">-ExternalUrl</span> <span style="color: orangered;">$ExternalURL</span>
<span style="color: navy;">-CertificateName</span> <span style="color: orangered;">$CertName</span>
<span style="color: navy;">-EditingEnabled</span> <span style="color: navy;">-LogLocation</span>
<span style="color: orangered;">$LogLocation</span> <span style="color: navy;">-CacheLocation</span>
<span style="color: orangered;">$CacheLocation</span> <span style="color: navy;">-RenderingLocalCacheLocation</span>
<span style="color: orangered;">$RenderingLocalCacheLocation</span> <span style="color: navy;">-MaxMemoryCacheSizeInMB</span> <span style="color: orangered;">$maxMemoryCacheSizeInMB</span>
<span style="color: navy;">-CacheSizeInGB</span> <span style="color: orangered;">$CacheSizeInGB</span> <o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "calibri" , "sans-serif"; font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhov2TQkxltp17GHESg-g3rpOw7x0Wvl7mrdzQK39AjiaiOTW776oaqLmR72TQagZtw3MViufHHtwpSo6k10gQnKlfQdSLE2tCJUCdM4RbLK5vSh0NCZItpzuq0NaKxrSV_NizbOGWm-GYK/s1600/OOS+setup+5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="113" data-original-width="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhov2TQkxltp17GHESg-g3rpOw7x0Wvl7mrdzQK39AjiaiOTW776oaqLmR72TQagZtw3MViufHHtwpSo6k10gQnKlfQdSLE2tCJUCdM4RbLK5vSh0NCZItpzuq0NaKxrSV_NizbOGWm-GYK/s1600/OOS+setup+5.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">8. Click on "<b><span style="color: blue;">Yes</span></b>" to continue this operation.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGtCNBGPYMpZan68X-vEosRyNV15untcH-3R2GPth56FKVHX5QLfYqhTmuDFypqj1geeHDR8A92wEYSrEzQ5zLzVpbi4jMB16Qt9JeOkqBGIyWAYUADjCEecU2sBcpxQxnElkMgfBqf8s7/s1600/OOS+setup+6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="643" data-original-width="628" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGtCNBGPYMpZan68X-vEosRyNV15untcH-3R2GPth56FKVHX5QLfYqhTmuDFypqj1geeHDR8A92wEYSrEzQ5zLzVpbi4jMB16Qt9JeOkqBGIyWAYUADjCEecU2sBcpxQxnElkMgfBqf8s7/s320/OOS+setup+6.jpg" width="312" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">9. Verify at IIS websites and application pools.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJD9xB5iy4aFl_ql87Hw_-eQl6pxbebW3w3zOvlu2N4IyhTPYWKW7buqcYhSd03VvUoi7O5elT0zuSsQ4fC122CKyjf-nvzCSxRn_ACc4o_JxY58zS6ETLMsRd4i6uEk0nfpX9P21Szjsc/s1600/OOS+Setup+7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="599" data-original-width="800" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJD9xB5iy4aFl_ql87Hw_-eQl6pxbebW3w3zOvlu2N4IyhTPYWKW7buqcYhSd03VvUoi7O5elT0zuSsQ4fC122CKyjf-nvzCSxRn_ACc4o_JxY58zS6ETLMsRd4i6uEk0nfpX9P21Szjsc/s320/OOS+Setup+7.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZvXlVEuRXY0Bg-DFzf0IIFJB7PO-iLsCayXfdXoOH7BPYVfesI87ckP94uAz5qLwQNGPI2c00IGgjXGgtz7sN50m8ExUasGsn7vD4_0dxuA8PGzdqpwdTm3S9hB0LurcC2fOSt54RoAtK/s1600/OOS+Setup+8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="599" data-original-width="800" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZvXlVEuRXY0Bg-DFzf0IIFJB7PO-iLsCayXfdXoOH7BPYVfesI87ckP94uAz5qLwQNGPI2c00IGgjXGgtz7sN50m8ExUasGsn7vD4_0dxuA8PGzdqpwdTm3S9hB0LurcC2fOSt54RoAtK/s320/OOS+Setup+8.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">10. <span style="font-size: 11pt;">Join Second Server to the farm if you have,</span><span style="font-size: 11pt;">Login to the server another server.</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: 11pt;"><span style="font-family: "trebuchet ms" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: 11pt;"><span style="font-family: "trebuchet ms" , sans-serif;">Run the following script.</span></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: blue; font-family: "lucida console"; font-size: 9.0pt;">New-OfficeWebAppsMachine</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: navy;">-MachineToJoin</span> server2name</span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "lucida console"; font-size: 9.0pt;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMcvuyUW6-QIT7BpSYpxQr6UZ2JwoKwmRCsHpapTkna4aYeSNUc6XwHBhoYQdbncY-XcCElQYxbQ11ELZzYy0pZ9k08oXsfTN_TW4zx9Jv7QLPVT43hLHSPB6UR2VJ4GQ8g4r0yJzdbYnz/s1600/OOS+Setup+9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="132" data-original-width="650" height="64" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMcvuyUW6-QIT7BpSYpxQr6UZ2JwoKwmRCsHpapTkna4aYeSNUc6XwHBhoYQdbncY-XcCElQYxbQ11ELZzYy0pZ9k08oXsfTN_TW4zx9Jv7QLPVT43hLHSPB6UR2VJ4GQ8g4r0yJzdbYnz/s320/OOS+Setup+9.jpg" width="320" /></a></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "trebuchet ms" , sans-serif;"><span style="font-size: 9pt;">11. </span><span style="font-size: 12px;">Verify that the Office Web Apps Server farm was created successfully or not?</span></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-size: 12px;"><span style="font-family: "trebuchet ms" , sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-size: 12px;"><span style="font-family: "trebuchet ms" , sans-serif;">At this point, our job is done for the Office Online Server 2016 configuration. You can go ahead and test that the “Farm” was successfully created by trying to access <span style="color: blue;"><b>https://<server name>/hosting/discovery</b></span> using Internet Explorer (or edge if using Windows Server 2016 Preview). If everything worked, you should see the server’s XML WOPI output as shown in the figure below(image was copied from MSDN).</span></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-size: 12px;"><span style="font-family: "trebuchet ms" , sans-serif;"><br /></span></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "lucida console";"><span style="font-size: 12px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDdXFXZt_suFznbYH-Exp7YIu2YJ1YhEMGkZ2XUCiWI80tcsF-O7vj_8RSD6gHNJgOeieDmvJadfUPZtSRGHJkqSom_oe8rEKv3AzxUQHU3FVBr3RIR3epxJoKeYBYUyVlKWlVBJU2c5V2/s1600/OOS+Setup+10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="500" data-original-width="750" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDdXFXZt_suFznbYH-Exp7YIu2YJ1YhEMGkZ2XUCiWI80tcsF-O7vj_8RSD6gHNJgOeieDmvJadfUPZtSRGHJkqSom_oe8rEKv3AzxUQHU3FVBr3RIR3epxJoKeYBYUyVlKWlVBJU2c5V2/s320/OOS+Setup+10.jpg" width="320" /></a></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: "lucida console";"><span style="font-size: 12px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "trebuchet ms" , sans-serif;">12.Go to SharePoint Farm server(Connecting to SharePoint) , run the following script in powershell.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: blue; font-family: "lucida console"; font-size: 9.0pt;">Add-PSSnapin</span><span style="font-family: "lucida console"; font-size: 9.0pt;">
<span style="color: blueviolet;">Microsoft.SharePoint.PowerShell</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none; text-indent: .5in;">
<span style="color: blue; font-family: "lucida console"; font-size: 9.0pt;">New-SPWOPIBinding</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: navy;">-ServerName</span> </span><span style="color: darkred; font-family: "lucida console"; font-size: 12px; text-indent: 0px;">sp-oos.sharepoint.com</span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none; text-indent: .5in;">
<span style="color: blue; font-family: "lucida console"; font-size: 9.0pt;">Get-SPWOPIZone</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none; text-indent: .5in;">
<span style="color: blue; font-family: "lucida console"; font-size: 9.0pt;">Set-SPWOPIZone</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: navy;">-zone</span> <span style="color: darkred;">"internal-https"
<o:p></o:p></span></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none; text-indent: .5in;">
<span style="color: darkgreen; font-family: "lucida console"; font-size: 9.0pt;">#These lines adds supports for legacy excel
services to be redirected to new OOS service</span><span style="font-family: "lucida console"; font-size: 9.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none; text-indent: .5in;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$Farm</span><span style="font-family: "lucida console"; font-size: 9.0pt;"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-SPFarm</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt;">$Farm</span><span style="font-family: "lucida console"; font-size: 9.0pt;">.</span><span style="font-family: "lucida console"; font-size: 9.0pt;">Properties<span style="color: darkgrey;">.</span>Add(<span style="color: darkred;">"WopiLegacySoapSupport"</span><span style="color: darkgrey;">,</span><span style="color: darkred;">"https://sp-oos.sharepoint.com/x/_vti_bin/ExcelServiceInternal.asmx"</span>);
<o:p></o:p></span></div>
<div class="separator" style="clear: both;">
<span style="color: orangered; font-family: "lucida console"; font-size: 9.0pt; line-height: 115%;">$Farm</span><span style="font-family: "lucida console"; font-size: 9.0pt; line-height: 115%;">.</span><span style="font-family: "lucida console"; font-size: 9.0pt; line-height: 115%;">Update(); </span></div>
<div class="separator" style="clear: both;">
<span style="font-size: 9pt; line-height: 115%;"><span style="font-family: "trebuchet ms" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both;">
<span style="font-size: 9pt; line-height: 115%;"><span style="background-color: white; color: #555555; font-size: 14px; text-align: justify;"><span style="font-family: "trebuchet ms" , sans-serif;">If the command worked, you will see a lot of Office specific properties being output on screen.</span></span></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: "lucida console"; font-size: 9.0pt; line-height: 115%;"><span style="background-color: #fafafa; color: #555555; font-family: "source sans pro" , "helvetica neue" , "helvetica" , "arial" , sans-serif; font-size: 14px; text-align: justify;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfe7r_iZBmNYznB-4DxT36itZxxbG_-HuFnEwrua5elQ7YEyAHqSxo-HBmTvH5bZ54X79DH1zIeqBz9aBrKltQ_mOmUk5wB1pLP0lfXdJJqUMj6SGYhuTSHfiGOqBvgAhiuAP4KF1TrLag/s1600/OOS+Setup+11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="448" data-original-width="834" height="171" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfe7r_iZBmNYznB-4DxT36itZxxbG_-HuFnEwrua5elQ7YEyAHqSxo-HBmTvH5bZ54X79DH1zIeqBz9aBrKltQ_mOmUk5wB1pLP0lfXdJJqUMj6SGYhuTSHfiGOqBvgAhiuAP4KF1TrLag/s320/OOS+Setup+11.jpg" width="320" /></a></div>
<div class="separator" style="clear: both;">
<span style="font-family: "lucida console"; font-size: 9.0pt; line-height: 115%;"><span style="background-color: #fafafa; color: #555555; font-family: "source sans pro" , "helvetica neue" , "helvetica" , "arial" , sans-serif; font-size: 14px; text-align: justify;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white; font-family: "trebuchet ms" , sans-serif;">13.<span style="color: #555555; font-size: 14px; text-align: justify;">We are now all set! , Now verify the OOS for office documents.</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="color: #555555; font-size: 14px; text-align: justify;"><span style="background-color: white; font-family: "trebuchet ms" , sans-serif;">14. In case the office documents are not showing in the browser/preview then see the logs.</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="color: #555555; font-size: 14px; text-align: justify;"><span style="background-color: white; font-family: "trebuchet ms" , sans-serif;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white; font-family: "trebuchet ms" , sans-serif;"><span style="color: #555555; font-size: 14px; text-align: justify;">Log Location for Office Online Server is : </span> C:\ProgramData\Microsoft\OfficeWebApps\Data\Logs\ULS</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<a href="https://www.blogger.com/null" name="_Toc489822598"><o:p></o:p></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_17" o:spid="_x0000_i1026" style="height: 48pt; mso-wrap-style: square; visibility: visible; width: 468pt;" type="#_x0000_t75">
<v:imagedata o:title="" src="file:///C:\Users\sai\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
</v:imagedata></v:shape><span style="font-family: "courier new"; font-size: 8.0pt;"><o:p></o:p></span></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com2tag:blogger.com,1999:blog-3138753744371217570.post-84278536851018393372017-07-05T22:24:00.000-07:002017-08-13T20:08:50.564-07:00Disable Mysite Provisioning in SharePoint using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: blue;"><b>Disable Mysite Provisioning in SharePoint using Powershell</b></span><br />
<br />
<div class="MsoNormal">
Add-PSSnapIn Microsoft.SharePoint.PowerShell -EA 0 </div>
<div class="MsoNormal">
function
DisableMySiteCreation([string]$UserProfileProxyName)</div>
<div class="MsoNormal">
{ </div>
<div class="MsoNormal">
$upaproxy =
Get-SPServiceApplicationProxy | Where-Object {$_.DisplayName -eq
$UserProfileProxyName}<br />
$upasecurity = Get-SPProfileServiceApplicationSecurity
-ProfileServiceApplicationProxy<br />
$upaproxy $authuser = New-SPClaimsPrincipal
-Identity 'c:0(.s|true' -IdentityType EncodedClaim $ntauthusers =
New-SPClaimsPrincipal -Identity 'c:0!.s|windows' -IdentityType EncodedClaim
$localAuthUsers = New-SPClaimsPrincipal "NT AUTHORITY\Authenticated
Users" - IdentityType WindowsSamAccountName Revoke-SPObjectSecurity
-Identity $upasecurity -Principal $authuser -Rights "Create Personal
Site" Revoke-SPObjectSecurity -Identity $upasecurity -Principal $authuser
-Rights "Use Personal Features" Revoke-SPObjectSecurity -Identity
$upasecurity -Principal $authuser -Rights "Use Social Features"
Revoke-SPObjectSecurity -Identity $upasecurity -Principal $ntauthusers -Rights
"Create Personal Site" Revoke-SPObjectSecurity -Identity $upasecurity
-Principal $ntauthusers -Rights "Use Personal Features"
Revoke-SPObjectSecurity -Identity $upasecurity -Principal $ntauthusers -Rights
"Use Social Features" Set-SPProfileServiceApplicationSecurity
-Identity $upasecurity - ProfileServiceApplicationProxy $upaproxy</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
DisableMySiteCreation "User Profile Service Application"</div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-32879990555273726462017-07-05T22:15:00.000-07:002017-07-05T22:15:20.573-07:00Create SharePoint Site Quote Template Using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="color: blue;">Create SharePoint Site Quote Template Using Powershell </span></b><br />
<br />
<div class="MsoNormal">
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction
SilentlyContinue</div>
<div class="MsoNormal">
function CreateQuotaTemplate ($QuotaName, $MaxLevelMB,
$WarnLevelMB)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
$quotaTemplate =
New-Object Microsoft.SharePoint.Administration.SPQuotaTemplate</div>
<div class="MsoNormal">
$quotaTemplate.Name =
$QuotaName</div>
<div class="MsoNormal">
$quotaTemplate.StorageMaximumLevel =
($MaxLevelMB*1024)*1024</div>
<div class="MsoNormal">
$quotaTemplate.StorageWarningLevel =
($WarnLevelMB*1024)*1024</div>
<div class="MsoNormal">
$contentService =</div>
<div class="MsoNormal">
[Microsoft.SharePoint.Administration.SPWebService]::ContentService</div>
<div class="MsoNormal">
$contentService.QuotaTemplates.Add($quotaTemplate)</div>
<div class="MsoNormal">
$contentService.Update()</div>
<div class="MsoNormal">
Write-Host "New
Quota Template: $($QuotaName) has been added!"</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
CreateQuotaTemplate
–QuotaName "10GB_Quota" –MaxLevelMB 10000 –WarnLevelMB 9500</div>
<div class="MsoNormal">
CreateQuotaTemplate
–QuotaName "25GB_Quota" –MaxLevelMB 25000 –WarnLevelMB 20000</div>
<div class="MsoNormal">
CreateQuotaTemplate
–QuotaName "50GB_Quota" –MaxLevelMB 50000 –WarnLevelMB 45000</div>
<div class="MsoNormal">
CreateQuotaTemplate
–QuotaName "100GB_Quota" –MaxLevelMB 100000 –WarnLevelMB 95000</div>
<div class="MsoNormal">
CreateQuotaTemplate
–QuotaName " Personal Site 500MB_Quota" –MaxLevelMB 500 –</div>
<br />
<div class="MsoNormal">
WarnLevelMB 400</div>
</div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-44317847694364216452017-07-04T13:49:00.000-07:002017-07-04T13:49:45.919-07:00Get SharePoint List Items Using REST<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
1. Create List and items similar to below. In my case list name is Site Links.<br />
2. Download latest jquery.js bootstrap.js and bootstrap.css<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD23h34xfjUhy4URgTOepDg5rcfG2WmYYTNGkCKenqv3zb_wAfpLReN06UA0OgKt3MGYe2x9-VI4E4hSlkA5yFiBKz9NLRBa_x7WCzTTNNWiFNTs7GVePaJgmGvnU2mVQ7HuBcD_6nU5Hc/s1600/Links.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="50" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD23h34xfjUhy4URgTOepDg5rcfG2WmYYTNGkCKenqv3zb_wAfpLReN06UA0OgKt3MGYe2x9-VI4E4hSlkA5yFiBKz9NLRBa_x7WCzTTNNWiFNTs7GVePaJgmGvnU2mVQ7HuBcD_6nU5Hc/s320/Links.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh0czyPma1oAsja4innWL4m3LxVl6Spo0H-7GZ6FWmLpSFL1MSdve6SCE4TCJMVs5SaQPwU5cxqMe0GGeCGbooq4S417Y9oG5xw0zJMLFvbmTnAEe2SL4aEPNcF0piTosglF035VBh1NoV/s1600/SiteLinks.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh0czyPma1oAsja4innWL4m3LxVl6Spo0H-7GZ6FWmLpSFL1MSdve6SCE4TCJMVs5SaQPwU5cxqMe0GGeCGbooq4S417Y9oG5xw0zJMLFvbmTnAEe2SL4aEPNcF0piTosglF035VBh1NoV/s320/SiteLinks.jpg" width="320" /></a></div>
<br />
<br />
<br />
<div class="col-xs-12 siteLinksDiv siteLinksDivAlone" style="height: 254px;"><br />
<div class="row"><br />
<div class="col-xs-12"><br />
<h4>Site Links <span style="width:40%;display: block;margin-top: 10px;" class="customBordered_h3 displayBlock"></span></h4><br />
<ul id="sitelinks" class="paddingLeftZero"><br />
<br />
</ul><br />
</div><br />
</div><br />
</div><br />
<br />
<br />
<script><br />
<br />
var siteurl = _spPageContextInfo.webAbsoluteUrl;<br />
$.ajax({<br />
url: siteurl + "/_api/web/lists/getbytitle('Site Links')/items",<br />
method: "GET",<br />
headers: { "Accept": "application/json; odata=verbose" },<br />
success: function (data) {<br />
if (data.d.results.length > 0 ) {<br />
var markupQL='';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> for(var i=0;i<data.d.results.length;i++)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> var lnkUrlQL1 = data.d.results[i].LinkLocation;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> var lnkUrlQL = data.d.results[i].LinkLocation.Url;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> var titleQL = data.d.results[i].LinkLocation.Description;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>markupQL += '<li><a target="_blank" href="'+lnkUrlQL+'">'+ titleQL + '</a></li>'; <br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> }<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$("#sitelinks").html(markupQL);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
} <br />
},<br />
error: function (data) {<br />
alert("Error: "+ data);<br />
}<br />
});<br />
<br />
</script><br />
<br /></div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0tag:blogger.com,1999:blog-3138753744371217570.post-51824680354997269822016-10-21T15:10:00.007-07:002016-10-21T15:10:45.600-07:00Copy the value of one column to another column in the same SharePoint List using Powershell script<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="color: #666666; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">Powershell Script to Copy the value of one column to another column in the same SharePoint List .</span></b><br />
<b><span style="color: #666666; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><br /></span></b>
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><b><br /></b></span>
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$site = new-object Microsoft.SharePoint.SPSite("<b>http://localhst</b>")</span><br />
<span style="color: blue;"><span style="font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$web = Get-SPWeb -Identity </span><span style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";"><b>http://localhst</b></span></span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$list =$web.Lists["<b>List/Library Name</b>"]</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$items = $list.items</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> foreach ($item in $items)</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> {</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> $sourcevalue = $item["<b>Column 1</b>"]</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> $item["<b>Column 2</b>"] = $sourcevalue</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> write-host $sourcevalue</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> $item.update()</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> }</span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"></span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$list.update()</span></div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com6tag:blogger.com,1999:blog-3138753744371217570.post-46058083524861026732016-10-21T15:06:00.004-07:002016-10-21T15:06:39.230-07:00Check-out all files in list or library in SharePoint using Powershell<div dir="ltr" style="text-align: left;" trbidi="on">
<b style="color: #666666; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px;">Powershell Script to Check-out all files/items in a specified list or library .</b><br />
<b style="color: #666666; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px;"><br /></b>
<span style="color: #666666; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><b><br /></b></span>
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$spWeb = Get-SPWeb http://localhost/ </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$listName = "<b>List/Library Name</b>" </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">$list = $spWeb.Lists |? {$_.Title -eq $listName} </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;">foreach ($item in $list.Items) </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> { </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> $itemFile = $item.File </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$itemFile.CheckOut();<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> </span><br />
<span style="color: blue; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"> } </span></div>
Venkathttp://www.blogger.com/profile/00461088524051319184noreply@blogger.com0