powershell
1904 TopicsPrimer: Using Exchange Online PowerShell in Azure Automation Runbooks
In this Microsoft 365 automation primer, we cover how to create and execute Azure Automation Exchange Online runbooks (scripts) using cmdlets from the Exchange Online management module. Some setup is necessary before runbooks can process Exchange cmdlets, but once the necessary resources and permissions are in place, it’s all plain sailing. The next challenge is how to output data created in a runbook… https://office365itpros.com/2025/02/10/azure-automation-exchange-primer/5Views0likes0CommentsWindows 11 Autopilot and language packages
Hi everyone, I work for a Company with about 10.000 employees. We have a working SCCM envoirenment and an Autopilot PoC which should go live in the near future. The whole project was in cooperation with DELL. The problem here is that DELL scammed us a little bit, because they always ensured us, that we will get the DELL ready image for the region where Notebook is deployed (DELL ready Image contains the LPs for all countries in the Region e.g. central Europe, Asia pecific etc.). At the End Dell told us, that it us technically not possible to provide us this image and the only thing they can do is to provide us the basic US image That's where our problem started... We need some languages for our subsidaries in some countries. Thus we tried to create a package for the Language install. 1. First idea was to use the Powershell cmdlet install-language (Install-Language (LanguagePackManagement) | Microsoft Learn). The problem here is that this package runs pretty unstable. During Autopilot the command needs about 30 Minutes to finish. Sometimes the command throws an error: "Language Pack or feature could only be partially installed. Error Code: -2147023436“ (I guess it is a timeout but I didn't find anything on Google). The strange thing here is that this cmdlet runs pretty good and stable in private envoirenment. I tested it on my PC at home with Windows 10 22H2 and on a company device with the Microsoft en-US base Image (Win 11 23H2). With Autopilot it worked 70-80% of the time and the rest failed. It was very strange that in the logs the cmdlet faild with error Code: -2147023436, but after Autopilot finished, the Language was available if I called get-language. I also monitored it in the OOBE with the powershell. Result: cmdlet sometimes failed, Language was av Does anyone know how install-language works in the Background? Which URLs are called or what this error code means? Thank you for every kind of help Best regards Sven2.6KViews0likes7CommentsAutomatic Version History in SharePoint Online
Hi, I want to turn on Automatic Version History to reduce storage. Has anyone implemented this on existing Large Libraries? What I want to know is, does it use the current meta data and delete versions straight away and free up space quickly? Or will it only start analysing from when you change the setting and i'll have to wait a longer time to reduce versions? Many thanks! Chris12Views0likes1CommentVersion History Reporting
Hey. We are very close to the SharePoint Storage Limit! After some research, I think the main issue is the amount of version history we are keeping. So I am coming up with a strategy to reduce this. Probably turning on the Automatic Versioning. What I would like to do is find a way (Probably with PowerShell) to get a report on each site. For each site, How much is the total storage and how much of that is just version history. Does anyone have any idea of how to achieve this? Thanks! Chris12Views0likes1CommentImport list of answer
Hello, One of my user want to create a form but for one of the question he have a lot possible answers (around 200) that he want to be select using radio button or dropping list. He doesn't want to type all of the 200 answers as he already have them within an Excel file. Is there a way to import the list of answer to a question from Excel ? Is there any PowerShell module to allow it to do programmaticly ? Thanks for help Regards1.3KViews1like1CommentPowerShell script to delete all Containers from a Storage Account
After move the BootDiag settings out of the Custom Storage Account, the original Storage Account used for are still consuming space for nothing. This is part of the standard Clean Up stream need to be consider into the FinOps Plan. This script will help you to clean these Storage Accounts quickly and avoid cost paid for nothing. Connect-AzAccount #Your Subscription $MySubscriptionToClean = "MyGuid-MyGuid-MyGuid-MyGuid-MyGuid" $MyStorageAccountName = "MyStorageAccountForbootdiags" $MyStorageAccountKey = "MySAKeyWithAllCodeProvidedByYourStorageAccountSetting+MZ3cUvdQ==" $ContainerStartName = "bootdiag*" #Set subscription ID Set-AzContext -Subscription $MySubscriptionToClean Get-AzContext $ctx = New-AzStorageContext -StorageAccountName $MyStorageAccountName -StorageAccountKey $MyStorageAccountKey $myContainers = Get-AzStorageContainer -Name $ContainerStartName -Context $ctx -MaxCount 1000 foreach($mycontainer in $myContainers) { Remove-AzStorageContainer -Name $mycontainer.Name -Force -Context $ctx } I used this script to remove millions of BootDiag Containers from several Storage Accounts. You can also use it for any other cleanup use case if you need it. Fab35Views0likes1CommentPowerShell Script to apply the retention Label in a full Site Collection
This script could help you to apply a Label in an entire Site Collection (All document libraries into all subsites). It's using an old command for "Set-PnPLabel" (I was not able to apply it with the last version of this "command"). You will need to have the PnP.PowerShell module version "1.12.0", this is why the start of the script is related to this component installation, you can remove it once your action is applied as expected. # ----------------------------------------------------------------------------------- #COMPONENT INSTALLATION #Get-InstalledModule -Name PnP.PowerShell #Find-Module -Name PnP.PowerShell -RequiredVersion 1.12.0 #Install-Module -Name PnP.PowerShell -RequiredVersion 1.12.0 -Force #Get-InstalledModule -Name PnP.PowerShell # ----------------------------------------------------------------------------------- [string]$SiteCollectionRelativeURL = "MySiteCollection" [string]$LabeltoApply = "Auto-delete 15 years" [string]$TeamSiteToUpdate = "https://MySPTenant.sharepoint.com/sites/$SiteCollectionRelativeURL/" [string]$ListName = "" # ----------------------------------------------------------------------------------- Import-Module PnP.PowerShell -DisableNameChecking Connect-PnPOnline -Url $TeamSiteToUpdate -UseWebLogin # ----------------------------------------------------------------------------------- #Get-PnPLabel $AllDocLibraries = Get-PnPList | Where-Object {$_.Hidden -eq $false} if ($AllDocLibraries.Count -gt 0) { foreach ($myDocLib in $AllDocLibraries) { $ListName = $myDocLib.Title $MyList = Get-PnPList -Identity $ListName $CurrentLabel = Get-PnPLabel -List $ListName -ValuesOnly if ($CurrentLabel.TagName -ne $LabeltoApply) { Write-Host " >>>> LABEL ", $LabeltoApply , "- NEED TO BE APPLIED on DocLib", $ListName -ForegroundColor Red Set-PnPLabel -List $ListName -Label $LabeltoApply -SyncToItems $false } else { Write-Host " >>>> LABEL ", $LabeltoApply , "- Yet Applied on DocLib", $ListName -ForegroundColor Green } #Get-PnPLabel -List $ListName -ValuesOnly } } $AllSubWebs = Get-PnPSubWeb -Recurse if($AllSubWebs.count -gt 0) { foreach ($mysubweb in $AllSubWebs) { Write-Host $mysubweb.Url -ForegroundColor Yellow Connect-PnPOnline -Url $mysubweb.Url -UseWebLogin $AllDocLibraries = Get-PnPList | Where-Object {$_.Hidden -eq $false} if ($AllDocLibraries.Count -gt 0) { foreach ($myDocLib in $AllDocLibraries) { $ListName = $myDocLib.Title $MyList = Get-PnPList -Identity $ListName $CurrentLabel = Get-PnPLabel -List $ListName -ValuesOnly if ($CurrentLabel.TagName -ne $LabeltoApply) { Write-Host " >>>> LABEL ", $LabeltoApply , "- NEED TO BE APPLIED on DocLib", $ListName -ForegroundColor Red Set-PnPLabel -List $ListName -Label $LabeltoApply -SyncToItems $false } else { Write-Host " >>>> LABEL ", $LabeltoApply , "- Yet Applied on DocLib", $ListName -ForegroundColor Green } } } } } This script was used to prevent the automatic cleanup implemented in the full tenant to documents older than 10 years. I used it to apply this on site collections containing more than 200 subsites and 10 doc lib mini per subsites. You can use it and adapt it as you need for your specific context. Fab39Views0likes0CommentsPractical Graph: Finding and Removing Underused Microsoft 365 Copilot Licenses from User Accounts
Microsoft 365 Copilot licensing costs a lot of money. At $360 annually, it's important to make sure that everyone with a license makes full use of Copilot to become more productive and efficient. Usage data is available in the Graph, and some PowerShell can reveal who's using Copilot and who's not. With that data, you can decide whether to remove licenses for reassignment to other users. https://practical365.com/microsoft-365-copilot-licensing/15Views0likes0Comments