Tag Archives: Powershell

Unhide group calendar from a Team

12 Nov

By default Teams hides the group calendar from outlook which can be super annoying if you wish to add it as a tab within the Team (Uservoice says full calendar integration is due soon)

To get round this do the following from Powershell (as administrator)

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session -DisableNameChecking

Set-UnifiedGroup -Identity TeamName -HiddenFromExchangeClientsEnabled:$false

Assign Calendar Perms – Powershell

16 Mar

PS C:\Windows\system32> $Cred = Get-Credential

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
PS C:\Windows\system32> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
WARNING: Your connection has been redirected to the following URI:
PS C:\Windows\system32> Import-PSSession $Session -DisableNameChecking

PS C:\Windows\system32> add-mailboxfolderpermission -identity userwhoyouwanttoview@twhf.org.uk:\calendar -user userwhoyouwantohaveaccessto -accessrights editor

FolderName User AccessRights SharingPermissionFlags
———- —- ———— ———————-
Calendar User {Editor}


Rename UPN – O365 Powershell

16 Jan

Login to Windows Azure Active Directory Module for Windows PowerShell with Office 365 administrator credentials and run the following command:

Set-MsolUserPrincipalName -UserPrincipalName mary.osgood@contoso.onmicrosoft.com -NewUserPrincipalName mary.smith@contoso.com

Set-MsolUserPrincipalName : Access Denied.

5 Dec

Most of the time, you see the “Access Denied. You do not have permissions to call this cmdlet” error message because of a non-existent UPN name in the “-UserPrincipalName” parameter.

To verify this, you can combine Get-MsolUser and Set-MsolUserPrincipalName cmdlets to include this validation check to get some more meaningful error message.

I suggest you replace “Set-MsolUserPrincipalName -UserPrincipalName $365 -NewUserPrincipalName $email

with “Get-MsolUser -UserPrincipalName $365 | Set-MsolUserPrincipalName -NewUserPrincipalName $email” and let us know the outcome.

Powershell -Not Digitally Signed Error

16 Nov


Azure/Dir Sync

2 Nov

Sometimes you want to run a manual sync of your Azure/Dir Sync tool, you can do this via powershell using the following command;


Start-ADSyncSyncCycle -PolicyType Delta

Connect to Office365 Powershell

14 Apr

So you may have noticed the incredible new feature that Microsoft have rolled out to your Office 365 tenancy called “clutter”

Pain in the ass.

To disable it and to carry out many of useful admin tasks you can connect to your hosted exchange online using the following instructions – Note Im using Win10 on VMWARE Fusion


Open powershell as administrator

Connect PowerShell to Exchange Online

I always recommend running PowerShell as an administrator. To do that, right click on the PowerShell icon and select Run As Administrator from the context menu.

PowerShell Run As Adminstrator

First we need to set the execution policy.

 C:\> Set-ExecutionPolicy RemoteSigned

Next we need to store our Office 365 credentials in a variable. Type the command below and hit enter.

 C:\> $UserCredential = Get-Credential

A dialog box will appear. Type in your Office 365 credentials and click Ok.

Exchange Online PowerShell Credential Variable

The account you use will need permissions to Exchange Online. By default only Global Administrators in Office 365 have Organization Management rights in Exchange Online.

Now let’s connect. In the command below we put our connection info into a variable. This results in less typing later.

 C:\> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Finally, let’s use that variable to connect to Exchange Online and import all Exchange cmdlets into our session.

 C:\> Import-PSSession $Session

To disable clutter for your whole tenancy run the following command;

Get-Mailbox -ResultSize Unlimited | Set-Clutter -Enable $false

Until next time