Tip: Connect various M365 PowerShell modules for a demo tenant.

Summary

This is a quick tip to connect to a demo tenant using one-time storing of the password (a secured string) to a file and calling the connect command as many times as you want to test for the demo tenant.

#Execute Read-Host once and comment out 
#Read-Host "Enter password" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\Temp\passwordNEW.txt"

$TenantName="CRM106438" # Change to your tenant name
$Username = $("admin@{0}.onmicrosoft.com" -f $TenantName)
$Password = cat "C:\Temp\passwordNEW.txt" | ConvertTo-SecureString
$Creds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username, $Password
Connect-MicrosoftTeams -Credential $Creds 
Connect-ExchangeOnline -Credential $Creds
Connect-SPOservice -url $("https://{0}-admin.sharepoint.com" -f $TenantName) -Credential $Creds
Connect-Msolservice -Credential $Creds 
Connect-AzureAD -Credential $Creds 

Posted in powershell | Leave a comment

How to download ‘ALL’ files from a very large document library?

Summary

My customer had a large document library on SharePoint Online with a deep folder structure. The total number of items is 2.7 million (2,743,321). They want those documents downloaded to the local folder. I know, this is an actual scenario and issue.

The issue was the time it took to download the script they wrote. The customer used that script it was working but it took a very long time. The performance was a huge issue. Additionally, machine resources were getting effected, and download happen sequentially and no parallel download.

This article is to show the proposed approach and working solution for the customer. The blog post is mainly with the scripts so no need to write anything. You will need to be knowledgeable on PowerShell and little MS Graph API technical skills.

An approach

  1. Not to use the PnP PowerShell Get-PnPListItem call. This will take forever to complete. It is a helpful command but not for this scenario.
  2. Use some other ways to get the file’s relative URLs using MS Graph API.
  3. Only get the ID and WebURL properties using MS Graph, as highlighted above.
  4. Store ID and WebURL properties in the CSV files in the batch of 100,000.
  5. Once all the CSV files are downloaded run another script (Phase-2 below).
  6. This script will import the CSV file and iterate over all web URL.
  7. Using the Web URL value, create a folder and download the file if not present. To download use the Get-PnPFile command.
  8. This is an important step, run the script in multiple PowerShell windows so the script downloads files in parallel.

Phase 1

In this phase 1, you will need a way to get the CSV files with ID and WebURL from DocLib. These CSV files will be with 100K rows. If you do the math there will be 28 CSV files for 2.7 million records. (Your numbers will be different based on your files).

To run the script below you will need the following:

Azure Function running on a Queue Trigger.

Storage with Azure Queue and Azure Blob.

Azure AD app with MS Graph API to have Sites Read access. (I used Full control)

You will need a driveID. I used the Graph PowerShell SDK to get it.

# Input bindings are passed in via param block.
param($QueueItem, $TriggerMetadata)

# Write out the queue message and insertion time to the information log.
Write-Host "PowerShell queue trigger function processed work item: $QueueItem"
Write-Host "Queue item insertion time: $($TriggerMetadata.InsertionTime)"


# Populate with the App Registration details and Tenant ID
$ClientId                = "TODO"
$ClientSecret            = "TODO" 
$queueName               = "TODO"
$containerName           = "TODO"  
$tenantid                = "TODO" 
$env:AzureWebJobsStorage = "TODO"
$env:LOG_FILE_PATH       = "C:\TEMP"
$GraphScopes             = "https://graph.microsoft.com/.default"
$driveID                 = "TODO" 
# To get drive id variable execute the following command
# $drives = Get-MgSiteListDrive -SiteId Your-SITE -ListId Your-LIST 
# You will need to connect to Graph. Follow this article.

