Five ways to get OneDrive URL for a User in Microsoft 365

There are multiple ways to fetch the OneDrive URL for a user using User Profile through SharePoint Admin panel, through user properties from Microsoft 365 admin Center (also known as Office 365) and through PnP & SharePoint online PowerShell.

Using Microsoft 365 Admin Center

There are two ways to search from Microsoft 365 admin center.

First:

  • From Admin center home page, enter user name in the search box. This will search all users, groups, settings and tasks.
  • Select the user from drop down, it will open the user details dialog right side.
  • Click on Access files link, it will show you the OneDrive URL for the current user. And if you do not have access then it will also assign you administrative access.

Second:

Follow below steps to get OneDrive URL access from active users list from Office 365 Admin Center:

  • From Office 365 Admin Center, click on active Users and search for the user, select user from the search result as shown in below screenshot.
  • User details will be shown on the right side. Click on OneDrive tab and you can get the option to Create Link to files, this will assign administrative access to User’s OneDrive.

Using SharePoint Admin Center

Follow below steps to get OneDrive URL from SharePoint Admin Center:

  • Log in to SharePoint admin and click on More Features, this will open the lead you to user profile service link. (in Old admin panel, User Profile link was listed on left navigation).
  • You might also need to use user profile page to provision OneDrive for a user and can also disable from here. Click Manage User Profile link on the page.
  • Now search by user name and select user profile from the list came from search result. From the search result, click on the menu item “Manage Personal Site” from the context menu.

Using SharePoint Online PowerShell

There are two ways to access OneDrive access for a user Using PowerShell:

SharePoint Online: PowerShell

I am not listing the full powershell script but you can use the blow cmdlets to access Onedrive for a User:

PnP PowerShell:

A simple PowerShell cmdlet from Pnp PowerShell can return you the OneDrive URL of the requested user:

Database Filegroup(s) and Piecemeal Restores in MS SQL Server

Introduction:

Since SQL Server preserves data in a version, those facts need to move somewhere, but where does it shift? In which Filegroups come into play in SQL Server. These are the substantial files on your disc volumes that hold data and can be used for backup and administrative control purposes. An indispensable thing that comes along the way of the database is its security and protection that includes the restoration of the database too. Piecemeal restore process comprises a set of restore step sequences, initiating with the primary and, at least, one secondary read-write filegroups followed by read-only filegroups.

Summary:

The first component to recognize is what types of files SQL Server makes use of:

The Primary Data File is the startup data file holding data in SQL Server and signals to other files present in your database. They have a .mdf extension on them.

Secondary Data Files hold all data that do not relate to the Primary Data File. They only hold user data, and so are user-defined Secondary Files are optional. Moreover, a secondary data file can be used to continue growing the size of the database if it rises above the limited capacity of a single windows file. The recommended extension for these files is a .ndf extension.

Transaction Log Files are the data files containing all logging actions available in the SQL server. Each database must contain at least one logging file. The recommended extension for these files is a .ldf extension.

All data files are preserved in the filegroups cataloged in the following table:

FilegroupDescription
PrimaryThis is the default filegroup. This filegroup accommodates the primary files. All system tables are designated to the primary filegroup.
Memory-Optimized DataA memory-optimized filegroup is positioned on filestream filegroup
User-definedAny filegroup that is pointedly built by the user when the user first creates or later modifies the database.

Every database possesses a primary filegroup. This filegroup has the primary data file and any secondary files that are not part of any other filegroups. User-defined filegroups can be created to categorize data files together for administrative, data allocation, and placement means. For instance, let there are three files named file1.ndf, file2.ndf, and file3.ndf, built on three disk drives, respectively, and appointed to the filegroup named fgroup1. A table can then be created explicitly on the filegroup i.e. fgroup1. The three disks will advance queries for data from the table; this will enhance performance. The same performance enhancement can be achieved by using only one file created on a RAID (redundant array of independent disks) stripe set. However, files and filegroups enable you to add new data to new discs easily.

Rules to be considered while designing Filegroups:

  • A filegroup can be used by only one database. For example, file data.mdf and data.ndf, which has data and objects from the sales database, can be used by only one database.
  • A file can be associated with only one filegroup.
  • Transaction log files can never be a part of any filegroups. Transaction log files can never be a part of any filegroups.

Sometimes, a database restore from the backup is desired. As we know, we do have the choice to restore needed file groups, but not all of the filegroups are needed to make the database online at a specific time. It is always enforced to recover the primary filegroup, but any secondary user-defined file groups are optional, at that instance, while doing the restoration. We can obtain partial data as it is available online after restoring it. We have to wait for the rest of the data to recover other filegroups.

