Category Archives: Office 365

Microsoft 365 – Create an organization library

Alot of posts have been written about the late-2019 rolled out feature to create organization library’s.

After playing around a bit I’ve decided to make a short manual on how to achieve these 2 types of library’s.

General info for this topic I used is:
https://docs.microsoft.com/en-us/sharepoint/organization-assets-library

There are two types of Organization asset types;
1. Office templates
2. Images

The name says it all, one is to use in the office tools, the ‘images’ one you can use to create a subset of images for all people to use while editing SPO pages for example.

To create any or both of these asset types open any SharePoint online site, this can either be a community or teamsite.
On this site create 2 new Document Librarys, by choosing, New -> Documentlibrary
You can decide the names yourself but you chould use someting like ‘Office Templates’ and ‘Default Images’.

Next step is to open PowerShell as administrator.
Make sure you have ‘SharePoint Online Management Shell’ installed. To download: https://www.microsoft.com/en-us/download/details.aspx?id=35588

In PowerShell type;
Connect-SPOService -Url https://tenant-name-admin.sharepoint.com
For the Office Template library:
Add-SPOOrgAssetsLibrary -LibraryURL “https://tenant-name.sharepoint.com/sites/Start/Office Templates” -OrgAssetType OfficeTemplateLibrary
For the Default Images library:
Add-SPOOrgAssetsLibrary -LibraryURL “https://tenant-name.sharepoint.com/sites/Start/Default Images” -OrgAssetType ImageDocumentLibrary

Where Start is your sitename and Office Templates / Default Images are your newly created DocumentLibrary’s.
For the CDN messages you can choose ‘yes to all’, more information on this: https://docs.microsoft.com/en-us/office365/enterprise/use-office-365-cdn-with-spo

The Default Images library should be visible relatively quick, to check this open any SharePoint online site, and choose to edit the Site, browse for an image and you should see ‘Your organization’ listed in the left Menu.

For the Office Templates it’s a little different. Here is the catch, it seems Office 365 version 1908 is not supporting these SharePoint template settings, once you upgrade to version 2005 you will see the template folder immediately.
(To update to newest version make sure you tenants settings are on the curren-channel).
Or you can also run this in an elevated command prompt:
setlocal
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration\ /v CDNBaseUrl if %errorlevel%==0 (goto SwitchChannel) else (goto End)
:SwitchChannel
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration /v CDNBaseUrl /t REG_SZ /d "https://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60" /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration /v UpdateUrl /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration /v UpdateToVersion /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Updates /v UpdateToVersion /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Office\16.0\Common\OfficeUpdate\ /f
:End
Endlocal
pause

Let me know if this helped you out.

SharePoint Online Migration Tool – Scan File Failure:The item created time or modified time is not supported

When migrating to SharePoint Online / OneDrive for business, you could get the error:
Scan File Failure:The item created time or modified time is not supported

This seems because the file or folder doensnt have a (valid) creation date, in my case it had the value “4-3-1601 05:27:48”. To resolve this issue, the files need to get a valid creation / LastAccess date, to achieve this do the following:

# Open PowerShell and typ go to the folder with the files giving the error;
cd "c:\iterrors"

# Check the CreationTimme, LastAccessTim
Get-ChildItem -force | Select-Object Mode, Name, CreationTime, LastAccessTime, LastWriteTime | ft

# Get all files in the folder and change the CreationTime, LastAccessTime and LastWriteTime entry
$modifyfiles = Get-ChildItem -force | Where-Object {! $_.PSIsContainer}
foreach($object in $modifyfiles)
{
$object.CreationTime=("11/11/2019 12:00:00")
$object.LastAccessTime=("11/11/2019 12:01:00")
$object.LastWritetime=("11/11/2011 12:02:00")
}

Sharepoint Migration Tool – Invalid SharePoint Online list

When migrating on premises files to SharePoint Online / OneDrive for Business, Microsoft made a simple tool available ‘SharePoint Migration Tool’.

Sometimes you will get the ‘Invalid SharePoint Online List’ error like;
“Invalid SharePoint Online list ‘Documents'”,”ACTION_STOP”,”0x0201000D”

Thanks to Thomasssssss on this technet topic; https://social.technet.microsoft.com/Forums/en-US/774100d6-9a6b-4e3e-91b5-8f15f38047f4/quotinvalid-sharepoint-online-list?forum=SharePointMigrationTool i found the solution.

So to get this working do the following:

– If not already done, create a new migration in SharePoint Migration Tool and start the migration, when you get the ‘Invalid SharePoint Online list’ error, close the tool
– Go to C:\Users\%username%\AppData\Roaming\Microsoft\MigrationToolStorage\YOURTENANT.onmicrosoft.com\Sessions\SE_RANDOMNUMBER\ and open the session.dat file with notepad.
– Search and replace every “_libraryName”:”Documents” with your local ‘libraryName’, in my case; “_libraryName”:”Documenten” and save the file.
– ReOpen SharePoint Migration Tool and resume the saved migration.

It should work now!

Sharepoint Online – Add members and owners via PowerShell

To add members and owners to a SharePoint Online TeamSite you have the below commands avaiable:

Note that if you need to make someone Owner of the Teamsite, the user first needs to be member! And then you make the user Owner.

#Get Credentials
$credObject = Get-Credential

#Connect to Exchange Online
$ExchOnlineSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credObject -Authentication Basic -AllowRedirection

Import-PSSession $ExchOnlineSession

#Get Groupnames
Get-UnifiedGroup

