Quick function to get a location (a target or long URL) for a short URL.

URL shortening services return the target or long URL for a short URL using the location property of HTTP status code 301 (Moved Permanently).

Add this function to your PowerShell profile to get the location for any short URL.

#Function to expand shortURL and get longURL
Function Get-LongURL {
 param (
       [Parameter(Mandatory=$true,ValueFromPipeline=$true)]
       $shortURL 
        )  
  $header= invoke-webrequest -uri $shortURL -MaximumRedirection 0 -ErrorAction SilentlyContinue
  if ($header.StatusCode -eq 301 -or $header.StatusCode -eq 302){
     Write-host "Status Code: " $header.StatusCode $header.StatusDescription "`nLocation:"$header.Headers.Location
  }
     else {
          Write-Host "Not redirected, status code:" $header.StatusCode $header.StatusDescription
          }
}

{ 0 comments }

Custom Out of Office replies to specific domains or senders

Automatic Replies (Out of Office) in Microsoft Outlook TL;DR: All you need to know about how to send custom automatic replies to specific domains or senders using Inbox Rules. Microsoft Exchange and Outlook have the capability to send different automatic replies, aka Out of Office (OOF) messages to internal and external senders. If you’re going […]

More →

Get Azure Storage Account GRS Replication Status using PowerShell and Azure Portal

You can use Azure Geo-Redundant Storage (GRS) to replicate a storage account to another Azure region. In the rare event of a catastrophic failure where the entire Azure region (with multiple zones) has an outage, you can fail over the storage account to the secondary region. Much like an Exchange geo-cluster. Failover is initiated manually. […]

More →

An annoying Acrobat Reader bug Adobe should fix asap

UPDATE 8/20/2020: This was fixed in a recent Acrobat build. Thank you, Adobe! This makes life easier for users who save PDF docs in Acrobat throughout the day. UPDATE 7/17/2022: Less than 2 years after Adobe fixed it, the Acrobat Reader file save bug is back. Request to Adobe to fix the regression. I’ve been […]

More →

Managing Email: Two Outlook annoyances you can eliminate quickly

Regardless of the obituaries of email being written, published and shared everyday in the media, let’s admit that far from dying, email is not going away anytime soon. In fact, we get increasing volumes of email every day. The annoyance is directly proportional – the more email you get, the more annoying and distracting desktop […]

More →

Get file or folder permissions using PowerShell

The Get-Acl cmdlet in PowerShell’s Security module (Microsoft.PowerShell.Security) does a great job of getting file or folder permissions (aka the Access Control List or ACL). But getting useful info from the default output can take some getting used to. Instead, it’d be great to simply be able to see what the Security tab of a […]

More →

eDiscovery transition in Office 365: Exchange Online eDiscovery transition delayed

Microsoft’s planned transition of eDiscovery features in SharePoint Online and Exchange Online to the Security and Compliance Center (SCC), a new, unified security and compliance console has been delayed. Figure 1 eDiscovery in Office 365 Security and Compliance Center Microsoft had earlier announced that the transition would take place on July 1, 2017. You would […]

More →

eDiscovery transition in Office 365: What you need to know

On July 1, 2017, Microsoft will transition the workload-specific eDiscovery features – In-Place eDiscovery and In-Place Hold in Exchange Online and the eDiscovery Center in SharePoint Online, to the Security and Compliance Center, a new, unified security and compliance console. The documentation for these features was updated a long time ago to reflect these upcoming […]

More →

Windows Server 2012 support lifecycle extended

Microsoft has extended product support lifecycle for Windows Server 2012 to align with the standard product lifecycle support timeline. Mainstream Support for Windows Server 2012 now ends on Oct. 9th, 2018. The new end of Extended Support date is Oct. 10th, 2023. Both can be found here. Microsoft Product Lifecycle Microsoft product lifecycle dictates how […]

More →

Dealing with WordPress’ Unauthenticated Privilege Escalation Vulnerability in a REST API Endpoint

On Thursday, WordPress.org released WordPress 4.7.2, fixing the following four vulnerabilities. The user interface for assigning taxonomy terms in Press This is shown to users who do not have permissions to use it. Reported by David Herrera of Alley Interactive. WP_Query is vulnerable to a SQL injection (SQLi) when passing unsafe data. WordPress core is […]

More →