You have downloaded an Excel document with macros from (known/excepted) website. When you open this Excel file, you get this error: BLOCKED CONTENT Macros in this document have been disabled by your enterprise administrator for security reasons.
There is a possibility System Administrator might have created a GPO to block Macros. If not, there is a easy solution to enable macros in Excel files (that is downloaded or received in Email).
Trust (Unblock) the file and open it in Excel again. Find the Excel file in Explorer, right on the file and open Properties. Check the box for Unblock the file and lick OK to save the setting, like this:
Now, open the Excel document and click on Enable Content button. That’s IT. Enjoy.
Other day Zoom Outlook add-in was trying update itself and keep failing with “The Feature You Are Trying to Use in on a Network Resource That is Unavailable”. It keep asking for downloaded setup/MSI file.
Well…I found the solution that works for me; deleting a Freaking Registry Key. Here it is:
Open Registry Editor
Go to HKEY_LOCAL_MACHINE >> SOFTWARE >> Classes >> Installer
Find the installing software/program name in the hive under Installer key.(e.g., for software find it under Products, for Microsoft update find it under Patches).
Once you find the GUID for the failed software install, Select it and Freaking Delete IT.
There are plenty of software on the market to find duplicate files. Almost all of them list the duplicates and have you review and delete them ONE by ONE. So I decided to write my own PowerShell script to * Find the duplicates by file hash * move the duplicate files to the given location
With a single click, moving the duplicates to a directory was most easy way to deal with duplicates. (I select the files and delete them at once).
Here is the script (example is in the comment section). ENJOY!
<#
___ ___
(o o) (o o)
( V ) Duplicate Remover ( V )
--m-m-----------------------m-m--
This script finds the duplicate files by
file hash and MOVE the duplicate files to
a given location.
You can late review and delete all
duplicate files from the given location.
Script written by: Anand, the Awesome
Parameters:
Path : Directory Path of the files where do you want to check the duplicates
DuplicateFileMoveLocation: Directory Path where to move the duplicate files. If this
directory doesn't exist, it will be created.
Example:
.\DuplicateFinder.ps1 -Path C:\Temp\Myfiles -DuplicateFileLocation C:\Temp\Myfiles\Duplicates
#>
param(
[Parameter(
Mandatory=$True,
ValueFromPipeline=$True,
ValueFromPipelineByPropertyName=$True
)]
[string[]]$Path,
$DuplicateFileMoveLocation = "")
Write-Host "Calculating number of files in $path..."
$TotalCount = (Get-ChildItem $Path).Count
Write-Host $Path "have " $TotalCount " files."
Write-Host "Started finding the Duplicates..."
# Get all duplicate files
$DuplicatePaths =
Get-ChildItem $Path -File |
Get-FileHash |
Group-Object -Property Hash |
Where-Object -Property Count -gt 1 |
ForEach-Object {
Write-Host "Duplicated File: $($_.Group.path)" -ForegroundColor Yellow
$_.Group.Path | Select-Object -First ($_.Count -1)
}
Write-Host ($DuplicatePaths.Count) " Duplicate Files found. `n"
Write-Warning ("The Script found the {0} duplicate files out of {1} total. The duplicates will be moved to {2}." -f $DuplicatePaths.Count, $TotalCount,$DuplicateFileMoveLocation)
$answer = Read-Host -Prompt "Do you want to Proceed (Y or N)?"
if ($answer -eq 'y') {
if ($DuplicateFileMoveLocation -ne "") {
# Create the duplicate file move directory if it does not exist.
if ((Test-Path -Path $DuplicateFileMoveLocation) -eq $false) {New-Item -Path (Split-Path $DuplicateFileMoveLocation -Parent) -Name (Split-Path $DuplicateFileMoveLocation -Leaf) -ItemType "directory" *> $null}
# Move the duplicates
$DuplicatePaths | ForEach-Object {
Write-Host "Moving $($_) to $DuplicateFileMoveLocation..." -ForegroundColor Red
Move-Item -Path $_ -Destination $DuplicateFileMoveLocation
}
}
}
Write-Host "* * * Completed * * *"
<#
End of the Script
#>
I see there where plenty of sites/blogs explains how to convert an Office 365 group to a Teams. Super easy to change it using Teams client. I did not see any reference to other way around. If you find this blog, Good for you.
I see few users created “Teams” in Teams client. They wanted to use the Office 365 group mailbox for that Teams. With Client side settings, there is no options to do that at all. As an Exchange Administrator you can do it in PowerShell.
For every “Teams” created in Teams client, you will see an “Unified Group” aka “Office 365 Group” in Exchange. So all we have to do is change is unhide this Office 365 group for Exchange Outlook users. Here is how you do it (Make sure you connect to Exchange Online first) in PowerShell:
# Replace "TeamsName" with your name of the Teams in double quotes
Set-UnifiedGroup -Identity 'TeamsName' -HiddenFromExchangeClientsEnabled:$false -HiddenFromAddressListsEnabled:$false
After you set to False to both properties, The Teams will show up in Outlook under Groups in Mailbox tree if they are members. Give it plenty of time ( 30 mins ) to take effect of this setting change.
Do you have IMAP/POP3 users? It amazes me to see the some stubborn users refused to use Microsoft Outlook on their Mac/Windows computers. They uses the limited featured IMAP client. Hey! Whatever makes you happy, I guess.
Are they looking for the option “Send event invitations in iCalendar format” in OWA settings? This options converts meeting requests into a iCalendar file attachment.
They are expecting to find the option under
OWA Settings >>> Mail >>> Accounts >>> POP and IMAP
OR
OWA Settings >>> Mail >>> Sync email
I am sure this is the OLD OWA UI.
Instead they are seeing this in the new OWA UI.
So, Where the HELL is “Send event invitations in iCalendar Format” option?
I have learned that user cannot change this settings anymore. BUT as an Exchange Administrator, YOU can change this setting behalf of the user. Here is the PowerShell Command (connect to Exchange Online first):
# Provide the identity as email address of the user
Set-CASMailbox -Identity StoneAgeIMAPuser@acme.com -ImapForceICalForCalendarRetrievalOption:$true -ImapUseProtocolDefaults:$false
Ta..da! Now that stone age IMAP user will start receiving future meeting requests in iCalendar file attachment. Say Hi! to them behalf of me.
If an employee leaves the company, few managers wants the OneDrive content of the ex-employee. Few occasions it is business critical to take the documents from ex-employees’ OneDrive and re-share it again.
So how do you do that? I wrote the following script that does exactly that.
Note: Deleted OneDrive will be purged after 90 days. You can only restore the deleted OneDrive within 90 days of disabled date.
<#
Script to
1. Restore the deleted OneDrive
2. Assign the Restored OneDrive to manager or another employee
IMPORTANT: Replace the OneDrive URL for the variable $DeletedUserOneDriveURL and
admin URL in Connect-SPOService's URL parameter.
Parameters:
DeletedUsername : ex-employees' username or alias (Usually the name in the email address)
NewUserEmail: Who needs to have access to the restored deleted OneDrive
Example:
.\Restore-DeletedOneDrive -DeletedUsername JohnDoe -NewUserEmail Calvin.Hobbes@acme.com
#>
Param($DeletedUsername,$NewUserEmail)
Function Connect-ToSharePoint
{
Import-Module Microsoft.Online.SharePoint.PowerShell
Connect-SPOService -Url https://acme-admin.sharepoint.com
}
<#
-*-*-*-*-*-*-* The Script Starts Here -*-*-*-*-*-*-*-*-*-*
IMPORTANT: Repalce the OneDrive URL for the variable $DeletedUserOneDriveURL
Example OneDrive URL: https://acme-my.sharepoint.com/personal/username_acme_com
In this example, "acme" is the company's Office 365 tag. The email address username@acme.com
is converted to username_acme_come in the end of the URL. If you are in doubt, visit
your OneDrive in Browser, Copy the URL from teh address bar and use it here.
#>
$DeletedUserOneDriveURL = "https://acme-my.sharepoint.com/personal/" + $DeletedUsername + "_acme_com"
# This command will ask for user credentials
"Connecting to SharePoint Online..."
Connect-ToSharePoint
"Restoring the OneDrive: $DeletedUserOneDriveURL"
Restore-SPODeletedSite -Identity $DeletedUserOneDriveURL
"Assigning $NewUseremail to the Deleted OneDrive"
Set-SPOUser -Site $DeletedUserOneDriveURL -LoginName $NewUserEmail -IsSiteCollectionAdmin $True
# -*-*-*- End of the Script -*-*-*-*-*-*
If you need to check if the “Deleted OneDrive” is already purged or not, check with these commands:
#Connect to SharePoint Online : Replace "acme" with your company's Office 365 tag
Connect-SPOService -Url https://acme-admin.sharepoint.com
# List all deleted sites includes OneDrive. Note "Days Remaining" the last column shows how many days left for purging
Get-SPODeletedSite -IncludePersonalSite
# List only the specific user
Get-SPODeletedSite -IncludePersonalSite | ? {$_.url -like '*JohnDoe*'}
I am sure this script and SharePoint commands will be helpful to you. Enjoy.
I ran into this issue of not able to eject an USB disk. Before you ask the question, I have set the disk for “Better Performance”. So I have to eject the disk before I remove it. (FYI, I would suggest to use “Better Performance” for bigger disks like 1TB or above to get most performance).
Now back to the issue, I was trying to eject the disk I am keep getting this error: “Windows is unable to stop the device” or “This device is currently in use”.
I freaking closed all the programs/windows, even killed explorer.exe from Task Manager. I tried logged out and logged back in.
If you run into this issue, I have a fix for you. Thank me later.
Open Disk Management console (either run diskmgmt.msc in Run dialog – Windows Key + R, OR Right click on Start Menu and choose Disk Management).
Find your disk in Disk Management console. Right click on the disk and choose Eject.
If you don’t see Eject, you may see “Offline” option. Then choose Offline, then remove the disk. Next time you connect this disk, you have to go to back to Disk Management and make it Online.
Here is the one-line code to enable or disable the web cam when you want. Here is how it works.
I wrote a one line code and save it as a PowerShell (.ps1) file. Created a batch file to call the PowerShell script files to enable or disable the web cam.
Prerequisite
Open PowerShell and type (or copy/paste). This will display all of your Camera device(s).
Here is the example:
E:> Get-PnpDevice | ? {$PSItem.Class -eq 'Camera'} | fl FriendlyName,InstanceId
FriendlyName : Integrated Camera
InstanceId : USB\VID_04CA&PID_703C&MI_00\7&36726615&0&0000
FriendlyName : S-YUE 8MP USB Camera
InstanceId : USB\VID_0BDA&PID_5075&MI_00\8&3E5D74C&0&0000
Now note down the Instance ID of the current camera (copy it to the clipboard).
Creating the PowerShell and Batch files
Disable Script
PowerShell script file
Type the command below in a Notepad/Editor and replace the InstanceID you noted down above.
Do you want to sync/backup directories that out side of OneDrive sync’ed directory? For example, you have a directory at “D:\SDCard\PortableApps\PNotesPortable” and you want take a backup to OneDrive.
You have come to right place. This works for OneDrive (consumer) as well as OneDrive for Business. Here is how you do it.
Creating a junction for the directory D:\SDCard\PortableApps\PNotesPortable under OneDrive sync’ed location. That’s it.
Open Command Prompt.
Type this:
MKLink /J <OneDrive-Folder-Path> <Full path of the folder you want to sync>
Example:
C:\Users\Awesome>mklink /j "C:\Users\Awesome\OneDrive\Software\PNotes" "D:\SDCard\PortableApps\PNotesPortable" Junction created for C:\Users\Awesome\OneDrive\Software\PNotes <<===>> D:\SDCard\PortableApps\PNotesPortable
Now you will see a Directory junction show up under C:\users\Awesome\OneDrive\Software. That’s all. Now OneDrive will sync this folder content to the cloud.
Here is the wrinke. If you have Full Access permission to a mailbox, when you open the Calendar Properties dialog box and select Permissions in Outlook, you will see a message Some permissions cannot be displayed.
The new Office software updates changed UI look ‘n feel of Sharing Calendar and managing permissions dialog box. They call it “much simpler user experience when sharing a calendar”. The side burn for this new UI update is that there are two sharing scenarios that are no longer supported.
Sharing a calendar if you have Full Access permission to your mailbox
Sharing a calendar if you have Author permission to a mailbox
Sure Microsoft. You had to make our life little harder and call it “much simpler user experience”.