Skip to main content

Posts

Power Platform Audit Scripts using PowerShell -All Environments

Get All Environments using PowerShell   Clear-Host $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition $environmentsFilePath = "$scriptPath\Environments.xlsx" $excel = New-Object -ComObject excel.application  $workbook = $excel.Workbooks.Add() $envs = Get-AdminPowerAppEnvironment $wksht= $workbook.Worksheets.Add()  $wksht.Name = 'Environments' $wksht.Cells.Item(1,1) = "EnvironmentName" $wksht.Cells.Item(1,2) = "DisplayName" $wksht.Cells.Item(1,3) = "UniqueName" $wksht.Cells.Item(1,4) = "EnvironmentType" $wksht.Cells.Item(1,5) = "CommonDataServiceDatabaseType" $wksht.Cells.Item(1,6) = "IsDefault" $wksht.Cells.Item(1,7) = "Location" $wksht.Cells.Item(1,8) = "AzureRegion" $wksht.Cells.Item(1,9) = "MetadataType" $wksht.Cells.Item(1,10) = "InternalCds" $wksht.Cells.Item(1,11) = "CreatedBy" $wksht.Cells.Item(1,12) = "CreatedTime" $wksht.Cel...

Power Platform Audit Scripts using PowerShell -All PowerApps

Get All Power Apps using PowerShell  Clear-Host Install-Module -Name Microsoft.PowerApps.Administration.PowerShell Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber  #Import-Module (Join-Path (Split-Path $script:MyInvocation.MyCommand.Path) "Microsoft.PowerApps.Administration.PowerShell.psm1") -Force Add-PowerAppsAccount $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition Set-Location -Path $scriptPath $AppRoleAssignmentsFilePath = ".\AppsDetails.csv" # Add the header to the app roles csv file $appRoleAssignmentsHeaders = "EnvironmentName," `         + "AppName," `         + "AppDisplayName," `         + "SharedUsers," `         + "SharedGroups," `         + "CreatedTime," `         + "LastModifiedTime," `         + "AppOwnerObjectId," `         + "AppOwnerDisplayName," `     ...

Power Platform Audit Scripts using PowerShell -All PowerApps Summary

 Get all Power Apps by Summary Clear-Host #Install-Module -Name Microsoft.PowerApps.Administration.PowerShell #Add-PowerAppsAccount $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition Set-Location -Path $scriptPath $AppRoleAssignmentsFilePath = ".\Apps.csv" try { Remove-Item $AppRoleAssignmentsFilePath } catch{} # Add the header to the app roles csv file $appRoleAssignmentsHeaders = "EnvironmentName," `         + "AppName," `         + "AppDisplayName," `         + "Description," `         + "AppType," `         + "UsesOnPremiseGateway," `         + "UsesPremiumApi," `         + "UsesCustomApi," `         + "SharedUsers," `         + "SharedGroups," `         + "SharedWithTenant," `         + "CreatedTime," `         + "LastModifi...

Power Platform Audit Scripts using PowerShell -All PowerApps By Owner

 Get All PowerApps By Owner Using PowerShell Clear-Host $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition Set-Location -Path $scriptPath #Add-PowerAppsAccount $users = Get-AdminPowerApp | Select –ExpandProperty Owner | Select –ExpandProperty displayname | Group | Sort-Object -Property @{Expression = "Count"; Descending = $True}  $appsByOwnerFilePath = "$scriptPath\AppsByOwner.csv" Remove-Item $appsByOwnerFilePath $appsByOwnerHeaders = "User,App Count"; Add-Content -Path $appsByOwnerFilePath -Value $appsByOwnerHeaders foreach ($user in $users) {     $name = $user.Name -replace ',',';'     Add-Content -Path $appsByOwnerFilePath -Value ($name + ',' + $user.Count) }

Power Platform Audit Scripts using PowerShell -Licenses

