PowerShell – auxiliary script to populate CustomAttribute10 with a Purged Items FolderID

Originally this script ( New-ComplianceSearch script ) would search through Purged Items. That was the downside of it comparing to a "classic" Search-Mailbox you can find here ( Search-Mailbox script ). So imagine you run the script the 1st time, find target messages, and then delete them - the found results make sense. However, should you run the script the 2nd time with the same search criteria, it would find those already purged messages again. That creates some confusion. So it would be great to exclude Purged Items folders from the search. Now, it is possible to do so on the fly ( https://docs.microsoft.com/en-us/microsoft-365/compliance/use-content-search-for-targeted-collections ) but it is very time consuming and takes about 1-3 seconds for each mailbox which stacks up pretty fast. So I came up with a script to take care of this issue by storing a Purged Items FolderID in a CustomAttribute10 of each mailbox. So…

Continue ReadingPowerShell – auxiliary script to populate CustomAttribute10 with a Purged Items FolderID

PowerShell – New-ComplianceSearch script to go through all mailboxes, find a target message, and remove it

Here is another more advanced script that searches for messages of interest, then optionally exports and purges them. So, what makes this script more advanced? Unlike the other script that uses Search-Mailbox ( https://365basics.com/powershell-search-mailbox-script-to-go-through-all-mailboxes-find-a-target-message-and-remove-it/ ) this script below is based on New-ComplianceSearch cmdlet: Pros: Super fast, multi-threaded, takes about 1-2 minutes on average to complete the whole task. As Microsoft is trying to depreciate Search-Mailbox, they put more effort into New-ComplianceSearch, so we can expect new functionality to come in the future. Can create an export file that can be downloaded and investigated. Cons: Always searches through all folders including Purged Items which might create some confusion when showing results (if running the same search again) - see UPDATE 9/30/2019 Cannot copy messages to another mailbox for you to investigate. Of course there are quite a few scripts out there that use New-ComplianceSearch, everyone has their own approach. So let…

Continue ReadingPowerShell – New-ComplianceSearch script to go through all mailboxes, find a target message, and remove it

PowerShell – Search-Mailbox script to go through all mailboxes, find a target message, and remove it

When looking at the title of this post, one might notice I used a target word, and it is on purpose. This script below is useful when trying to remove all types of messages from users' mailboxes whether it's a spam, scam, virus or a an important message that needs to be "recalled". This script is based on Search-Mailbox cmdlet, works well but it has its own pros and cons, more on some of them below. Later I will have another post showing a different and more advanced script to do the same and even better. So stay tuned. Pros: Doesn't search through Purged Items (a bit more about the 3rd layer of Trash is here - https://365basics.com/script-to-search-through-recoverable-and-purged-items-and-restore-those/ ). Can copy messages to another mailbox (IT Help in that example). Cons: Per Microsoft Search-Mailbox will be depreciated, we don't know when it will happen though. Slow (if a target message…

Continue ReadingPowerShell – Search-Mailbox script to go through all mailboxes, find a target message, and remove it

Microsoft Flow – archive SharePoint List data into a single Excel file

  • Post category:Flow
  • Post comments:0 Comments

This post is about a quite simple task to achieve - archiving SharePoint List data into a single Excel file that is stored in a Document Library. I think it is important to go through this process to show the basics and have it as a prerequisite for a more complicated process - archiving data into multiple excel files. There are several reasons why one would archive data into Excel: excel file is easy to move or share; it is very fast to work with (no paging, no 5000 item limit view threshold). Let's create a SharePoint List with different types of columns (single line text, date, number, choice): Then we add a few test items: After that we create a Document Library and put an Excel file into it: That Excel file should have a table in it and the same columns as our SharePoint List. The formatting of…

Continue ReadingMicrosoft Flow – archive SharePoint List data into a single Excel file

PowerShell – change the storage space for a specific user’s OneDrive

As an admin you can easily make an adjustment of a OneDrive storage limit for all users through a OneDrive admin center. If you need to do the same for a specific user, here is a Microsoft article that describes that - https://docs.microsoft.com/en-us/onedrive/change-user-storage Truth is, it only takes a single line of code to make an adjustment; however, my script below takes care of most little things, requirements, and inconveniences: you only need an email address of a user; the minimum size of allocated space is 1 GB; the maximum size is 5 TB. $email = Read-Host "Please provide an email address of the user" $convertedemail = $email -replace "\.","_" -replace "@","_" $partofthelink = "-my.sharepoint.com/personal/" + $convertedemail $onedriveurl = Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like $partofthelink" $onedriveurl Do { Try { $num = $true [int]$sizegb = Read-Host "Please specify the size of OneDrive storage space to be set…

Continue ReadingPowerShell – change the storage space for a specific user’s OneDrive

PowerApps – enhance Combo Box search functionality

Even out of the box PowerApps is a great tool that provides lots of functionality. Way more than InfoPath could. However, most of the time with very few adjustments it is possible to achieve even more. A great example would be a Combo Box and its search ability. Let's create a SharePoint list with a Choice column and these values: It doesn't really have to be a Choice column, you might as well use a Lookup column. When a PowerApps form is created, the studio creates a Data Card and a Combo Box control associated with that Choice field. Let's see how the search in that Combo Box works and why it is limited in its current state. Note how it finds BK but doesn't find Black. The search has a StartsWith behavior. What if it is necessary to search for a word regardless of its position. Well, that's very easy…

Continue ReadingPowerApps – enhance Combo Box search functionality

SharePoint – enable or disable Share option per each library within a site

This post is about how to enable or disable Share option for each library within a SharePoint subsite. There are different suggestions that worked for some but didn't for the others in this stackexchange topic - https://sharepoint.stackexchange.com/questions/208090/how-do-i-disable-get-a-link-share I found a way to control it by adjusting Access Requests Settings and Permission levels. Unfortunately it's almost impossible to find any documentation on what each Permission option does. Let's see how it all works together. Microsoft is known to change things down the road, so the settings that work today might not in the future. Please test everything before moving forward in your production environment. So here is a test subsite with two document libraries: The first requirement is Allow members to share the site and individual files and folders must be checked: Second, on your main site within a site collection you need to create a copy of the Contribute permission level, name it Contribute…

Continue ReadingSharePoint – enable or disable Share option per each library within a site

PowerApps – 3 different ways to implement currency input mask

As far as I know at the time of this post PowerApps doesn't have an Input Mask (currency mask in this particular case) feature. It is possible to mimic that feature using Text function but implementing it is not really straightforward and gets even more complicated if you are dealing with PowerApps integrated with SharePoint. In this post I will show you 3 different ways of implementing a workaround for a currency input mask, each has its own pros and cons: The currency mask formatting is not visible until you submit the form (the simplest). You can see the mask formatting even before submitting your form but you need to click away from the field to see the formatting (medium complexity). The currency formatting is applied real time as you type in the numbers (the most complicated but the most natural way of working with currency). Let's create a testprice…

Continue ReadingPowerApps – 3 different ways to implement currency input mask

PowerShell – show and adjust resource booking configuration according to 4 scenarios

There is an amazing article (https://itpro.outsidesys.com/2017/11/06/exchange-configuring-the-resource-booking-attendant-with-powershell/) published by John Dougherty on how to adjust resource booking configuration having 4 different scenarios. Those 4 scenarios are: Anyone can book the resource. No delegate approval required. Anyone can book the resource. Delegate approval required for all requests. Only a list of people can book the resource without delegate approval. All others require delegate approval. Only a list of people can book the resource. All others are denied. There are no delegates. Not everything can be done through an Admin portal, that's why having such a PowerShell script is crucial. I decided to do several things to improve that process: Added code to check an existing configuration for every single Room and Resource. If the configuration is any different than these 4 above, then the script notifies you about it. Combined scripts into a single one. Added more user input to not adjust the…

Continue ReadingPowerShell – show and adjust resource booking configuration according to 4 scenarios

PowerApps form in SharePoint – create a configurable auto-incrementing column without Flow

If you search for SharePoint auto-incrementing column or SharePoint counter column you will notice that most of the examples use the old Workflow or Microsoft Flow to achieve that. In this blog post I will explain how to use PowerApps to do the same and even better. The benefits of using this method are: Configurable counter (if you would like to skip or reserve some numbers, you can adjust the counter to anything). That counter list can have many configuration items for other custom lists and applications. No Microsoft Flow runs are used. Further customization is possible (e.g. reserved numbers). The only downside I could find so far, when several users submit the form at once (literally within the same second), one of them will get an error message. So I'd recommend catching that error and let a user know to retry saving the form. Please note that in this…

Continue ReadingPowerApps form in SharePoint – create a configurable auto-incrementing column without Flow