T O P

Get VM Snapshots via Powershell

This is a little script / scriptlet I came up with when working at my old MSP. We unfortunately had employees who had the tendency to create snapshots in Windows Server and Hyper-V and then leave them. For long periods of time. As in months and even a year plus. These snapshots would grow and of course be a pain in the butt to merge and get rid of.

I ran this in our RMM tool and was able to set an alert or report to it. If there are no snapshots, it exits successfully (Exit 0). If there are snapshots, it says how many there are and exists with a code 1001. You can then have your RMM or log checker alert on that code.

$results=get-vmsnapshot -vmname * | Select VMName, Name, CreationTime
$count=$results | measure | Select Count
If ($count.Count -eq 0) 
	{Write-Host "No snapshots found"
	Exit 0}
Else {Write-Host $results.VMName 'has' $count.Count 'snapshots'
Exit 1001}

Okta Workflows – The access token provided does not contain the required scopes

I hit my head against this fun problem this week. Running an Okta card and using a Custom API action, I got the error The access token provided does not contain the required scopes.

The answer? Navigate to the Okta Workflows OAUTH App in the Admin Dashboard, go to the Okta API Scopes tab, and then click Grant next to the API scope you require.

Now comes the key part – you’re not finished yet! You have to next re-authorize Okta Workflows to use this OAUTH app. To do so, navigate to your Okta connection in Workflows and enter your Okta Domain (ie. company.okta.com) as well as the Client ID and Client Secret found on the Sign On page for your Okta Workflows OAuth application. Then click Reauthorize and then within a few minutes, your API call in workflows will work! Magic.

Refresh or Reset Firefox Bookmark Icons (Called Favicons)

Here is a quick easy fix for Mozilla Firefox – your bookmark icons (also known as favicons) are kept into a file called favicons.sqlite. Close Firefox, delete the file (or move it to another location), and start Firefox back up.

  1. Enter about:support in the location bar
  2. Click the Open Profile folder
  3. Quit Firefox
  4. In the file manager window that opened earlier, delete the favicons.sqlite file (or rename it)

That’s it! My favicons file was 30mb large (I have a lot of bookmarks)

Using Legacy Google Calendar Integration in Slack

Slack’s legacy Google Calendar integration is still much better than the “new” integration. So much so that Slack halted the sunsetting of the integration probably a year plus ago. Here is how you can STILL use the legacy integration.

First, Go to this page in Slack. This will take you directly to the integration in your own Slack tenant.

Next, open up the developer console in your browser by hitting the F12 button. Then, go to the console tab.

Enter this command and hit enter:

$('#calendar_id').removeAttr('class disabled data-lazy-filter-select')

This code will remove CSS/HTML on the page that disallows the dropdown options.

You will now be able to select a calendar on the left side of the page that you want to integrate. Select a channel on the right to post the calendar notifications.

For calendar settings, the recommended setting is under Calendar Summaries. This will post all the days events for the calendar to the selected channel. You can also simply post a notification for each calendar event. Whatever your cup of tea, that is it! You can still use the legacy integration. This is accurate as of January 2024.