The command RESTORE DATABASE with PARTIAL clause initiates a new piecemeal restore operation. The keyword PARTIAL points that the restore process includes a partial recovery. The partial keyword indicates and starts the partial-restore sequence. This will be validated and authorized during the restoration stages. As the database recovery has been delayed or postponed, so the position of the database remains pending.

To test the concept of piecemeal process, do follow the following steps:

  1. Add another filegroup to preserve the static data. Add a table to the filegroup and insert a few records.
  2. Query the table to validate or authorize the data
  3. To change the filegroup state to read-only, use the “alter” database command and backup the database.
  4. The database has three filegroups, one is read-only, and the other two are in read-write mode. Verify the filegroup status by executing T-SQL and backup the read-only database.
  5. Drop the database to mimic the piecemeal recovery process of the database.
  6. Perform the database restore operation before you start changing the session context to the master database. Now, we are going to do the read-write filegroups restore using the READ_WRITE_FILEGROUPS clause.
  7. Next, restore the read-only filegroups and verify the output by querying the read-only table data.

Conclusion:

Preserving data file groups and database-recovery and healing processes to the requirements of the organization is crucial. For instance, let our SQL Server crashes then we are unable to bring this server up, now we need to recover databases on a separate server and bring them online. The database is enormous, and so recovery might take a few hours to finish. Here the Piecemeal database works. In this technique, we can recover the database on a filegroup level and can minimize the downtime outstandingly.

OneDrive Sync issue: SharePoint Documents Library not syncing

OneDrive sync issue are quite common which stops content from syncing to from local drive to OneDrive and from OneDrive to local drive. There many resultions listed on different blog posts.

Issue

I have recently faced a strange issue where OneDrive for Business Sync client is not working for 3 users, they all syncing content from same document library, there were more users who were sync content from same document library but no issue for them. The sync client halts on few files and do not sync any other content from other libraries and User’s OneDrive.

Troubleshooting

We have taken multiple steps to troubleshoot the issue which are listed below:

  • Verified the sync client version for all users
  • Sync library on my laptop and it synced without any issue but now working on user’s machine
  • Stopped synced and start sync again from same library
  • Unlink the user account from OneDrive and sing in back but still having the same issue
  • Restarted the user machine
  • Executed the OneDrive reset using %localappdata%\Microsoft\OneDrive\onedrive.exe /reset but still having the same issue.

Resolution

The issue resolution was quite simple and we should have done that as very first step during troubleshooting. We went to the document library of one of the user who having issue and followed the below steps

  • Stopped folder sync on the OneDrive client for the folder which causing issues
  • Synced the folder again from SharePoint document library and on the syncing screen we selected “Create a new folder” instead of User this folder.
  • And sync started working without any issue.

The actual issue was with some file which synced on local drives of the which got corrupted for unknow reason (no idea why) and every time when we have started sync it paused the whole sync process after syncing few files.

Below are few useful links to troubleshoot the OneDrive client syncing issue:

Process to Restore SQL Database From Backup In Single User Mode

SQL Server from Microsoft is one of the best and vastly used relational database management system. This application can be used to organize and maintain data. To deal with this powerful application proficiency and experienced are required in Every database administrator. With lots of perks on one side, the SQL database can be corrupted due to various reasons.

In such situations, SQL DBA’s tried to restore SQL database from backups. But What if you don’t have the backups available? So, in that case, the user can take the help of SQL File Recovery Software to resolve the corruption problems related to MDF / NDF files.

So in the upcoming segment, we are going to discuss situations when the user wants to Restore SQL database from backups. Also, we will discuss how to restore SQL database from backup In single-user mode. Before proceeding to the solution part let us first discuss the situations.

Need To Restore SQL Database From Backup

Here are the situations when you need to restore SQL database from backups.

1. If your SQL database gets damaged.

2. If the SQL database is accidentally deleted.

3. Due to the abrupt shutdown, power surges related issues.

4. Storage device failure.

5. SQL Data loss issues due to virus or malware infection.

Know-How to Restore SQL Database From Backups In Single User Mode

Note: Before moving to the restoring process, The user has to put the SQL database in single-user mode. Databases are set to single-user mode because so that only when the user can access the database at a time. Here are the steps to follow to Restore SQL database from backups.

1. First Put the SQL database in Single User Mode

Follow the command below to put the database in single-user mode

ALTER DATABASE database-name SET SINGLE_USER WITH ROLLBACK IMMEDIATE

Executing the ROLLBACK IMMEDIATE command doesn’t wait for the transaction to complete. This will roll back the incomplete transactions immediately.

