Skip to main content

Posts

Showing posts with the label Office 365

Get user's manager and insert into a column in SharePoint Online

Get user's manager name and insert into a list column for SharePoint Online We can use SharePoint2013 designer workflow/MS Flow to achieve it and also we can use REST API to get user's manager details. <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <script type="text/javascript"> GetCurrentUser(encodeURIComponent($.parseJSON($("[title='Owner'] input").val())[0].Key)); // function GetCurrentUser(loginName) { var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v=" + "'" + loginName + "'"; var requestHeaders = { "accept" : "application/json;odata=verbose" }; $.ajax({   url : requestUri,   method: "GET",   async:false,   headers : requestHeaders,   success : onSuccess...

Create a SharePoint Online Site - Office 365 using Powershell

Create a SharePoint  Online Site - Office 365 using Powershell # Usage #       .\create-site-csom.ps1 -siteTitle "new site2" -siteUrl "newsite2" -cred $false -parent "https://pravahaminfo.sharepoint.com/teams/appdev1/" # #       .\create-site-csom.ps1 -siteTitle "new site2" -siteUrl "newsite2" -cred $true -parent "https://pravahaminfo.sharepoint.com/teams/appdev1/" #               Will ask for Credentials Param(     [Parameter(Mandatory=$true)]  [string] $parent,  [Parameter(Mandatory=$true)]  [string] $siteTitle, [Parameter(Mandatory=$true)] [string] $siteUrl, [string] $siteDescription,     [string] $template = "STS#0",     [bool] $cred #Use custom Credentials ) #Clear-Host Write-Host "Initializing..." $resources = split-path $script:MyInvocation.MyCommand.Definition if(-not $(Test-Path "$resources\bin")) ...