#Check for current members
Get-UnifiedGroupLinks –Identity "groupname" –LinkType Members

#Check for current owners
Get-UnifiedGroupLinks –Identity "groupname" –LinkType Owners

#Add user as member
Add-UnifiedGroupLinks –Identity "groupname" –LinkType Members –Links info@iterrors.com

#Add user as owner (first make the user ‘member’)!!
Add-UnifiedGroupLinks –Identity "groupname" –LinkType Owner –Links info@iterrors.com

#Remove user as member
Remove-UnifiedGroupLinks –Identity "groupname" –LinkType Members –Links info@iterrors.com -Confirm:$false

#Remove user as Owner (Don’t forget to also remove the Members entry).
Remove-UnifiedGroupLinks –Identity "groupname" –LinkType Owners –Links info@iterrors.com -Confirm:$false

#Extra option, turn off the Welcome Message.
Set-UnifiedGroup "groupname" -UnifiedGroupWelcomeMessageEnabled:$false

We’ve run into a problem with your Office 365 subscription after tenant to tenant migration.

After a tenant to tenant migration multiple people got the message ‘We’ve run into a problem with your Office 365 subscription’.

I found a script wroted by someone on 365labs.net;
How to resolve “We’ve run into a problem with your Office 365 subscription” with PowerShell

So to resolve this issue you start powershell on the PC that has the problems and run the following command.
set-executionpolicy unrestricted

Then create an .ps1 file with the following code


<# .SYNOPSIS This script locates OSPP.vbs and removes all product keys to trigger O365 reactivation. It will remove ALL product keys. .NOTES File Name: Author : Johan Dahlbom, johan[at]dahlbom.eu Blog : 365lab.net The script is provided “AS IS” with no guarantees, no warranties, and they confer no rights. #>
#Check that the script runs with privileged rights
if (-not([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "You need to have Administrator rights to run this script!`nPlease re-run this script as an Administrator in an elevated powershell prompt!"
break
}
#Find OSPP.vbs path and run the command with the dstatus option (Last 1...)
$OSPP = Resolve-Path -Path "C:\Program Files*\Microsoft Offic*\Office*\ospp.vbs" | Select-Object -ExpandProperty Path -Last 1
Write-Output -InputObject "OSPP Location is: $OSPP"
$Command = "cscript.exe '$OSPP' /dstatus"
$DStatus = Invoke-Expression -Command $Command

#Get product keys from OSPP.vbs output.
$ProductKeys = $DStatus | Select-String -SimpleMatch "Last 5" | ForEach-Object -Process { $_.tostring().split(" ")[-1]}

if ($ProductKeys) {
Write-Output -InputObject "Found $(($ProductKeys | Measure-Object).Count) productkeys, proceeding with deactivation..."
#Run OSPP.vbs per key with /unpkey option.
foreach ($ProductKey in $ProductKeys) {
Write-Output -InputObject "Processing productkey $ProductKey"
$Command = "cscript.exe '$OSPP' /unpkey:$ProductKey"
Invoke-Expression -Command $Command
}
} else {
Write-Output -InputObject "Found no keys to remove... "
}

Then you can launch the script via powershell and all should be fine.

Allow synchronisation of files with special characters (like # and %).

Allow synchronisation of files that include special characters in the filenames, like # and %.

Step 1; Download and install the ‘SharePoint Online Management Shell’
link: https://www.microsoft.com/en-us/download/details.aspx?id=35588

Step 2; Open the SharePoint Online Management Shell by searching for ‘sharepoint’ in your startmenu.

Step 3; Run the following command: (replace the values according to the tenant you are connecting to)

$adminUPN="info@iterrors.com"
$orgName="iterrors"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential

Enter the password, click OK and press ENTER.

Step 4; Run the following command:

Set-SPOTenant -SpecialCharactersStateInFileFolderNames Allowed

All done, it can take hours or even a couple of days to get the files to sync after the change.

Office365 – Create a roomlist

If you have multiple rooms in your Exchange Online environment you want to use roomlist(s).

To create a roomlist first connect to powershell:

Connect to Office 365 using Windows Powershell

To create a roomlist enter the below command:
New-DistributionGroup -Name “New RoomList” -Roomlist

You will now have a roomlist, but the list is empty. To add room’s to the list enter the following command:

Add-DistributionGroupMember -Identity “New RoomList” -Member “Room 1”

You will need to enter the above command for each room you want to add to the list.

How to turn Clutter feature on / off for all users via PowerShell

First, connect to Office365 / Exchange via PowerShell.

http://iterrors.com/connect-to-office-365-using-windows-powershell/

To turn Clutter on:
Get-Mailbox | Set-Clutter -Enable $true

To turn Clutter off:
Get-Mailbox | Set-Clutter -Enable $false

To see if it worked, you can get the Clutter status by typing:
Get-Clutter -Identity info@iterrors.com

Office 365 – How to see the creation date of a mailbox via Powershell

Open powershell as administrator and connect to office 365.

See here how to do it:
http://iterrors.com/connect-to-office-365-using-windows-powershell/

Then when connected typ in this command:
get-mailbox -id userID | select whenCreated

Office 365 – Force DirSync synchronisation / update

DirSync will automaticly update passwords every 2 minutes and other users / settings every 3 hours but sometimes you want to force it.

To do that open Windows Powershell and go to:
PS> cd “C:\Program Files\Windows Azure Active Directory Sync\Sync”
PS> .\ImportModules.ps1
PS> Start-OnlineCoexistenceSync

Thats it!