2. Now Execute the Restore Command

Once the user sets the database to single-user mode, After that the user can run the restore command

RESTORE DATABASE <your database name>

FROM DISK=’Backup location\yourbackup file.BAK

3. After Put the database in the Multiuser Mode

Once the user is done with the restoring of the SQL database, the user can put the SQL database to multiuser mode. To put the SQL database in the multiuser mode, the user can input the following command.

ALTER DATABASE your database name SET MULTI_USER WITH ROLLBACK IMMEDIATE

What To Do, In Case If The Restoration Process Failed

If you won’t be able to perform the restoration process then there are chances that your backup file is corrupted. So, in that case, the user can take the help of SysTools SQL Backup Recovery Software, This is a standalone utility which helps the user to recover corrupt .bak file of SQL database. Also with the help of this application, the user can directly export the SQL database. Here are the salient features of this application.

1. Helps to Preview SQL database tables, views, procedure, functions, etc

2. Supports to repair corrupt SQL backup file.

3. Auto-detects feature to detect the SQL Server version.

4. Supports SQL Bak file 2017 and its below version.

Final Words

In this article, we have discussed how to restore SQL database from backup in single-user mode. Also, we have discussed the situations in which the user tried to restore the SQL database. The user can try the manual way by putting the SQL database in the single-user mode, but in case if your bak file is corrupted then the user can take the help of an automated solution to resolve this issue.

How to fix SQL database corruption after power outage

Introduction:

Sometimes due to the power outage or power shortage, we have to face some hardware or software issues regarding our system (computer). And when you log in again on the system afterward, you see that your most important SQL Server database data is not available. This database is so important to you that your all business accounting and financial records saved in it. One and only one solution remains when he/she has to face this kind of problem. And this solution is to reboot the system many times, sometimes it works, but the working probability of this solution is too low. And system always shows the disputable message that the database not found or corrupted. And sometimes you contact the service provider, and they said this software version is no longer supported. We will show some scenarios through which we can solve this corruption issue. After these scenarios and at the end of this article I will suggest you a software which will solve all your problems with only one to two clicks.

Power out problems

Depending on your production environment, you may have some Power out problems due to this, the server may be shut down, and the database can be corrupt. For this scenario, try to have a UPS for your server or a battery backup system.

Backups

While searching for a solution, the first solution is to have a recent backup of your most important database if you have this one then don’t worry about it. Your SQL server is smart enough to tackle this of problems. It automatically recovers your corrupted database with the help of SSIS or some scripts and saves your entire database but, in case if you have no recent backups now this time you should worry about that you are going to face a huge loss because your database has all kind of transaction and financial records of your business.

Torn Page detected

What is Torn page?

It is a setting to detect database corruption in SQL Server.

It detects failures related to I/O headers that try to access a page that has miswritten to the disk. It reports an I/O message an error (torn page) detected throughout the reading.

Afterward, while searching for a solution when you have no recent backups for your database. You can take a copy of MDF and LDF

Hex editor:

What is the hex editor?

A hex editor allows checking the manipulation of the elemental binary information that constitutes a data file. There are several hex editors on the web that are free like UltraEdit, HxD, BVI, etc.

You find that a table sys.allocation_units which was the part of your database. You can use the hex editors to verify the data corrupted and using the page number edit the data and fix it:

Proposed Solution:

Detach the repaired database from the failing environment. Copy the MDF and LDF files back to the customer’s environment. Recommended scripting the entire database with data and recreating to get it back to a safer position.

Another way to repair is by using the T-SQL commands. You can use the DBCC CHECKDB to check consistency errors in the database and also you can repair your database.

For more information about the DBCC CHECKDB commands, please refer to this link: DBCC CHECKDB (Transaction-SQL)

Alternative Solution:

As I told you at the start of this article that I will suggest you a software which will solve all these kind of problems with only one to two clicks. This software name is Stellar Repair for MS SQL. It repairs corrupt MDF and NDF files and maintains the database integrity.

This SQL Database Recovery Software provides powerful and distinctive options that will address and repair all types of corruption from the SQL database.

The software has excellent features to repair the corrupt MDF and LDF files. It also recovers the modules of databases such as the table’s keys, stored procedures, etc. The beauty of this software is that even you can recover the deleted records from your SQL database.  This software allows a user to save the repaired SQL database in different formats like MS SQL, HTML, CSV, and XLS formats. It supports more than ten versions of MS SQL.

  • While launching this software, the window will look like this.
  • Press Browse to select the corrupted MDF file:
  • Click Repair to start the repairing process
  • After completion, this message popups. Press OK:
  • Now save the file.

The software will repair the database and all the information will be restored.