Get Power Platform Licenses using PowerShell C lear-Host Install-Module -Name Microsoft.PowerApps.Administration.PowerShell Add-PowerAppsAccount $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition $OutputFilePath = "$scriptPath\Licenses.csv" $TimeoutInMinutes = 2 $ApiVersion = "2016-11-01" $getLicensesUri = "https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/scopes/admin/exportServicePlans?api-version={apiVersion}"   $getLicensesResponse = InvokeApi -Method POST -Route $getLicensesUri -ApiVersion $ApiVersion -Verbose $false if ($getLicensesResponse.StatusCode -eq 202) {     $getLicensesUri = $getLicensesResponse.Headers['Location']     $currentTime = Get-Date -format HH:mm:ss     $nextTime = Get-Date -format HH:mm:ss     $TimeDiff = New-TimeSpan $currentTime $nextTime              #Wait until the operation complete, there is an error, or we hit a timeout     while...

How to find out Current Usage per user in One-drive using Powershell

Run the below power shell commands , it will give you the storage information and set storage quota. Get current usage per user in Onedrive Get-SPOSite  -IncludePersonalSite $true -Limit all  -Filter "url - like '-my-sharepoint.com/personal/'" | Select url, StorageUsageCurrent | Sort-Object StorageUsageCurrent  -Descending | Format-Table -wrap -Autosize Set Onedrive storage limit to 1TB (1024 GB) using powershell  Set-SPOTenant - OneDriveStorageQuira 1048576 Set Onedrive storage quota for specific user Set-SPOSite -Identity https://healthtest-my.sharepoint.com/personal/venkat_healthtest_onmicrosoft_com -StorageQuota 1024 Reset storage quota for specific user Set-SPOSite -Identity https://healthtest-my.sharepoint.com/personal/venkat_healthtest_onmicrosoft_com -StorageQuotaReset

How to export SharePoint list data to Excel using Flow(Power automate)

Daily export the SharePoint list items to excel format, send an email. Step 1 :Create SharePoint List and add items. What Is A SharePoint List? A SharePoint list is similar to an Excel Table, it’s a container for data. SharePoint lists allow you to store data in list format with rows and columns. 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. Step 2 : Go to flow  https://flow.microsoft.com/  and use your credentials to create a flow. Step 3 : Use " Recurrence " action to run flow on specific time for daily/weekly/monthly. Step 4 : Create a excel file in your desktop and insert table ,add columns then upload to SharePoint Document Library. Step 5 : Add " List rows present in a table " action in flow to identify your table. Step 6 : Insert " Apply to each " control to delete existing rec...

Resize Picture Slideshow Web part in SharePoint 2013 without resizing the original images

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. <script type="text/javascript"> function SlideshowObjectInitializer() {   ShowPic = (function(ShowPicOrig) {       return function() {            var ssObj = arguments[0];  //SlideShow object            var curPicIdx=ssObj.index; //current picture index            ShowPicOrig.apply(this, arguments); //call original ShowPic            //apply some changes to display original picture in SlideShow control            ssObj.image.src = ssObj.linkArray[curPicIdx]; ...

To update Created, Created By, Modified, Modified in SharePoint document library/list using Client Object Model -CSOM

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. <script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.min.js"></script> <script type="text/javascript"> // When the body is loaded, the onload event handler executes each function whose name is contained in this array. _spBodyOnLoadFunctionNames.push("callCSOM"); function callCSOM() {     $("#Button1").click(function()     {         // Make sure the SharePoint script file 'sp.js' is loaded before your code runs.         ExecuteOrDelayUntilScriptLoaded(updateUser, "sp.js");     });  } function updateUser() { var clientContext = new SP.ClientContext.get_current();   var web = clientContext.get_web();   var currentUser = web.ensureUser('User Name here');   clien...

Video Carousel In SharePoint

Play Multiple Videos Continuously in a SharePoint Page Please follow below steps to do, Step 1 : Create a "Assets" Media Library in SharePoint. Step 2 : Download " video-js.css" , " video.js" & " jquery-3.3.1.min.js" from Google Drive ( https://drive.google.com/open?id=1iMXZ_vVK6pWec4id7xwjSl35S29uPcud) Step 3 : Create a HTML file and update your HTML code(VideoCarousel.HTML) Step 4 : Add HTML file into SharePoint Page via Content Editor Webpart. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > <!DOCTYPE html > < html > < head > < link href = "https://PravahamInfo.sharepoint.com/sites/Home/Style Library/VideoCarousel/video-js.css" rel = "stylesheet" > <!-- If you'd like to support IE8 (for Video.js versions prior to v7) --> < script src = "https://PravahamInfo.sharep...