# Get the access token to execute MS Graph calls.
$headers = @{
    "Content-Type" = "application/x-www-form-urlencoded"
}
# Formulate body with four parameters.
$body = "grant_type=client_credentials&client_id=$ClientId&client_secret=$ClientSecret&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default"
# Create login URL for the tenant id
$authUri = "https://login.microsoftonline.com/$tenantid/oauth2/v2.0/token"
# Make a POST call to Azure AD login URL
$response = Invoke-RestMethod $authUri  -Method 'POST' -Headers $headers -Body $body
# Using Token from the above call, create header with bearer token
$headers = @{
    "Content-Type" = "application/x-www-form-urlencoded"
    "Authorization" = $("Bearer {0}" -f $response.access_token)
}
#Function to move local file to blob storage
function MoveLogFilesToBlobContainer
{
    $storageContainer = New-AzStorageContext -ConnectionString $env:AzureWebJobsStorage | Get-AzStorageContainer  -Name $containerName
    #Write-Output $storageContainer
    Get-ChildItem $env:LOG_FILE_PATH -Filter ListOfIDs*.csv | 
    Foreach-Object {
        $blobNameWithFolder = $("{0}" -f $_.Name)
        Write-Output $("Move {0} to {1} Blob Container AS BlobName {2}." -f $_.FullName, $storageContainer.Name, $blobNameWithFolder)
        Set-AzStorageBlobContent -File $_.FullName `
            -Container $storageContainer.Name `
            -Blob $blobNameWithFolder `
            -Context $storageContainer.Context -Force
        Remove-Item -Path $_.FullName -Force
    }
}
#Function to put a message in a queue
function Put2MsgInQueue([Int]$aCounter,[String]$anUrl2Process)
{
    $FormattedMessage = $("{0},{1}" -f $aCounter,  $anUrl2Process )
    Write-Host $FormattedMessage
    $context = New-AzStorageContext -ConnectionString $env:AzureWebJobsStorage
    $queue = Get-AzStorageQueue -Name $queueName -Context $context
    # Create a new message using a constructor of the CloudQueueMessage class
    $queueMessage = [Microsoft.Azure.Storage.Queue.CloudQueueMessage]::new($FormattedMessage)
    # Add a new message to the queue
    $queue.CloudQueue.AddMessageAsync($QueueMessage)
}

function ScrapTheListItems([String]$aRestURI, [int]$batchNumber)
{
    $StopWatch = [System.Diagnostics.Stopwatch]::StartNew()
    $restURI = $aRestURI
    Write-Output $("restURI {0}" -f $restURI);
    # 200 * 500 = 100,000 rows in file.
    # 200 rows per API call
    $batchCountSize           = 2 #500
    #initialize the index and array to start
    $batchIndex               = 1
    $outArray = @()
    # MAKE a call to MS GRAPH API using the bearer token header
    $response = Invoke-RestMethod $restURI  -Method 'GET' -Headers $headers
    Write-Output $("response {0}" -f $response);
    # Get the next link URL.
    $restURI = $response."@odata.nextLink"
    while ($null -ne $restURI)
    {
        # Convert an array with Name & Value pair to an object array.
        # This is needed so the object array can be stored as CSV
        foreach ( $i in $response.value)
        {
            $anObj = New-Object PSObject
            Add-Member -InputObject $anObj -MemberType NoteProperty -Name 'id' -Value $i.Id
            Add-Member -InputObject $anObj -MemberType NoteProperty -Name 'webUrl' -Value $i.webUrl
            $outArray += $anObj
        }

        $totalRows = $batchIndex * 200

        Write-Output $("batchIndex : {0}, call to graph API for 200 rows now total is  {1}" -f $batchIndex, $totalRows );

        if ( $batchIndex -eq $batchCountSize)
        {
            $exportCsvURLPath          = $("{0}\ListOfIDs-{1}.csv" -f $env:LOG_FILE_PATH, $batchNumber )
            Write-Output $("Create {0}" -f $exportCsvURLPath);
            # create a message in the Queue to start a new func app to process 1000 urls.
            $outArray | Export-Csv -Path "$exportCsvURLPath" -NoTypeInformation -Force
            ## MOVE TO BLOB CONTAINER
            MoveLogFilesToBlobContainer
            #initialize the index and array to start
            $batchIndex               = 1
            $outArray = @()
            # add file batch number to next 
            $batchNumber++
            ###NOW EXIT FROM LOOP
            break
        }
        else
        {
            $batchIndex++
        }
        # MAKE a call to MS GRAPH API using the bearer token header
        $response = Invoke-RestMethod $restURI  -Method 'GET' -Headers $headers
        # Get the next link URL.
        $restURI = $response."@odata.nextLink"
    }

    # The last remaining batch may be less than the batch count size
    if (($batchIndex -gt 1) -or ($outArray.Count -gt 0))
    {
            $exportCsvURLPath          = $("{0}\ListOfIDs-{1}.csv" -f $env:LOG_FILE_PATH, $batchNumber )
            Write-Output $("Create {0}" -f $exportCsvURLPath);
            # Create a message in the Queue to start a new Function App.
            $outArray | Export-Csv -Path "$exportCsvURLPath" -NoTypeInformation -Force
            ## MOVE the CSV file TO the BLOB CONTAINER
            MoveLogFilesToBlobContainer
    }
    if ($null -ne $restURI)
    {
        Put2MsgInQueue -aCounter $batchNumber -anUrl2Process $restURI
    }
    $StopWatch.Stop()
    Write-Output $("Elapsed time in TotalMinutes: {0}" -f $StopWatch.Elapsed.TotalMinutes);
}

# To start this Function add a manual queue message as "START"
if ("START" -eq $QueueItem)
{
    Write-Host "we are running first time"
    $counter = 1
    # For first time we need to make a call to MS Graph API
    $firstURI = $("https://graph.microsoft.com/v1.0/drives/$driveID/list/items?{0}" -f '$Select=Id%2CWebUrl') 
    ScrapTheListItems $firstURI  $counter
}
else
{
    # Function will always fall here with the index#, URL to fetch
    $splittedArray = $QueueItem.split(",")
    $counter = [int]$splittedArray[0]
    ScrapTheListItems $splittedArray[1] $counter
}

Phase 2

In Phase 2, the script is to download the file. It does the following steps.

Read the CSV File with the passed-in batch number. e.g. 1, 2, 3…,274. the files are assumed to in the blob storage. If you want to point to a local folder, you may need to change the code.

Read all 100k records. Using the Web URL check for the local folder presence and file presence.

If not present, create a folder and dump the file using Get-PnPFile command.

Run the following in multiple PowerShell prompt so the files are downloaded in parallel. Even if you run twice with the same batch number parameter the script will figure out and not download the file if downloaded already before.


# Input bindings are passed in via param block.
param($batchNumber)

### TODO REMOVE LATER ONLY FOR DEBUGGING
$MaxFiles2Get                   = 10000
$CurrentFileNumber              = 0
#Initialize variables
$DownloadLocation               = "V:\Verification Documents"
$SiteURL                        = "https://Contoso.sharepoint.com/sites/LegalDept"
$CSVFilesPath                   = "C:\LegalDept"
$OrechestratorCSVFileName       = "0-Orchestrator.csv"
$env:LOG_FILE_PATH              = "C:\LegalDept\Logs"
$global:TotalFilesAlreadyPresent       = 0
$global:TotalFilesDownloaded           = 0
$global:ConnectPnPDoneFlag             = $false

Add-Type -AssemblyName System.Web

function Write-Log
{
    [CmdletBinding()]
    Param
    (
        [Parameter(Mandatory=$true,
                   ValueFromPipelineByPropertyName=$true)]
        [ValidateNotNullOrEmpty()]
        [Alias("LogContent")]
        [string]$Message,

        [Parameter(Mandatory=$false)]
        [Alias('LogPath')]
        [string]$Path='C:\Logs\PowerShellLog.log',
        
        [Parameter(Mandatory=$false)]
        [ValidateSet("Error","Warn","Info")]
        [string]$Level="Info",
        
        [Parameter(Mandatory=$false)]
        [switch]$NoClobber
    )

    Begin
    {
        # Set VerbosePreference to Continue so that verbose messages are displayed.
        $VerbosePreference = 'Continue'
    }
    Process
    {
        
        # If the file already exists and NoClobber was specified, do not write to the log.
        if ((Test-Path $Path) -AND $NoClobber) {
            Write-Error "Log file $Path already exists, and you specified NoClobber. Either delete the file or specify a different name."
            Return
            }

        # If attempting to write to a log file in a folder/path that doesn't exist create the file including the path.
        elseif (!(Test-Path $Path)) {
            Write-Verbose "Creating $Path."
            New-Item $Path -Force -ItemType File
            }

        else {
            # Nothing to see here yet.
            }

        # Format Date for our Log File
        $FormattedDate = Get-Date -Format "yyyy-MM-dd HH:mm:ss"

        # Write message to error, warning, or verbose pipeline and specify $LevelText
        switch ($Level) {
            'Error' {
                Write-Error $Message
                $LevelText = 'ERROR:'
                }
            'Warn' {
                Write-Warning $Message
                $LevelText = 'WARNING:'
                }
            'Info' {
                Write-Verbose $Message
                $LevelText = 'INFO:'
                }
            }
        
        # Write log entry to $Path
        "$FormattedDate $LevelText $Message" | Out-File -FilePath $Path -Append
        ## also dump to console
        #$savedColor = $host.UI.RawUI.ForegroundColor 
        #$host.UI.RawUI.ForegroundColor = "DarkGreen"
        Write-Output  $message 
        #$host.UI.RawUI.ForegroundColor = $savedColor
    }
    End
    {
    }
}

function WriteExceptionInformation($AnItem)
{
    Write-Log -Path $LogFileName  $AnItem.Exception.Message
    Write-Log -Path $LogFileName  $AnItem.Exception.StackTrace    
    <#        
    Write-Log -Path $LogFileName  $AnItem.Exception.ScriptStackTrace
    Write-Log -Path $LogFileName  $AnItem.InvocationInfo | Format-List *
    #> 
}

function UpdateOrchestratorInouFile()
{
    param (
        [string]$Status2update
    )
    $csvfile = Import-CSV -Path $("{0}\{1}" -f $CSVFilesPath, $OrechestratorCSVFileName)

    if ( $null -ne $csvfile)
    {
        $outArray = @()
        foreach ( $aRowInFile in $csvfile)
        {
            $anObj = New-Object PSObject
            Add-Member -InputObject $anObj -MemberType NoteProperty -Name 'BatchNumber' -Value $aRowInFile.BatchNumber
            if ($aRowInFile.BatchNumber -eq $batchNumber)
            {
                # Change status to Status2update
                Add-Member -InputObject $anObj -MemberType NoteProperty -Name 'Status' -Value $Status2update
            }
            else {
                <# Action when all if and elseif conditions are false #>
                # Keep the status as is
                Add-Member -InputObject $anObj -MemberType NoteProperty -Name 'Status' -Value $aRowInFile.Status
            }
            $outArray += $anObj
        }
        # Important step modify the file.
        $outArray | Export-Csv -Path $("{0}\{1}" -f $CSVFilesPath, $OrechestratorCSVFileName) -NoTypeInformation -Force
    }
}


function MainWorkerFunc 
{

    $didFailStatusHappen = $false
    $importCsvURLPath          = $("ListOfIDs-{0}.csv" -f $batchNumber )
    $csvfile = Import-CSV -Path $("{0}\{1}" -f $CSVFilesPath, $importCsvURLPath)
    if ( $null -ne $csvfile)
    {
        UpdateOrchestratorInouFile -Status2update "INPROGESS"

        try {


            # sample https://Contoso.sharepoint.com/sites/LegalDept/Verification%20Documents/Documents/FirtnameLastname0877_115502.pdf
            foreach ( $aRowInFile in $csvfile)
            {
                $webUrl2work = $aRowInFile.webUrl
                if ( $null -ne $webUrl2work)
                {
                    # remove the URL decoding from web url
                    $decodedWebUrl2work = [System.Web.HttpUtility]::UrlDecode($webUrl2work) 
                    $fileName = Split-Path -Path $decodedWebUrl2work -Leaf 
                    $splitArr = $decodedWebUrl2work.split('/')             
                    $filePath = $DownloadLocation
                    # now build a local path
                    $idx = 0;
                    foreach ( $valInArr in $splitArr)
                    {
                        # skip all four indices 0,1,2,3,4,5
                        if ( $idx -ge 6)
                        {
                            # skip the file name
                            if ( $fileName -ne $valInArr)
                            {
                                # append the path to the existing
                                $filePath = $("{0}\{1}" -f $filePath, $valInArr)
                            }
                        }
                        $idx++
                    }
                    #Ensure All Folders in the Local Path
                    $LocalFolder = $filePath
                    #Create Local Folder, if it doesn't exist
                    If (!(Test-Path -Path $LocalFolder)) 
                    {
                        New-Item -ItemType Directory -Path $LocalFolder | Out-Null
                    }
                    #Download file , if it doesn't exist
                    If (!(Test-Path -LiteralPath $("{0}\{1}" -f $filePath, $fileName))) 
                    {
                        try
                        {
                            if ( $global:ConnectPnPDoneFlag -eq $false )
                            {
                                Write-Log -Path $LogFileName  $("Connecting to {0}" -f $SiteURL);
                                Connect-PnPOnline $SiteURL -ClientId "TODO" -ClientSecret "*****"
                                Write-Log -Path $LogFileName  $("Connected  to {0}" -f $SiteURL);
                                # since we are connected make this flag true
                                $global:ConnectPnPDoneFlag = $true
                            }
                            # string the host from the URL
                            # https://Contoso.sharepoint.com/sites/LegalDept/Verification%20Documents/Documents/FirtnameLastname0877_115502.pdf
                            # should be /sites/LegalDept/Verification%20Documents/Documents/FirtnameLastname0877_115502.pdf
                            $relativeFileURL = ([uri]$webUrl2work).LocalPath
                            Write-Log -Path $LogFileName  $("Download file from {0}." -f $relativeFileURL);
                            Get-PnPFile -Url $relativeFileURL -Path $filePath -FileName "$fileName" -AsFile
                            Write-Log -Path $LogFileName  $("to {0}\{1}." -f $filePath,$fileName);
                            $global:TotalFilesDownloaded += 1
                        }
                        catch
                        {
                            WriteExceptionInformation ( $PSItem )
                            UpdateOrchestratorInouFile -Status2update "FAILED"
                            $didFailStatusHappen = $true
                            ### STOP everything if the error occured
                            break
                        }
                    }
                    else
                    {
                        $global:TotalFilesAlreadyPresent += 1
                        Write-Log -Path $LogFileName  $("File {0}\{1} already downloded." -f $filePath,$fileName);
                    }
                    $CurrentFileNumber += 1
                    Write-Log -Path $LogFileName  $("CurrentFileNumber {0}" -f $CurrentFileNumber);
                    # TODO REMOVE LATER
                    if ( $CurrentFileNumber -eq $MaxFiles2Get)
                    {
                        break
                    }
                }
            }
        }
        catch {
            WriteExceptionInformation ( $PSItem )
            UpdateOrchestratorInouFile -Status2update "FAILED"
            $didFailStatusHappen = $true
            ### STOP everything if the error occured
            break
        }
        finally {
            <#Do this after the try block regardless of whether an exception occurred or not#>
            ##### 
            #Update complete only if fail did not happen before.
            if ( $true -ne $didFailStatusHappen )
            {
                UpdateOrchestratorInouFile -Status2update "COMPLETE"
        
            }
        }

    }
}

$StopWatch = [System.Diagnostics.Stopwatch]::StartNew()
$LogFileName = $("{0}\Batch-{1:d2}-Log-{2}.txt" -f $env:LOG_FILE_PATH , $batchNumber, (Get-Date -Format "yyyy-MM-dd-HH-mm-ss"))
Write-Log -Path $LogFileName " *************************************** Start  *************************************** "

#Change Window Title
$Host.UI.RawUI.WindowTitle = $("Batch number {0}." -f $batchNumber);

MainWorkerFunc # CALL THE MAIN WORKER FUNCTION
$StopWatch.Stop()
Write-Log -Path $LogFileName " ------------------------------------------------------------------------------------- "
Write-Log -Path $LogFileName  $("Batch number {0}." -f $batchNumber);
Write-Log -Path $LogFileName  $("Total files already found present: {0}" -f $global:TotalFilesAlreadyPresent);
Write-Log -Path $LogFileName  $("Total files downloaded: {0}" -f $global:TotalFilesDownloaded);
$StopWatch.Stop()
Write-Log -Path $LogFileName  $("Elapsed time in TotalMinutes: {0}" -f $StopWatch.Elapsed.TotalMinutes);
Write-Log -Path $LogFileName " ------------------------------------------------------------------------------------- "
Write-Log -Path $LogFileName " ***************************************  End   *************************************** "

Orchestrator PowerShell Script



#Initialize variables
$CSVFilesPath                   = "C:\LegalDept"
$OrechestratorCSVFileName       = "0-Orchestrator.csv"
$env:LOG_FILE_PATH              = "C:\LegalDept\Logs"

function WriteExceptionInformation($AnItem)
{
    Write-Log -Path $LogFileName  $AnItem.Exception.Message
    Write-Log -Path $LogFileName  $AnItem.Exception.StackTrace            
    Write-Log -Path $LogFileName  $AnItem.Exception.ScriptStackTrace
    Write-Log -Path $LogFileName  $AnItem.InvocationInfo | Format-List * 
}

function Write-Log
{

    [CmdletBinding()]
    Param
    (
        [Parameter(Mandatory=$true,
                   ValueFromPipelineByPropertyName=$true)]
        [ValidateNotNullOrEmpty()]
        [Alias("LogContent")]
        [string]$Message,

        [Parameter(Mandatory=$false)]
        [Alias('LogPath')]
        [string]$Path='C:\Logs\PowerShellLog.log',
        
        [Parameter(Mandatory=$false)]
        [ValidateSet("Error","Warn","Info")]
        [string]$Level="Info",
        
        [Parameter(Mandatory=$false)]
        [switch]$NoClobber
    )

    Begin
    {
        # Set VerbosePreference to Continue so that verbose messages are displayed.
        $VerbosePreference = 'Continue'
    }
    Process
    {
        
        # If the file already exists and NoClobber was specified, do not write to the log.
        if ((Test-Path $Path) -AND $NoClobber) {
            Write-Error "Log file $Path already exists, and you specified NoClobber. Either delete the file or specify a different name."
            Return
            }

        # If attempting to write to a log file in a folder/path that doesn't exist create the file including the path.
        elseif (!(Test-Path $Path)) {
            Write-Verbose "Creating $Path."
            New-Item $Path -Force -ItemType File
            }

        else {
            # Nothing to see here yet.
            }

        # Format Date for our Log File
        $FormattedDate = Get-Date -Format "yyyy-MM-dd HH:mm:ss"

        # Write message to error, warning, or verbose pipeline and specify $LevelText
        switch ($Level) {
            'Error' {
                Write-Error $Message
                $LevelText = 'ERROR:'
                }
            'Warn' {
                Write-Warning $Message
                $LevelText = 'WARNING:'
                }
            'Info' {
                Write-Verbose $Message
                $LevelText = 'INFO:'
                }
            }
        
        # Write log entry to $Path
        "$FormattedDate $LevelText $Message" | Out-File -FilePath $Path -Append
        ## also dump to console
        #$savedColor = $host.UI.RawUI.ForegroundColor 
        #$host.UI.RawUI.ForegroundColor = "DarkGreen"
        Write-Output  $message 
        #$host.UI.RawUI.ForegroundColor = $savedColor
    }
    End
    {
    }
}


function MainOrchestratorFunc {
    $csvfile = Import-CSV -Path $("{0}\{1}" -f $CSVFilesPath, $OrechestratorCSVFileName)

    if ( $null -ne $csvfile)
    {
        foreach ( $aRowInFile in $csvfile)
        {
            Write-Log -Path $LogFileName $("Batch number {0:d2} has Status {1}" -f $aRowInFile.BatchNumber, $aRowInFile.Status ) 
            switch ($aRowInFile.Status.ToUpper())
            {
                "NEW"
                {
                    Write-Log -Path $LogFileName $("Batch number {0:d2} has '{1}' Status. Spawn this batch and change status to InProgress." -f $aRowInFile.BatchNumber, $aRowInFile.Status )
                    # spawm the file with the batch number
                    SpawnThePowerShellProcess -batchnumber2Process $aRowInFile.BatchNumber
                }
                "INPROGRESS"
                {
                    Write-Log -Path $LogFileName $("Batch number {0:d2} has '{1}' Status. Do nothing." -f $aRowInFile.BatchNumber, $aRowInFile.Status ) 
                }
                "FAILED"
                {
                    Write-Log -Path $LogFileName $("Batch number {0:d2} has '{1}' Status. Spawn this batch and change status to InProgress." -f $aRowInFile.BatchNumber, $aRowInFile.Status ) 
                    SpawnThePowerShellProcess -batchnumber2Process $aRowInFile.BatchNumber
                }
                "COMPLETE"
                {
                    Write-Log -Path $LogFileName $("Batch number {0:d2} has '{1}' Status. Do nothing." -f $aRowInFile.BatchNumber, $aRowInFile.Status ) 
                }
                default
                    {
                        Write-Log -Path $LogFileName $("Batch number {0:d2} has and INVALID Status {1}" -f $aRowInFile.BatchNumber, $aRowInFile.Status ) 
                    }
            }
        }
    }
}
function SpawnThePowerShellProcess {
    param (
        [int]$batchnumber2Process
    )
    $processOptions = @{
        FilePath = "PowerShell" 
        WorkingDirectory = "C:\scripts"
        ArgumentList = "C:\scripts\DownloadFiles.ps1 -batchNumber $batchnumber2Process" 
    }
    Start-Process @processOptions -Verb RunAs -WindowStyle Normal
}

$StopWatch = [System.Diagnostics.Stopwatch]::StartNew()
$LogFileName = $("{0}\Orchestrator-Log-{1}.txt" -f $env:LOG_FILE_PATH , (Get-Date -Format "yyyy-MM-dd-HH-mm-ss"))
Write-Log -Path $LogFileName " *************************************** Start  *************************************** "
MainOrchestratorFunc # CALL THE MAIN ORCHESTRATOR FUNCTION
$StopWatch.Stop()
Write-Log -Path $LogFileName " ------------------------------------------------------------------------------------- "
Write-Log -Path $LogFileName  $("Elapsed time in TotalMinutes: {0}" -f $StopWatch.Elapsed.TotalMinutes);
Write-Log -Path $LogFileName " ------------------------------------------------------------------------------------- "
Write-Log -Path $LogFileName " ***************************************  End   *************************************** "

The Orchestrator CSV file

Status field is caseinsentive
Status New means new
1,New
Status InProgress means the batch is currently running
1,InProgress
Status Failed means the batch failed needs to run again
1,Failed
Status Complete means the batch is complete DO NOT run
1,Complete

"BatchNumber","Status"
"1","COMPLETE"
"2","NEW"
"3","COMPLETE"
"4","INPROGRESS"
"5","COMPLETE"
"6","COMPLETE"
"7","INPROGRESS"
"8","COMPLETE"
"9","FAILED"
"10","COMPLETE"

Conclusion

The script and instructions are rough, but they should be helpful if you are a developer.

The customer used the code from here. The code works but for the large doc lib they noticed issues mentioned in the summary,

This article would help you to download the files in multiple threads. The above script in phase 2 could run again pick up where it left from in case of failure. The script will skip the files already downloaded to the local folder.

Posted in MS Graph, PnP.PowerShell, SharePoint, SharePoint 2013, Technical Stuff | Leave a comment

How to use AAD Access Token in Connect-MgGraph?

Summary

The Microsoft Graph PowerShell SDK is a great and simpler ways to get MS Graph API PowerShell code working quickly. But what I have found the source code and example to utilize the X509 certificate ways of authentication. For doing a quick demo with the Azure AD security token there a simple way which I will describe here in this post.

Script example

The tip is very simple. Since Connect-MgGraph does not have Client Secret parameter, use the Invoke-RestMethod to get the access token. Once valid token is received pass it to the Connect-MgGraph and make the rest of the other MS Graph SDK calls after that.

See in the following example I have used the Get-MgGroup call after successfully connecting to MS Graph.

# The following command only required one time execution
if ( Get-ExecutionPolicy)
{
    Write-Host "RemoteSigned policy exists."
}
else
{
    Write-Host "RemoteSigned policy does not exist."
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
}

if (Get-Module -ListAvailable -Name Microsoft.Graph) {
    Write-Host "Microsoft.Graph Module exists"
} 
else {
    Write-Host "Microsoft.Graph Module does not exist"
    Install-Module Microsoft.Graph -Scope AllUsers
}

# Populate with the App Registration details and Tenant ID
$ClientId          = "TODO"
$ClientSecret      = "TODO" 
$tenantid          = "TODO" 
$GraphScopes       = "https://graph.microsoft.com/.default"


$headers = @{
    "Content-Type" = "application/x-www-form-urlencoded"
}

$body = "grant_type=client_credentials&client_id=$ClientId&client_secret=$ClientSecret&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default"
$authUri = "https://login.microsoftonline.com/$tenantid/oauth2/v2.0/token"
$response = Invoke-RestMethod $authUri  -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
 
$token = $response.access_token
 
# Authenticate to the Microsoft Graph
Connect-MgGraph -AccessToken $token

# If you want to see debugging output of the command just add "-Debug" to the call.
Get-MgGroup -Top 10

Conclusion

I hope this helps you. I use this technique to quickly check / test the calls to the MS Graph.

Note: Please make sure your Azure AD app has required permission applied and consented or else you would get “Insufficient privileges to complete the operation.” error.

Also use the MS Graph explorer as UI ways to test your API and check required permission.

https://aka.ms/GE

PS C:\WINDOWS\system32> Get-MgUser -Top 10
Get-MgUser : Insufficient privileges to complete the operation.
At line:1 char:1
+ Get-MgUser -Top 10
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ ConsistencyLe...ndProperty =  }:<>f__AnonymousType59`9) [Get-MgUser_List1], RestException`1
    + FullyQualifiedErrorId : Authorization_RequestDenied,Microsoft.Graph.PowerShell.Cmdlets.GetMgUser_List1

PS C:\WINDOWS\system32> 
Posted in MS Graph, Technical Stuff | Leave a comment

How to get all sites from the tenant using MS Graph API?

Summary

The PnP PowerShell command Get-PnPTenantSite to get all sites from the tenant takes longer time. Additionally, it does not have asynchronous ways to get the information in the Azure Durable Function.

This article uses the MS Graph API List Sites to get the sites. To use this API the following Application API permissions required for the Azure AD app.

Sites.Read.All, Sites.ReadWrite.All

Script

$StartMs = (Get-Date).Millisecond

# You will need Azure AD app with the following API permissions.
# Application	Sites.Read.All
#
$ClientId          = "TODO"
$ClientSecret      = "TODO"
$tenantid          = "TODO"
$path2File         = 'C:\temp\test.txt' # Change this as you like.

## Get Auth Token ## 
$headersAuth = @{
    "Content-Type" = "application/x-www-form-urlencoded"
    'Accept' = '*/*'
}
$body = $("grant_type=client_credentials&client_id={0}&client_secret={1}&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default" -f $ClientId, $ClientSecret)
$outhTokenUrl = $("https://login.microsoftonline.com/{0}/oauth2/v2.0/token" -f $tenantid)
$response = Invoke-RestMethod $outhTokenUrl -Method 'POST' -Headers $headersAuth -Body $body
$response | ConvertTo-Json
$tokenExpiryTime = (get-date).AddSeconds($response.expires_in)
##
## Make the first call with $filer to your tenant name ##
##
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("SdkVersion", "postman-graph/v1.0")
$headers.Add("Prefer", "apiversion=2.1")
$headers.Add("Authorization", $("Bearer {0}" -f $response.access_token) )
$response = Invoke-RestMethod 'https://graph.microsoft.com/v1.0/sites?$filter=siteCollection/hostname eq ''{CHANGE TO YOUR TENANT NAME}.sharepoint.com''' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
## Check if there are more sites to fetch...
while ( $response.'@odata.nextLink' -ne $null )
{
    ## iterate on the response and write the site url to the file.
    foreach ( $val in $response.Value )
    {
        Write-Output $("{0}" -f $val.webUrl)
        Add-Content -Path $path2File -Value $val.webUrl
    }
    # check if the token expired, if it did get a new one.
    if ( (get-date) -gt  $tokenExpiryTime )
    {
        $response = Invoke-RestMethod "https://login.microsoftonline.com/$($tenantid)/oauth2/v2.0/token" -Method 'POST' -Headers $headers -Body $body
        $response | ConvertTo-Json

        $tokenExpiryTime = (get-date).AddSeconds($response.expires_in)

        # modify header with the new token
        $headers = @{
            "Content-Type" = "application/json"
            "Authorization" = $("Bearer {0}" -f $response.access_token) 
        }
    }

    # first store the data of Web URL to the file.

    $response = Invoke-RestMethod $response.'@odata.nextLink' -Method 'GET' -Headers $headers
    $response | ConvertTo-Json 

}
$EndMs = (Get-Date).Millisecond
WriteHost "This script took $($EndMs - $StartMs) milliseconds to run."

Conclusion

Using MS Graph API you can overcome to get the list of all sites within your tenant. This can be done using the Get-PnPTenantSite but it has overheads if you just want the site urls of all sites.

Posted in MS Graph, SharePoint | Leave a comment

How to hide welcome message for an empty SharePoint List?

Summary

Create a new custom list, you will notice this new list will have the following message as shown below.

An image.. + “Welcome to your new list” + “Select the New button to get started”

The custom welcome message for the empty list.

This post should help you to hide the welcome message.

Step By Step Solution

Step # 1: Create a column hideWelcome Yes/No Type and default value as No.

Create a hideWelcome column,

Step # 2: Add a dummy first row with hideWelcome as Yes for this row.

Add a new row for this hidewelcome column as Yes

Step # 3: Add the View Formatter JSON code for the trick.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "hideColumnHeader": true,
  "hideSelection": true,
  "debugMode": true,
  "rowFormatter": {
    "elmType": "div",
    "style": {
      "display":  "=if([$hideWelcome], 'none', '')"
    },
	"children": [
	  {
		"elmType": "div",
		"txtContent": "[$Title]",
		"style": {
		  "flex-grow": "1"
		}
	  }
	]
  }
}

The first row with the hideWelcome as Yes will hide the welcome message.

The hidden welcome message

Conclusion

The above trick may not work for all scenarios. As I have not tested all scenario. This is a technique to hide the welcome message based on the hidden field named hideWelcome.

Posted in SharePoint, Technical Stuff | Leave a comment

How to extract User Profile Photo using MS Graph API?

Summary

The existing Champion Management Platform Teams app created in the PnP community uses the User Profile Photo MS Graph API to extract and update the profile picture with the badge.

This article will demonstrate how to do the same API call with Power Automate.

Prerequisites

  • Power Automate Premium license to use the HTTP actions
  • Azure AD app with the MS Graph User.ReadWrite.All permission granted

Step by Step Solution

Step # 1: Create an Azure AD App with MS Graph Application Permission granted

Azure AD app

Step #2: Make a note of Application ID, Tenant ID, and Client Secret for the above Azure AD app.

Use these noted values in the next step.

Step #3: Create a new Power Automate Flow the Manually trigger a flow. Initialize three variables and define one text input as UserUPN.

Step #4: Make an HTTP call to get the app’s access token.

HTTP call to get an access token.
# Please use the highlighted values for URI, Headers and Body. 

{
    "inputs": {
        "method": "POST",
        "uri": "https://login.microsoftonline.com/@{variables('TenantID')}/oauth2/v2.0/token",
        "headers": {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        "body": "grant_type=client_credentials&scope=https://graph.microsoft.com/.default&client_id=@{variables('ApplicationID')}&client_secret=@{variables('ClientSecret')}"
    },
    "metadata": {
        "operationMetadataId": "a69e019a-d351-409a-ae1b-340a23f4b775"
    }
}

Step # 5: User Parse JSON to get the output value of the above action.

Parse JSON
{
    "type": "object",
    "properties": {
        "token_type": {
            "type": "string"
        },
        "expires_in": {
            "type": "integer"
        },
        "ext_expires_in": {
            "type": "integer"
        },
        "access_token": {
            "type": "string"
        }
    }
}

Step # 6: Now make the Get Profile Image call to get the Image content of the profile photo.

Make an HTTP call to get the profile image.
# Please use the highlighted values for URI and Headers. 

{
    "inputs": {
        "method": "GET",
        "uri": "https://graph.microsoft.com/v1.0/users/@{triggerBody()['text']}/photo/$value",
        "headers": {
            "responseType": "blob",
            "Content-Type": "blob",
            "Authorization": "@{body('ParseJSONforToken')?['token_type']} @{body('ParseJSONforToken')?['access_token']}"
        }
    },
    "metadata": {
        "operationMetadataId": "775579d0-6aa9-4326-a1f9-0ad37217c304"
    }
}

Step # 7: Finally add compose section to get the image content from the above action.

Conclusion

As shown in the above technique you can get the user profile images on the tenant. The Azure AD app plays an important part to make an MS Graph API call. The same API call can be made using the PUT and you should be able to apply a badge or anything else to the user profile picture.

Posted in Technical Stuff | Leave a comment

How to Export Intune reports using Graph APIs?

Summary

The following REST API call is to get the InTune report data for the tenant.

# The API is a REST call with the request body to get the report CSV file.
https://graph.microsoft.com/beta/deviceManagement/reports/exportJobs

Please refer here for more details on the API.

Step By Step Solution

Step # 1 Create an Azure AD app with the MS Graph “DeviceManagementManagedDevices.Read.All” permission.

MS Graph “DeviceManagementManagedDevices.Read.All” permission.

Please note the Application ID, Secret, and Tenant ID. You will need these three pieces of information in the PowerShell Script.

Step # 2 Using PowerShell run the following script.

# Init Variables
$outputPath    = "C:\Hold"
$outputCSVPath = "C:\Hold\EAWFAreport.zip"  #might need changed

$ApplicationID   = "TOBE CHANGED"
$TenantID        = "TOBE CHANGED"
$AccessSecret    = "TOBE CHANGED"

#Create an hash table with the required value to connect to Microsoft graph
$Body = @{    
    grant_type    = "client_credentials"
    scope         = "https://graph.microsoft.com/.default"
    client_id     = $ApplicationID
    client_secret = $AccessSecret
} 

#Connect to Microsoft Graph REST web service
$ConnectGraph = Invoke-RestMethod -Uri https://login.microsoftonline.com/$TenantID/oauth2/v2.0/token -Method POST -Body $Body

#Endpoint Analytics Graph API
$GraphGroupUrl = "https://graph.microsoft.com/beta/deviceManagement/reports/exportJobs"

# define request body as PS Object
$requestBody = @{
    reportName = "Devices"
    select = @(
        "DeviceId"
        "DeviceName"
        "SerialNumber"
        "ManagedBy"
        "Manufacturer"
        "Model"
        "GraphDeviceIsManaged"
    )

}

# Convert to PS Object to JSON object
$requestJSONBody = ConvertTo-Json $requestBody

#define header, use the token from the above rest call to AAD.
# in post method define the body is of type JSON using content-type property.
$headers = @{
    'Authorization' = $(“{0} {1}” -f $ConnectGraph.token_type,$ConnectGraph.access_token)
    'Accept' = 'application/json;'
    'Content-Type' = "application/json"
}

#This API call will start a process in the background to #download the file.
$webResponse = Invoke-RestMethod $GraphGroupUrl -Method 'POST' -Headers $headers -Body $requestJSONBody -verbose


#If the call is a success, proceed to get the CSV file.
if ( -not ( $null -eq $webResponse ) )
{
    #Check status of export (GET) until status = complete
    do
    {

#format the URL to make a next call to get the file location.
        $url2GetCSV = $("https://graph.microsoft.com/beta/deviceManagement/reports/exportJobs('{0}')" -f $webResponse.id)
        "Calling $url2GetCSV"
        $responseforCSV = Invoke-RestMethod $url2GetCSV -Method 'GET' -Headers $headers  -verbose
        if (( -not ( $null -eq $responseforCSV ) ) -and ( $responseforCSV.status -eq "completed"))
        {
            #download CSV from "URL=" to OutputCSVPath
            #### It means the completed status is true, now get the file.
            Invoke-WebRequest -Uri $responseforCSV.url -OutFile $outputCSVPath
		# Un Zip the file.
            Expand-Archive -LiteralPath $outputCSVPath -DestinationPath $outputPath

        }
        {
            Write-Host "Still in progress..."
        }
        Start-Sleep -Seconds 10 # Delay for 10 seconds.
    } While (( -not ( $null -eq $responseforCSV ) ) -and ( $responseforCSV.status -eq "inprogress"))

}

After this PowerShell script call, you should see the Zip and CSV files in the C:\Hold Folder.

Conclusion

The above steps will help you to get the InTune reports data file. The API still in the beta if anything changes I will update this post.

Posted in Technical Stuff | 1 Comment

How to prevent ListView WebPart from making frequent Search API calls?

Summary

My customer has migrated the classic sites to SharePoint Online. Some sites’ home pages are with the list view web part, these pages make multiple query calls to Search API every 60 seconds.

This will make Search API throttle the query and it may have a bad user experience if many users frequently visit the same page multiple times. Read this article on the details of throttling.

Step by Step to diagnose the issue

For an issue like throttling, to diagnose you will need the Browser’s Developer Tools, you can get more information here about the developer tool for the Edge browser.

Open the developer’s tool’s console window and type localStorage.clear() and sessionStorage.clear(). This will clear all the browser cache.

Go to the SharePoint page with List View WebPart. Open the Network tab and watch for the outbound traffic. You will notice every 60 seconds the ListView WebPart will try to refresh.

This happens because the following are the settings for the list view web part.

“Automatic Refreshing interval (seconds)”

Increase the auto-refresh interval and turn it on to show the manual refresh button.

Conclusion

This may be a simple thing and can cause issues only if the page is popular and many users are visiting at the same time. If the user leaves the page active for a long time the auto-refresh will make the call in the interval and the user may not even need the refresh.

The better fix for such a page, increase the interval and provide the manual refresh button so as per the user’s need they can refresh. This will also reduce unnecessary calls to the Search API.

Posted in Technical Stuff | Leave a comment

How to turn on versioning on ALL document libraries for a site?

Summary

The requirement is to turn on versioning for all site document libraries, including subsites. Also, the Major version number should be 500.

The Document Library Versioning Settings for Major Version as 500

The following Set-PnPList command can be used to set the Versioning and Major version as 500 for a Document Library

# 

Set-PnPList -Identity "Documents" -EnableVersioning 1 -MajorVersions 25

The following command can be used to set the Versionins and Major / Minor version numbers.

# In this command the minor version in the UI (as aboove) is the draft version.

Set-PnPList -Identity "Documents" -EnableVersioning $true -MajorVersions 25 -EnableMinorVersions $true -MinorVersions 10

#

There are two files to automate the process of turning on versioning. The input file is site2process.CSV. The input file is with list of Site Collection URLs to process.

Url
https://m365x162783.sharepoint.com/sites/Test1
https://m365x162783.sharepoint.com/sites/Test2

The script file is located here.

Conclusion

Using the above script you can turn on the versioning of all the document libaries.

Posted in PnP.PowerShell, SharePoint | Leave a comment

Build 2022 – May 24 to May 26

Summary

This post is to list the Build 2022 sessions by Solution Areas.

Click/Select on the Solution Area topic to get the list of sessions.

Azure
Azure – Application Innovation
Azure – Data
Azure – IoT
Azure – Infrastructure
Azure – AI
Azure – Enable
Azure – Migration and Modernization
Azure – Power BI
Azure – Mixed Reality
Microsoft 365
Microsoft 365 – Windows
Microsoft 365 – Microsoft Teams
Microsoft 365 – Microsoft 365 Apps
Microsoft 365 – Collaborative Apps
Microsoft 365 – Microsoft Graph
Microsoft 365 – Microsoft Viva
Microsoft 365 – Platform & Integration
Power Platform
Power Platform – Power Platform
Power Platform – Power Apps
Power Platform – Power BI
Power Platform – Power Automate
Power Platform – Power Virtual Agent
Security
Security – Identity & Access Management
Security – Compliance
AI & Innovation
AI at Scale
AI for Good
Startup and Other Areas
Startup
Other Areas

Top of page

Azure – Application Innovation
Level 100 – Azure – Application Innovation
“Hello, World!” in 3 programming languages 
A peek inside the developer’s toolkit
Build your own resume website and stand out to recruiters
Microsoft Community Training for Nonprofits
So many programming languages, so little time–which should I learn?
Tackling the technical interview
The New Developer’s Guide to the Cloud
“Intro to Tech Skills”? Tell me more!
Level 200 – Azure – Application Innovation
Codespaces: Managed cloud environments developers love with the controls their admins need
Maximize Agility by Automating Custom Rollouts in Azure Devops
Next Steps for Distributed Programming with .NET and Orleans
Rapidly code, test and ship from secure cloud developer environments
Scale cloud-native apps and accelerate app modernization
Sneak Peek: Azure Developer CLI
Level 300 – Azure – Application Innovation
Accelerate and secure your code to cloud development
Ask the Experts: .NET and Visual Studio
Ask the Experts: Accelerate and secure your code to cloud development
Ask the Experts: Delivering developer velocity through the entire engineering system
Ask the Experts: Deploy modern containerized apps and cloud native databases at scale
Ask the Experts: Modernize and scale enterprise Java applications
Ask the Experts: Seamless and secure Kubernetes experience and observability anywhere
Build native apps for any device with .NET and Visual Studio
Building document intelligence applications with Azure Applied AI and Azure Cognitive Services
Co-developing – accelerate your digital transformation with Microsoft by your side
Delivering developer velocity through the entire engineering system
Deploy modern containerized apps and cloud native databases at scale
Develop and Deploy Your Java Apps using Tools and Frameworks You Love
How to quickly add chat to your .NET app using the low-code Weavy Drop-in UI
Modernize and scale enterprise Java applications
NVIDIA RAPIDS Spark plugin on Azure Synapse
Seamless and secure Kubernetes experience and observability anywhere
Tooling for Incremental ASP.NET Core Migrations
Verifiable Credentials – The What, The Why, The How
What’s Next in C# 11

Top of page

Azure – Data
Level 100 – Azure – Data
GitHub + Microsoft Docs + You
Level 200 – Azure – Data
Accelerate innovation and achieve agility on a trusted, integrated platform with hybrid and multicloud capabilities
Analytics and Operational Data
Azure SQL and Azure Functions: Integration with SQL bindings
Introduction to Azure Arc enabled Kubernetes
Protect your databases using Microsoft Defender for Cloud
Securing Azure-Arc Enabled Data Services
Level 300 – Azure – Data
Ask the Experts: Accelerate and secure your code to cloud development
Ask the Experts: Build and deploy containerized applications and databases for hybrid and multicloud with Azure Arc
Ask the Experts: Modernize your applications with new features across SQL Server 2022 and Azure SQL
Azure Cosmos DB: Learn how to enable analytics over real-time operational data with Azure Synapse Link
Build and deploy containerized applications and databases for hybrid and multicloud with Azure Arc
Delivering developer velocity through the entire engineering system
Develop applications with Azure Database for MySQL – Flexible Server
Modernize your applications with new innovations across SQL Server 2022 and Azure SQL
Modernizing real-time data infrastructure with Azure

Top of page

Azure – IoT
Level 100 – Azure – IoT
Azure IoT Central Roadmap
Building the Arm64 ecosystem on Windows IoT Enterprise with the i.MX 8 platform
Create and Connect Secure and Trustworthy IoT Devices
Dual Operator – Windows IoT
Edge Device Image Builder
IoT Device Developer Experience
Windows IoT Roadmap
Windows IoT Security
Level 200 – Azure – IoT
Azure IoT: Device onboarding experiences for Edge with DPS
Azure RTOS Product Updates
Building Industrial Digital Twin Applications
Connecting MCU-IoT Devices to the Cloud
Data processing challenges in building enterprise grade IoT solutions
From the Edge to the Metaverse, how IoT powers it all
Prescriptive Architecture guidance for IoT Workloads
Project Haven: Kubernetes for the embedded edge
Reimagine the future of driving insights and actions from physical world data with Azure IoT, Azure Data, and Power Apps
Scaling to a Billion Devices – Azure IoT Platform Vision and Roadmap
Well Architected Framework for IoT
Level 300 – Azure – IoT
Ask the Experts: How Vision AI applications use NVIDIA DeepStream and Azure IOT Edge Services
Deploy IoT solutions with Azure SQL Database
Industrial IoT & Azure IoT Central

Top of page

Azure – Infrastructure
Level 100 – Azure – Infrastructure
The Essential Nature of Cloud Native Processor: Foundations, Solutions, and Benefits
Level 200 – Azure – Infrastructure
Accelerate Microsoft Teams Operator Connect with Azure based microservices
PowerShell 7
Level 300 – Azure – Infrastructure
Azure PaaS and Cloud Native Development

Top of page

Azure – AI
 Level 100 – Azure – AI
A guided journey into AI
Accelerate your Azure data and AI journey with IBM’s Data Fabric
Microsoft Build Into Focus: AI
 Level 200 – Azure – AI
Accelerate Compute on PC class devices with Azure IoT Edge for Linux on Windows (EFLOW)
Azure Machine Learning – MLOps and Responsible ML
Embrace digital transformation at the edge with Azure Percept
Solving healthcare’s toughest problems: Building clinical models using a self-supervision NLP framework
 Level 300 – Azure – AI
Ask the Experts: Scaling responsible MLOps with Azure Machine Learning
Ask the Experts: Seamless and secure Kubernetes experience and observability anywhere
Discussing accelerated model inference for AzureML Deployment with ONNX-RT, OLive, NVIDIA Triton Inference Server & Model Analyzer
Scaling responsible MLOps with Azure Machine Learning

Top of page

Azure – Enable
 Level 200 – Azure – Enable
GitHub + Azure: Better Together
Introduction to Azure Arc enabled Kubernetes

Top of page

Azure – Migration & Modernization
 Level 200 – Azure – Migration & Modernization
Building and running enterprise-grade Spring applications in the cloud

Top of page

Azure – Power BI
 Level 300 – Azure – Power BI
Ask the Experts: Democratizing your data at scale with Power BI
Democratize your data at scale with Power BI

Top of page

Azure – Mixed Reality
Level 100 – Azure – Mixed Reality
Microsoft Build Into Focus: Preparing for the metaverse

Top of page

Microsoft 365 – Windows
Level 100 – Microsoft 365 – Windows
Bring your Android apps to Windows
Level 200 – Microsoft 365 – Windows
Best practices for app publishing
Building great apps for Windows n/a
Create a simple Windows App with WinUI
Create next-gen experiences at scale with Windows
Edge DevTools: Reinventing Browser Tools for the Future of Web Development
Enriching desktop experiences with the power and reach of the web
Evolving MSIX
Evolving the Microsoft Store for Business and Education
Finding your success in the Microsoft Store
Improving your Windows app’s performance
Promoting apps and content to your target audiences on the Microsoft Store
Set up a great dev environment for any project
 Level 300 – Microsoft 365 – Windows
Ask the Experts: Building great apps with the open platform of Windows
Ask the Experts: Develop Windows apps on and for a rich ecosystem of platforms and devices
Building great apps with the open platform of Windows
Make your cross-platform apps best on Windows
The new Microsoft Store, built for your success
Level 400
Develop Windows apps on and for a rich ecosystem of platforms and devices

Top of page

Build 2022 – Microsoft 365 – Microsoft Teams
 Level 100 – Microsoft 365 – Microsoft Teams
Enabling 3rd party apps on Teams with confidence with M365 App Compliance Program
 Level 200 – Microsoft 365 – Microsoft Teams
Accelerating your Microsoft Teams app development and time to market with Teams Toolkit
Build rich micro-capabilities on Microsoft Teams platform by leveraging link unfurling
Building custom clients for virtual events & visit scenarios using Azure Communication Services, Microsoft Teams & Microsoft Graph
Conversational apps in Microsoft Teams
Create interactive meeting apps for Microsoft Teams
Deep dive into Microsoft Teams JS SDK v2 for extending Teams apps to Outlook and Office.com
Extend Approvals across your line of business applications in Microsoft Teams
Make your meetings more interactive! Learn how to build engaging synchronous experiences your users will love
Monetize your third-party apps for Microsoft Teams
Unlock enterprise adoption of your apps in Microsoft 365 and Microsoft Teams
 Level 300- Microsoft 365 – Microsoft Teams
Ask the Experts: Microsoft Graph
Microsoft Build Into Focus: Build collaborative apps to thrive in the modern workplace
Reach 270M users and grow your business with Microsoft Teams

Top of page

Microsoft 365 – Microsoft 365 Apps
 Level 200 – Microsoft 365 – Microsoft 365 Apps
Excel add-ins and data types
 Level 300 – Microsoft 365 – Microsoft 365 Apps
Ask the Experts: Microsoft Teams

Top of page

Microsoft 365 – Collaborative Apps
Level 200 – Microsoft 365 – Collaborative Apps
Build collaborative apps with new Microsoft 365 and Microsoft Teams collaboration controls in Power Apps
Building collaborative web apps with Fluid Framework & Azure Fluid Relay
Innovate with collaborative apps and low code
Level 300
Build collaborative apps with Microsoft Teams and Microsoft 365 services

Top of page

Microsoft 365 – Microsoft Graph
Level 200 – Microsoft 365 – Microsoft Graph
Building Microsoft Graph Connectors to improve your workplace search experience and increase engagement with app content
Building Real-time Collaborative Apps with Azure, Microsoft 365, and Power Platform
Latest and greatest from Microsoft Graph to power your people centric apps
Unlocking the power of your Microsoft 365 data with Microsoft Graph Data Connect
Level 300 – Microsoft 365 – Microsoft Graph
Deep Dive into Microsoft Graph SDKs

Top of page

Microsoft 365 – Microsoft Viva
Level 200 – Microsoft 365 – Microsoft Viva
How to open your app to cross-organizational collaboration with Microsoft Teams Connect
​Building tailored employee experiences with Microsoft Viva Connections and SharePoint Framework

Top of page

Microsoft 365 – Platform & Integration
Level 200 – Microsoft 365 – Platform & Integration
Bring Microsoft Teams (Chats & Channel) collaboration to your Apps by leveraging Microsoft Graph
Everything new you need to know about Microsoft Teams Platform in 30 minutes or less

Top of page

Power Platform – Power Platform
Level 100 – Power Platform – Power Platform
Access Connector for Dataverse and Power Platform GA Launch
Implement Power Platform with Architecture Best Practices and Fusion Development 
Microsoft technologies and the dev community: Who’s building what? Get inspired!
Level 200 – Power Platform – Power Platform
Expedite application delivery with low-code and fusion teams
Level 300 – Power Platform – Power Platform
Adobe + Microsoft: Building document workflows through low-code automation

Top of page

Power Platform – Power Apps
Level 100 – Power Platform – Power Apps
Microsoft Build Into Focus: Low Code solutions using Microsoft Power Platform
Level 200 – Power Platform – Power Apps
Building Teams apps that bring value quickly through low-code
Pro developer capabilities of Power Apps and Dataverse for Access Developers
What’s new in the world of Microsoft Power Apps
Level 300 – Power Platform – Power Apps
Ask the Experts: Power up your development efforts with the latest low code innovations
Build a Power Apps component
Discover and use Web APIs with Power Apps

Top of page

Power Platform – Power BI
Level 100 – Power Platform – Power BI
Milwaukee Tool Driving its DnA Culture with Unified Analytics 
Level 200 – Power Platform – Power BI
Best practices for deploying and scaling Power BI Embedded Analytics
Enhancements to administration, security, and governance in Power BI
Integrating Power BI deployment pipelines into Azure DevOps and Azure Pipelines.
Organize & query your data lakes using Azure Synapse database templates & lake databases
The Future of Enterprise Semantic Models  – Power BI Premium
Transform how business intelligence is used with Power BI in PowerPoint and Outlook 
Using AI With Documents: Syntex, AI Builder & Azure Cognitive Services
What’s new with Synapse Gen2 data warehouse

Top of page

Power Platform – Power Automate
Level 200 – Power Platform – Power Automate
Exciting innovations in Power Automate
Seamlessly scale RPA with Power Automate + Azure VM
Level 300 – Power Platform – Power Automate
Ask the Experts: Accelerate cloud automation and conversational bot development.​
How to accelerate cloud automation and conversational bot development for developers

Top of page

Power Platform – Power Virtual Agent
Level 200 – Power Platform – Power Virtual Agent
Managing Conversational Bots in an Enterprise
What’s new for Microsoft’s Conversational AI and Power Virtual Agents

Top of page

Security – Identity & Access Management
Level 200 – Security – Identity & Access Management
Build the SOC of the future with the Azure AD Identity Protection APIs
Configure Application Security Features
Creating secure identities for apps using the Microsoft identity platform
Building on Microsoft Sentinel platform 
Level 300 – Security – Identity & Access Management
More secure, and resilient, apps built on Azure AD Continuous Access Evaluation

Top of page

Security – Compliance
Level 200 – Security – Compliance
Automate and customize retention and deletion scenarios

Top of page

AI & Innovation
Level 200 – AI at Scale
Tapping into the Qualcomm AI Engine – On-device AI driving improved and new Windows experiences
The Future of AI Development Tools
Level 300 – AI at Scale
Azure Cognitive Service deployment: AI inference with NVIDIA Triton Server
Document Intelligence using Azure Feature Store (Feathr) and SynapseML
AI & Innovation
Level 200 – AI For Good
Driving inclusion and accessibility with dev tooling and AI services
How to develop custom object models with data labeling tools and AutoML

Top of page

Startup
Architecting Your Startup Stack
Ask the Experts: Architecting Your Startup Stack
Avoid these 3 mistakes to ensure your model reaches production
Intrapreneurship: Four Steps to Successfully Growing Your Idea in the Enterprise
Microsoft for Startups unlocking the Power of OpenAI for your startup

Top of page

Build 2022 – Other Areas
Level 100
2022 Imagine Cup World Championship
Advancing Equity & Inclusion in Products
Autism, Anxiety, and Running out of Spoons
Coding with kids: Cultivating the next generation of developers through play
Contributors: Assemble! Unleashing the Power of Community
Environmental sustainability: Device and cloud solutions strategies to reduce your climate impact
Microsoft Build After Hours: Day 1
Microsoft Build After Hours: Day 2
Microsoft Build Keynote Analysis
Microsoft Build Opening
Microsoft Build Opening & Core Theme Sessions Replay (optimized for EMEA time zones)
Panel discussion: Build the skills you need for today’s tech world
Level 200
.NET MAUI – Updates and Roadmap
Ask the Experts: Continuous Cloud Modernization with Feature Flags
Future Possibilities for .NET Core and WASI (WebAssembly on the Server)
GitHub Issues – planning and tracking for developers
Minimal APIs: Past, Present, and Future
Visual Studio 2022 and Beyond
Visual Studio 2022 for Mac and Beyond
Level 300
Ask the Experts: Unlocking Better SQL Performance and Scalability
Build the Future of Web 3 Faster and Easier – New Tools and New Features
Developing and Optimizing Software for Hybrid Architecture
Native client apps with Blazor Hybrid
Testing Modern Web Apps with Playwright
Level 400
Breaking barriers to make open source work at work
Continuous Delivery with GitHub Actions
Output Caching in ASP.NET Core 7

Posted in Build 2022 | Leave a comment