Conclusion:

In this article, we talked about the most common scenarios to recover a database corrupted due to a power outage. These scenarios are faced by SQL DBAs which is related to database corruption. This type of SQL recovery software can play an important role to fix database corruption. Just try it and you will have a pretty nice experience.

Teamwork in Microsoft 365

Working in teams is an essential part of today’s modern workplace. An increasing number of workers are remote, mobile, or work from different time zones and geographic locations. In this blog post I will share details about Microsoft 365 tools that facilitate teamwork for all workers, no matter where they are located or how they connect to your organization’s resources.

Teamwork tools in Microsoft 365

The nature of teamwork continues to evolve as teams of various shapes and sizes come together for short-term and long-term projects.  Microsoft 365 give your organization the right tools at the right time for the right task, along with common services to help you work fluidly across applications.

The teamwork products benefit from the same enterprise-level security, compliance, and manageability as the rest of Microsoft 365.

Microsoft 365: Universal Toolkit for Teamwork

Outlook:

You must be familiar Outlookemail-based experience which help you stay in touch with colleagues, and share calendars, files, and tasks, to make sure important deliverables get attention.

SharePoint & OneDrive for Business:

You can store your content in the cloud with SharePoint and OneDrive for Business. This lets you access your files on any device and share them with others inside and outside your organization. Because the files are in the cloud, team members can collaborate on them in real time using familiar Office applications like Word, Excel, and PowerPoint.

Microsoft Teams

Microsoft Teamsis the digital hub for teamwork in Microsoft 365. It brings together team conversations and content so your users can stay up-to-date on critical projects. It includes everything teams need to stay connected like chat, phone calls, content, and meetings. It can also be customized with applications and bots that support a given project. With guest access in Teams, you can invite people from both inside and outside your organization to work on projects.

Yammer

Yammeris a community conversation tool designed to help encourage open dialogue, idea generation, and connections across the company. Yammer lets you create communities of interest and forums that bring people together, improve transparency, and give everyone a voice. You can even grant external access to partners and customers as needed.

Microsoft Graph

Microsoft 365 is built on an intelligent fabric that keeps it all connected and secured no matter what app or service you are working in as a team. Microsoft Graphprovides a seamless connection between people and relevant content.

Office 365 Groups

Office 365 Groupsenable a single team identity across apps and services and centralized policy management enhances security and compliance.

SharePoint Online: Classic Vs Modern Search

In this blog post I will try to share the difference between Classic and Moder search in SharePoint online. Search administrators can customize the classic search experience but can do much on modern search as there are not separate search settings for the modern search experience. But certain of the classic search settings also apply to the modern search experience.

Classic sites have classic search boxes and modern sites have modern search boxes. If you believe that modern search gives your users the best experience, influence your organization to start using modern sites.

  Classic Search Modern Search
Search locations Search Center
Publishing sites
Classic team sites  
Hub sites
Modern team sites
Communication sites
SharePoint home page  
Search result Same search resultPersonal search result
Search experience Submit query to see search results Search results show up before typing and update as you type
Search result page Customizable Non-Customizable
Search settings Crawl site content Search
Schema Result source
Remove a search result
Promoted result
Site level search settings
Custom search results (display template, search web parts, query rules) 
Crawl site content
Search schema (except sortable, refinable, company name extraction)
Result source (Tenant level)
Remove search results
Promoted result (only when search across all of Share­Point)

I personally do no prefer customization on Search if there is no specific business need but if there are requirements to customize the search experience as per the business needs and user experience. If you are going to migrate from classic site to modern site then your search customizations will be impacted because as I mentioned earlier in the blog post, classic site has a classic search box and you’ve set up the search box to redirect to a custom Search Center to show results that are filtered and formatted for organization-specific content types. The modern site has a modern search box and you can’t customize the modern search experience. If you don’t need to customize search, we recommend using modern sites.

SQL database error 3241 – the media family on device is incorrectly formed

Introduction

A common error when you try to restore a SQL Server database in any version is the following:

Msg 3241, Level 16, State 0, Line 4
The media family on device ‘c:\SQLBACKUPS\file_13062019.bak’ is incorrectly formed. SQL Server cannot process this media family. Msg 3013, Level 16, State 1, Line 4
RESTORE HEADERONLY is terminating abnormally.

In this article, we will see how to fix this problem.

Requirements

The current article can be applied to any SQL Server. It is also required the following installers:

  • First of all, the SQL Server installer
  • Secondly, the SSMS installer

Getting started

What does the error message mean?

The error message 3241 indicates that the backup is corrupt. The header is corrupt during restoration according to the error message 3013. Level 16 of the error message indicates that the error can be corrected by the user.

How to get more information about the error

To get more information, you can restore with the verifyonly option to see more information about this error.

To do it, you can use the T-SQL to verify if the backup is OK or corrupted:

Reasons for the problem

There can be multiple reasons. Sometimes the backup is corrupt due to a virus, malware, a hacker attack, a problem in the hard drive where the backup is stored. Sometimes, if the backup file is big, the problem can be that the file failed to be copied correctly.

If you have to move the file from one server to another, check the file size and compare the original backup and the backup copied to verify that it is fine.

How to solve the problem

In order to solve the problem, you can try to backup the file again. Sometimes, the file is corrupt because the backup failed.

The following T-SQL sentence backups the database into a file:

If the backup fails again, it may mean that the backup is corrupt. If you want to restore a corrupt database, you can use the Stellar Repair for MS SQL. This SQL database repair software repairs corrupt databases.

How to repair a corrupt database using SQL database repair software

If your database is corrupt, you can download this software to repair your database:

  • The software will ask your MDF file.  The MDF file is the main data file. A physical file that stores the database information.
  • Select the MDF file of the database to repair and press the Repair button:
  • You will be able to see the tables, views, stored procedure, and other database objects:
  • Finally, you can save using the Save icon to different formats like Excel, CSV or SQL Server.

How to restore the corrupt backup

If you do not have the database or if you want to fix the database directly, you can use the Stellar Toolkit for MS SQL.

You can get the installer here.

This software includes the Stellar Backup Extractor for MS SQL. The software repairs a corrupt database with few steps.

  • First of all, select a backup file using the software and press scan:
  • Next, you need to select the BackupSet.  You can check the backup type and date:
  • As you can see, all the SQL Server versions are supported. Even SQL Server 7!
  • If everything is fine, you will receive a success message:
  • You can select the tables and preview the data.
  • You can save the data in SQL Server, CSV file, HTML or Excel:

Conclusion

In this article, we learned how to fix the SQL Server 3241 error. This error is related to corruption in the backup.  The headers usually are corrupted. In the article, we mention multiple solutions. One is to create a backup again, if the database is corrupt you can repair the database with Stellar Repair for MS SQL.

If you do not have access to the database or if you prefer to repair the backup directly, you can use the Stellar Toolkit for MS SQL to repair the backup.

Restricted File Names and File Types in SharePoint Online

There are several file types and keywords which are restricted on SharePoint online. Even if you are migrating content from any external source using SharePoint Migration Tool available for SharePoint Online or through any 3rd party migration tool on OneDrive or SharePoint Online document library,

I am sharing the list of all those Invalid characters, file names, types which are restricted on SharePoint Online and OneDrive for business.

Restrictions Details
Invalid characters If a file or folder contains any of the characters listed below, it may prevent files and folders from syncing. Rename the file or folder to remove these characters before you upload it: * : < > ? / \ |
Invalid file or folder names These names aren’t allowed for files or folders: . lock, CON, PRN, AUX, NUL, COM1 – COM9, LPT1 – LPT9, vti, desktop.ini, any filename starting with ~$.
Invalid or Restricted file types Microsoft recently removed the restriction on file types and now the invalid ore restricted file types can be uploaded to SharePoint Online document library Sync client using OneDrive sync client or any migration tool. These file types will not work until unless custom scripting is enabled on the site collection. .aspx, .asmx, .ascx, .master, .xap, .swf, .jar, .xsf, .htc
Network or mapped drives You can’t add a network or mapped drive as your OneDrive sync location. OneDrive doesn’t support symbolic links where the Link and Target are both located in the same library location.
Elevated privileges OneDrive can’t be run with elevated privileges.
Shared with Me You can’t synchronize the Shared with Me view grouping of files from a OneDrive for Business site.

Update Created, Created by, Modified & Modified fields using SharePoint Online Powershell

You have noticed that when you are migrating content in a SharePoint Document library or list using a migration tool and gives you the option to keep the timestamp and user details for created and modified fields. But if you manually copy few the fields than it would be showing up with you name and recent date.

Using SharePoint Online PowerShell

You can use SharePoint Online or PnP PowerShell cmdlets to update the date and user details for Create and modify fields for a SharePoint list item or document. I have written a PowerShell function UpdateTimestamp which will take site url, list name and create & modified parameter details from the user.

Using Pnp PowerShell

You can also achieve the same task by a simple PnP PowerShell cmdlet as listed below:

I would not recommend you to update these values if there is no need, it will only be required if you need to maintain the original details of the list item. You can also iterate the above script if there are more list items with a little modification.