次の方法で共有


PowerShell CmdLet to check OneDrive for Business or OneDrive Personal Status

 

My good friend Neil Hodgkinson gave me a challenge: some partners and companies were asking him how to verify the status of OneDrive. He gave me the idea to check the icon of the OneDrive folder and depending on the icon, tell the status. I created a proof-of-concept and then helped some folks at Microsoft Consulting Services to have a PowerShell cmdlet to do so. Not being enough the status of OneDrive using the regular OneDrive synchronization, I also included the status of OneDrive when synchronized via Groove (yes, people still use it).

The project is open source and available in GitHub. To get only the PowerShell cmdlet, download OneDriveLib.dll here. License is MIT and can be found here. It is an open source project so it is not entitled for Microsoft support but I will do my best to respond questions in this post. Just ask them in comments.

 

How to use:

  • Open PowerShell is normal mode (it will not work in Elevated mode for OneDrive own design)
  • Import the module OneDriveLib.dll
  • Run Get-ODStatus

 

Syntax:

Get-ODStatus [-Type <type-pattern>] [-ByPath <path>]

 

Where:

-Type <type-pattern> let you filter by OneDrive type (e.g. Personal or Business) [optional]

-ByPath <path> if the folder information is not in the registry you can test a particular folder (this form will return only a status string)

 

Examples:

Get-ODStatus –Type Business

Get-ODStatus –ByPath c:\user\rodneyviana\onedrive

 

Example of output

 PS C:\ODTool>; Import-Module OneDriveLib.dll
  
 PS C:\ODTool>; Get-ODStatus
  
  
 StatusString : UpToDate
 LocalPath    : E:\MicrosoftOnedrive\OneDrive - Contoso
 UserSID      : S-1-5-21-124012345-708012345-1543012345-802000
 UserName     : CONTOSO\rodneyviana
 ServiceType  : Business1
  
 StatusString : UpToDate
 LocalPath    : D:\Onedrive
 UserSID      : S-1-5-21-124012345-708012345-1543012345-802000
 UserName     : CONTOSO\rodneyviana
 ServiceType  : Personal

Comments

  • Anonymous
    June 07, 2017
    It's great and will be very helpful for my customers
  • Anonymous
    June 07, 2017
    Thanks, great to have this. Just as a side note, in order to use the DLL, make sure you UNBLOCK it via the properties of the file. Basically right click, select unblock and apply. Close and re-open your PowerShell and then follow the instructions.
    • Anonymous
      September 28, 2017
      Scott, thanks for the tip. I just ran import-module and got the error saying the dll is missing. Doh!
  • Anonymous
    June 07, 2017
    What is it's intended return for Work Folders?
    • Anonymous
      June 08, 2017
      Hi Scott,Could you elaborate?
  • Anonymous
    October 04, 2017
    Hey, This is exactly what we are looking for. However as novices require a little guidance on the setup? Ive downloaded the full project but dont understand where to save the files to and successfully run the commands. Please help!
    • Anonymous
      October 12, 2017
      You can download only the module here:https://github.com/rodneyviana/ODSyncService/tree/master/Binaries/PowerShell
  • Anonymous
    October 04, 2017
    Thanks for this. Can you help provide more details on StatusString, like what would be the expected output if user are syncing their Personal OneDrive on their PC or laptop?
    • Anonymous
      October 12, 2017
      Possible values:public enum ServiceStatus { Error, Shared, SharedSync, UpToDate, Syncing, ReadOnly, NotInstalled }
  • Anonymous
    October 06, 2017
    I use that module and got status for all client but several. On several pc's I don't get any results. (win10). Do you have any idea?
    • Anonymous
      October 12, 2017
      You may need to unblock the DLL.UnzipIn Windows Explorer see the DLL propertiesCheck ‘Unblock’
  • Anonymous
    October 23, 2017
    Is great however Get-ODstatus only show me personal information and not the business even if I use the -Type. When I specify -ByPath I can have the business information. Do you have any idea what can be the cause ?
    • Anonymous
      October 30, 2017
      It will show personal (OneDrive) and Business (OneDrive for Business). Per OneDrive design it will only show information about your user. Also per design it will not work if you run in elevated privileges. Not my rules.
  • Anonymous
    October 27, 2017
    So how are you guys going about deploying this? I'm assuming every machine has to have this dll and the command run on it?
    • Anonymous
      October 30, 2017
      Hi Chris,You are correct. It has to be local and it has to run in user context. It will not work in non-interactive way (like a service for example) and it will not work in elevated privileges. OneDrive requirements.
  • Anonymous
    December 12, 2017
    Has anyone been able to apply where-object filtering (or any other) to the output?I've tried all sorts of things and must just be having a moment, or it simply doesn't work. I either get all results back regardless of the filter, or no results back. Nothing in between.There are some Dropbox accounts on the machines being scanned, and it actually picks those up too :)Get-ODStatus –Type Business | where {$.LocalPath -like 'OneDrive'} = Everything BusinessGet-ODStatus –Type Business | where {$.ServiceType -like 'Business1'} = Everything BusinessGet-ODStatus –Type Business | where {$_.StatusString -eq “UpToDate”} = Everything Business, even tho only one has that status.
  • Anonymous
    December 13, 2017
    Get-ODStatusis not giving any output.Not even, Get-ODStatus -Type Business
  • Anonymous
    January 18, 2018
    Hi Rodney, please help. I am not getting any output unless using -ByPath, like Roberto. Also then I get the StatusString value only. What do I need to change?PS C:\Users\schaefpe> import-module -name C:\Users\schaefpe\Downloads\OneDriveLib.dll -verboseVERBOSE: Loading module from path 'C:\Users\schaefpe\Downloads\OneDriveLib.dll'.VERBOSE: Importing cmdlet 'Get-ODStatus'.PS C:\Users\schaefpe> Get-ODStatusPS C:\Users\schaefpe> Get-ODStatus -Type BusinessPS C:\Users\schaefpe> Get-ODStatus -ByPath "C:\Users\schaefpe\OneDrive - MyCorp"UpToDatePS C:\Users\schaefpe>
    • Anonymous
      January 30, 2018
      Hi Peter,I can think of two things: a) You may have not unblocked the DLL after you downloaded from the Internet; b) There is something wrong with your configuration. If you can do the following I may be able to help you.1. Make sure you run PowerShell in regular privileges (elevated privileges does not work with OneDrive and this is by design)2. See if the OneDrive folder(s) are shown when you run this command in PowerShell:ls -s HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager\
      • Anonymous
        April 02, 2018
        Hi Rodney, i am getting not getting any output by running Get-ODStatus this comandlet . please help me .and i have have unblocked the dll file and not running powershell in elevated mode.if i pass the -bypath '***' then i am getting output .and i am not getting what exactly problem is? please help me to get all measures
        • Anonymous
          April 02, 2018
          I have a debug and trace version here: https://github.com/rodneyviana/ODSyncService/tree/master/DebugAndTracesIt may help you identify the issue. Only use this version for troubleshooting as it adds overhead
          • Anonymous
            August 08, 2018
            Hi RodneyI have given below command lets . And one drive is uptodate, but still i am getting output as NotInstalledSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy ByPass -Forceimport-module "C:\users\Devi\OneDrive - corp\Desktop\OneDriveLib (1).dll"$env:USERNAMEGet-ODStatus -Type Business -ByPath "C:\Users$env:USERNAME\AppData\Local\Microsoft\OneDrive"
  • Anonymous
    February 13, 2018
    The comment has been removed
    • Anonymous
      February 13, 2018
      Navigate in Windows Explorer where OneDriveLib.dll is located, right-click and select Unblock and click Ok.
  • Anonymous
    February 27, 2018
    Fantastic! I am running a script by GPO in the user context to pick up the status. It works fine when run manually but by GPO status is always "Not Installed". I have tried with Start-Sleep in the script. Any idea what I am missing or if it is possible at all?Import-Module c:\it\OneDriveLib.dll$UserP= $env:UserProfile$ODStatus = Get-ODStatus -ByPath "$userp\OneDrive - Company"
    • Anonymous
      March 08, 2018
      Jari,Due to the design of OneDrive you have to run as interactive and in non-elevated administrator privileges. To test if you are running your script in elevated privileges:$IsAdmin = [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544")Test if you are in interactive mode:$IsInteractive = [Environment]::UserInteractiveThese is the situation where the script can run:if(-not $IsAdmin -and $IsInteractive){ Get-ODStatus} else{ Write-Host "You need to run in interactive mode and non-admin mode" Write-Host "Now, you are running as - Admin Mode = $($IsAdmin) / Interactive: $($IsInteractive)"}
  • Anonymous
    March 02, 2018
    When executed remotely (which I guess would be the most interesting case) it always returns NotInstalled. Es:$file = "oneDriveLib.dll"$session = New-PSSession -ComputerName $computerNameCopy-Item -Path $file -ToSession $session -Destination 'C:\Windows\System32\oneDriveLib.dll'Invoke-Command -Session $session -ScriptBlock { Import-Module 'C:\Windows\System32\oneDriveLib.dll' Get-ODStatus –Type Business}StatusString : NotInstalled[.]The same command, executed locally, returns:StatusString : UpToDate[..]Is that normal ?
    • Anonymous
      March 08, 2018
      This is by design of OneDrive. It only works in interactive mode. Many people have this challenge and the best way to resolve this is to schedule a new task to run a PowerShell script and update your monitoring system. Make sure that 'Run with highest privilege' is DISABLED as OneDrive also requires this.
  • Anonymous
    March 07, 2018
    When i call Get-ODStatus my screen blinks twice? Someone have the same issue?
  • Anonymous
    April 03, 2018
    When importing the Powershell module I get an error:Import-Module: The specified module 'OneDriveLib.dll' was not loaded because no sound wasin any module directory.
    • Anonymous
      April 04, 2018
      Unblock the DLL as specified in previous conversations
  • Anonymous
    May 29, 2018
    Hi Rodney,Thanks for this great tool. Is there anyway it can check status when OneDrive is running as service using a service account? We managed to run OneDrive using local admin account, but This cmdlet doesn't seem to work.Is it because that interactive thing?
    • Anonymous
      May 30, 2018
      Hi Kang,This is by design. You can only access status for your account. Also you CANNOT run it in elevated privileges.
  • Anonymous
    May 29, 2018
    Hi Rodney, thanks for this great tool.Is it capable to detect OneDrive status when OneDrive runs as a service ?We managed to use task scheduler to run OneDrive using a local admin account as a service. When running this comlet we gets NotInstalled. Is it because of the interactive thing?
    • Anonymous
      May 30, 2018
      That is correct. The best way to resolve your problem is to run the PowerShell as a Windows Task Scheduler's task. Choose to run when user is logged on and DO NOT enable Run with highest privileges
      • Anonymous
        May 30, 2018
        Thanks Rodney for the reply. Then OneDrive is not suitable for our task - a backup agent that runs silently and reports status.Need to find third party client for that task.
  • Anonymous
    May 31, 2018
    Hi Rodney,I have two problems with this tool.1. When i run it on my machine some document libraries show up as ShareSync and some show up as NotInstalled. They are all configured similarly and are definitely installed.2. When i run the script my screen blinks twice.Could you help with that?
    • Anonymous
      June 08, 2018
    1. You cannot run the cmdLet in elevated mode nor in non-interactive mode. The status is only related to the logged user. Read the previous comments to download the debug version of the cmdLet to see what the problems are.2. You may be running this as a Windows task and PowerShell shows a window which may be what you are taking for flicking screen.
      • Anonymous
        June 13, 2018
        Hello Rodney,I read all post...no admin right to check OneDrive status, unblock lib...I run this : Unblock-File -Path "C:\temp\onedrivelib.dll"import-module "C:\temp\onedrivelib.dll"Get-ODStatus -ByPath $env:onedriveresult : NotInstalled....My businessfolder had number 2....is it possible a problem ?I also have SharePoint sync....: status : SharedSync.i download your debug lib...but where are the log please ?Thank you
        • Anonymous
          June 18, 2018
          The log is in %temp%. Choose run, type %temp% and enter. The temp folder should open. Sort by date descending.
          • Anonymous
            August 13, 2018
            Thank you Rodney...found the log file….but not more details who can help me : On Win 7 or 10 with OD configured : result : notInstalled :2018-08-13T09:28:15 Information Testing Type: Native.IIconError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {bbacc218-34ea-4666-9d7a-c78f2274a524}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:28:15 Information Testing Type: Native.IIconUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {f241c880-6982-4ce5-8cf7-7085ba96da5a}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:28:15 Information Testing Type: Native.IIconReadOnly, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {9aa2f32d-362a-42d9-9328-24a483e2ccc3}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:28:15 Information Testing Type: Native.IIconShared, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {5ab7172c-9c11-405c-8dd5-af20f3606282}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:28:15 Information Testing Type: Native.IIconSharedSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {a78ed123-ab77-406b-9962-2a5d9d2f7f30}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:28:15 Information Testing Type: Native.IIconSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {a0396a93-dc06-4aef-bee9-95ffccaef20e}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:28:15 Information Testing Type: Native.IIconGrooveUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {e768cd3b-bddc-436d-9c13-e1b39ca257b1}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:28:15 Information Testing Type: Native.IIconGrooveSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {cd55129a-b1a1-438e-a425-cebc7dc684ee}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:28:15 Information Testing Type: Native.IIconGrooveError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:28:15 Information Testing CLSID: {8ba85c75-763b-4103-94eb-9470f12fe0f7}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:28:15 Information Is Interactive: True, Is UAC Enabled: True, Is Elevated: False2018-08-13T09:28:59 Information Is Interactive: True, Is UAC Enabled: True, Is Elevated: False2018-08-13T09:29:23 Information Testing Type: Native.IIconError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {bbacc218-34ea-4666-9d7a-c78f2274a524}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:29:23 Information Testing Type: Native.IIconUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {f241c880-6982-4ce5-8cf7-7085ba96da5a}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:29:23 Information Testing Type: Native.IIconReadOnly, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {9aa2f32d-362a-42d9-9328-24a483e2ccc3}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:29:23 Information Testing Type: Native.IIconShared, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {5ab7172c-9c11-405c-8dd5-af20f3606282}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:29:23 Information Testing Type: Native.IIconSharedSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {a78ed123-ab77-406b-9962-2a5d9d2f7f30}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:29:23 Information Testing Type: Native.IIconSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {a0396a93-dc06-4aef-bee9-95ffccaef20e}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:29:23 Information Testing Type: Native.IIconGrooveUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {e768cd3b-bddc-436d-9c13-e1b39ca257b1}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:29:23 Information Testing Type: Native.IIconGrooveSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {cd55129a-b1a1-438e-a425-cebc7dc684ee}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:29:23 Information Testing Type: Native.IIconGrooveError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:29:23 Information Testing CLSID: {8ba85c75-763b-4103-94eb-9470f12fe0f7}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:29:46 Information Is Interactive: True, Is UAC Enabled: True, Is Elevated: False2018-08-13T09:29:55 Information Is Interactive: True, Is UAC Enabled: True, Is Elevated: False2018-08-13T09:30:18 Information Is Interactive: True, Is UAC Enabled: True, Is Elevated: False2018-08-13T09:30:31 Information Testing Type: Native.IIconError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {bbacc218-34ea-4666-9d7a-c78f2274a524}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:30:32 Information Testing Type: Native.IIconUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {f241c880-6982-4ce5-8cf7-7085ba96da5a}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:30:32 Information Testing Type: Native.IIconReadOnly, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {9aa2f32d-362a-42d9-9328-24a483e2ccc3}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:30:32 Information Testing Type: Native.IIconShared, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {5ab7172c-9c11-405c-8dd5-af20f3606282}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:30:32 Information Testing Type: Native.IIconSharedSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {a78ed123-ab77-406b-9962-2a5d9d2f7f30}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:30:32 Information Testing Type: Native.IIconSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {a0396a93-dc06-4aef-bee9-95ffccaef20e}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:30:32 Information Testing Type: Native.IIconGrooveUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {e768cd3b-bddc-436d-9c13-e1b39ca257b1}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:30:32 Information Testing Type: Native.IIconGrooveSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {cd55129a-b1a1-438e-a425-cebc7dc684ee}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:30:32 Information Testing Type: Native.IIconGrooveError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:30:32 Information Testing CLSID: {8ba85c75-763b-4103-94eb-9470f12fe0f7}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:32:25 Information Testing Type: Native.IIconError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {bbacc218-34ea-4666-9d7a-c78f2274a524}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:32:25 Information Testing Type: Native.IIconUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {f241c880-6982-4ce5-8cf7-7085ba96da5a}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:32:25 Information Testing Type: Native.IIconReadOnly, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {9aa2f32d-362a-42d9-9328-24a483e2ccc3}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:32:25 Information Testing Type: Native.IIconShared, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {5ab7172c-9c11-405c-8dd5-af20f3606282}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:32:25 Information Testing Type: Native.IIconSharedSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {a78ed123-ab77-406b-9962-2a5d9d2f7f30}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:32:25 Information Testing Type: Native.IIconSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {a0396a93-dc06-4aef-bee9-95ffccaef20e}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T09:32:25 Information Testing Type: Native.IIconGrooveUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {e768cd3b-bddc-436d-9c13-e1b39ca257b1}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:32:25 Information Testing Type: Native.IIconGrooveSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {cd55129a-b1a1-438e-a425-cebc7dc684ee}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T09:32:25 Information Testing Type: Native.IIconGrooveError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T09:32:25 Information Testing CLSID: {8ba85c75-763b-4103-94eb-9470f12fe0f7}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T10:24:20 Information Testing Type: Native.IIconError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {bbacc218-34ea-4666-9d7a-c78f2274a524}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T10:24:20 Information Testing Type: Native.IIconUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {f241c880-6982-4ce5-8cf7-7085ba96da5a}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T10:24:20 Information Testing Type: Native.IIconReadOnly, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {9aa2f32d-362a-42d9-9328-24a483e2ccc3}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T10:24:20 Information Testing Type: Native.IIconShared, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {5ab7172c-9c11-405c-8dd5-af20f3606282}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T10:24:20 Information Testing Type: Native.IIconSharedSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {a78ed123-ab77-406b-9962-2a5d9d2f7f30}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T10:24:20 Information Testing Type: Native.IIconSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {a0396a93-dc06-4aef-bee9-95ffccaef20e}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x02018-08-13T10:24:20 Information Testing Type: Native.IIconGrooveUpToDate, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {e768cd3b-bddc-436d-9c13-e1b39ca257b1}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T10:24:20 Information Testing Type: Native.IIconGrooveSync, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {cd55129a-b1a1-438e-a425-cebc7dc684ee}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x800401542018-08-13T10:24:20 Information Testing Type: Native.IIconGrooveError, Path: C:\Users\USERSXXXX\OneDrive - Compagny2018-08-13T10:24:20 Information Testing CLSID: {8ba85c75-763b-4103-94eb-9470f12fe0f7}, Path: C:\Users\USERSXXXX\OneDrive - Compagny, HR=0x80040154 :
            • Anonymous
              August 14, 2018
              Hi Devi,You are indeed not running in elevated mode (which is the correct way). However you are passing path and type. What do you get if you run:Get-ODStatusWithout parameter?
  • Anonymous
    June 13, 2018
    Hello Rodney,Thank you. I read all posts : run PowerShell with no admin right, current user OneDrive is running on my win 10...i launch : Unblock-File -Path "C:\temp\onedrivelib.dll"import-module "C:\temp\onedrivelib.dll"Get-ODStatus -ByPath $env:onedriveThe result is that my business folder number is : Business2....not installed...if i use : -Type Business : idem...for my business OneDrive folder : Notinstalled.I get your onedrivelib for debug...where are put log please ?Thank you very much.PS : does with this lib, i can pause syncing ?
    • Anonymous
      October 17, 2018
      %TEMP% folder
  • Anonymous
    August 08, 2018
    Output is NotInstalled(But my onedrive is upto date)Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy ByPass -Forceimport-module "C:\users\fa_learn\OneDrive - Bakery\Desktop\OneDriveLib (1).dll"$env:USERNAMEGet-ODStatus -Type Business -ByPath "C:\Users$env:USERNAME\AppData\Local\Microsoft\OneDrive"
  • Anonymous
    September 05, 2018
    Import-Module "C:\script\Bin\OneDriveLib.dll"$message = Get-ODStatuswrite-host $message.StatusString
  • Anonymous
    September 06, 2018
    Hello Rodney, thank you so much for this tool. We have about 1200 computers and we are trying our best to make sure everyone is using and have OneDrive active and 'UpToDate' each day.We have tested the tool and it works great. The next steps for us is to roll out this through PDQ deploy and track through PDQ inventory so that we can quickly see a list of machines/users needing attention so that we don't have missed backups of files. We find that when we run the powershell locally we get correct results. When we trigger the command from, let's say PDQ we end up with different results. We are trying to change some of the options to make it behave the same but we are struggling as of now. The files are all there in the correct order, placement and access as the command produces results (we have it create a file in a folder and the file is the result of the StatusString).any ideas would be welcome as to why we are getting differing results depending upon where and how we run the command.
    • Anonymous
      September 14, 2018
      The comment has been removed
  • Anonymous
    September 11, 2018
    HiI'm missing something here. I can only import it via an elevated prompt but than you say you can only run it from a non-admin elevated prompt….The dll is unblocked etc ...
    • Anonymous
      September 14, 2018
      You should not have to be in elevated privileges to import the module. Can you elaborate on the exact issue you are facing?
  • Anonymous
    September 26, 2018
    Hi Rodney, I've read through this entire blog entry including the comments and it seems we are also running into the issue that many others have experienced. We have verified the check list of requirements - unblock the dll, run as user, run as non elevated, run as interactive. Here are the results we get. I have removed some of the company data. We are seeing this on Win7 and Win10 machines with Office 2013 and O365. Anything else we can try ? PS C:\Users\testuser> whoamiDOMAIN\testuserPS C:\Users\testuser> [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match “S-1-5-32-544”)FalsePS C:\Users\testuser> [Environment]::UserInteractiveTruePS C:\Users\testuser> Import-Module "C:\WINDOWS\System32\OneDriveLib.dll"PS C:\Users\testuser> Get-ODStatusStatusString : NotInstalledLocalPath : C:\Users\testuser\OneDrive - [NAME REMOVED]UserSID : S-1-5-21-[REMOVED]UserName : DOMAIN\testuserServiceType : Business1
    • Anonymous
      September 27, 2018
      Use the debug version of the module and let me know what you see. Get the module here: https://github.com/rodneyviana/ODSyncService/tree/master/DebugAndTraces
      • Anonymous
        September 27, 2018
        Thanks for the reply. We have discovered that the issue on Windows 7 appears to be related to the context we use to run the script in our endpoint management tool. When the user is a non-admin, it works, when the user is an admin, it returns NotInstalled. The workaround is to create a scheduled task to run the script as the user and write the value to a reg key, then gather that reg key into our endpoint management tool.On the Windows 10 side, it appears that the issue is with FilesOnDemand. This is posted as an issue on Github -- https://github.com/rodneyviana/ODSyncService/issues/3When we disable FilesOnDemand it appears that the script works. Is there any way to have Get-ODStatus work when FilesOnDemand are enabled? We would like to use this feature for our Windows 10 boxes.
        • Anonymous
          September 27, 2018
          I will look into it.
        • Anonymous
          October 03, 2018
          I believe I found the correct guid for On Demand: 4E77131D-3629-431c-9818-C5679DC83E81To be sure, can you run the script below and show me the results?ln -s HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager\
          • Anonymous
            October 03, 2018
            Is this the full script? I'm not seeing that work.
          • Anonymous
            October 10, 2018
            Hi Rodney, any updates on what data we can provide to help you fix this?
            • Anonymous
              October 12, 2018
              Hi Matt,See the video just added with step-by-step instructions. If it does not resolve, you will need to open a support case as you may have a special case related to customization that needs deeper investigation.
          • Anonymous
            October 17, 2018
            Hi Rodney - which video is related to Get-ODStatus? I only see one you uploaded in regards to Sharepoint.
            • Anonymous
              October 17, 2018
              Sorry, I thought you were referring to the Workflow problem.
      • Anonymous
        September 27, 2018
        The comment has been removed
        • Anonymous
          October 17, 2018
          It is missing the first lines.
          • Anonymous
            October 17, 2018
            The comment has been removed
            • Anonymous
              October 17, 2018
              The comment has been removed
          • Anonymous
            October 18, 2018
            Results of that command on Windows 10 with FilesOnDemand enabled: Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManagerName Property ---- -------- OneDrive!S-1-5-21-2811813153-2 DisplayNameResource : OneDrive - [NAME REMOVED] 371268842-3616868967-72322!Bus IconResource : C:\Users[USERNAME]\AppData\Local\Microsoft\OneDrive\OneDrive.exe,-501 iness1|182a801485744f7c8d41db1 Flags : 354 504346328 Handler : {71DCE5D6-4B57-496B-AC21-CD5B54EB93FD} BannerNotificationHandler : {2e7c0a19-0438-41e9-81e3-3ad3d64f55ba} CustomStateHandler : {389510b7-9e58-40d7-98bf-60b911cb0ea9} ThumbnailProvider : {021E4F06-9DCC-49AD-88CF-ECC2DA314C8A} UriHandler : {9489FEB2-1925-4D01-B788-6D912C70F7F2} Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager\OneDrive!S-1-5-21-2811813153-2371268842-3616868967-72322!Business1|182a801485744f7c8 d41db1504346328Name Property ---- -------- UserSyncRoots S-1-5-21-2811813153-2371268842-3616868967-72322 : C:\Users[USERNAME]\OneDrive - [NAME REMOVED]
            • Anonymous
              October 18, 2018
              Seems correct. If it is not working, it is something environmental and it is not possible to identify with these logs/information.
  • Anonymous
    October 09, 2018
    Hi ,What does the statustring :SharedSync means ? Can someone please explain
  • Anonymous
    October 23, 2018
    Thanks for a great tool to monitor OneDrive status. I've been using it to log computers having trouble with OneDrive, giving one of the error codes. But for some reason it comes back with status: NotInstalled on clients where the user is local admin. I have been testing it on my client, and although my OneDrive is ok, and I don't run an elevated PS promt (although my user is local admin)...I get status NotInstalled. How can this be avoided ?
    • Anonymous
      October 23, 2018
      See on previous comments how to get the debug version. Use the debug version in the very same condition you use the regular version and post it here.
    • Anonymous
      October 23, 2018
      We have noticed that the status is NotInstalled when we have FilesOnDamand enabled in Win10 1709 or higher. Is this the same in your environment?
      • Anonymous
        October 31, 2018
        Matt G --> yes, same here with Windows 1803. But problem is not constant. On another client where I also have local admin, I get status UpToDate, with 'Files on Demand' on.
        • Anonymous
          November 02, 2018
          I'm seeing same issue on 2 different PCs/tenants. Both W10 1803 with File On-Demand selected. One was saying SharedSync (whatever that means) and after toggling File On-Demand they both now say UpToDate with FOD off and NotInstalled with FOD on. Would love to use this tool until MS delivers something at the tenant level but sadly cannot with my experience thus far.
      • Anonymous
        November 05, 2018
        Seeing the same behavior on two different Win10 1803 PCs in two different tenants with FilesOnDemand enabled. With it enabled it will say NotInstalled and if disabled it will say UpToDate. Although on the one PC with FOD enabled it initially said SharedSync (whatever that means...would like to know) but after toggling FOD off and on it will now say UpToDate if off and NotInstalled if on. Would really like to use this tool as MS offers no visibility into sync status at the tenant level but unable to at the moment because we would like to use FOD.
  • Anonymous
    November 06, 2018
    The comment has been removed
    • Anonymous
      November 06, 2018
      Use the full path to the dll
  • Anonymous
    November 16, 2018
    Hi,The Get-ODStatus command does not work properly for me.On a computer, the status is ERROR while the OneDrive client does not display any anomalies. On another computer, the result of the command is NotInstalled while the OneDrive client is properly installed.That' s too bad because the command seemed to be very practical.
    • Anonymous
      November 20, 2018
      The comment has been removed
    • Anonymous
      December 04, 2018
      Exact same issue. according to me it has nothing to do with unblocking the DLL or other prereqs.Command is/was working on most cmputers and XenApp sessions, but the last couple of days we have a lot more false positive returns of the dll. Maybe because MS has released a new version in the enterprise ring since 22/11.
  • Anonymous
    November 29, 2018
    What dependencies could I be missing? Not about to Import-ModuleImport-Module : Could not load file or assembly 'file:///C:\ODStatus\OneDriveLib.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)This is on Windows 10.
    • Anonymous
      November 29, 2018
      You need to unblock the DLL before use it. Use Windows Explorer and right-click on DLL and unblocked it.
      • Anonymous
        November 29, 2018
        I did unblock it. It is still complaining of dependencies. Do I need to install anything else?
  • Anonymous
    December 11, 2018
    There is a bug regarding the reported status in StatusString when Files-on-Demand is enabled. The incorrect status is reported when Files-on-Demand is enabled. The issue was raised in March 2018 at https://github.com/rodneyviana/ODSyncService/issues/3
  • Anonymous
    January 04, 2019
    Hi I'm uploading a large file to onedrive and I want to check whether is in progress.Is there any cmdlets which helps to get the upload status?
  • Anonymous
    February 15, 2019
    What does the return status mean? Syncing? SharedSync? NotInstalled?Which status translates to "all is working, good to go" and which ones mean "there's a problem"?I thought this Get-ODStatus sounded really good, but I've deployed it to many machines and get a status, but I don't know what the status means. Where can I find a description of each status? So far I only see Syncing, SharedSync, and NotInstalled. I believe "NotInstalled" means "not logged into OneDrive" as I'm only looking at machines with OneDrive.exe. My personal machine shows "SharedSync" and it's up to date, so I'm translating SharedSync as "up-to-date". I haven't yet looked at a machine with a "Syncing" status, but wonder if they might have an issue if they're stuck in that status?
    • Anonymous
      March 21, 2019
      UoToDate is the status you are looking for. It may be on different status temporarily but you should aim at UpToDate
      • Anonymous
        May 06, 2019
        In my experience, when I look at a machine with "NotIntalled" and "SharedSync" status, the OneDrive client often shows as up-to-date. So this tool is no better (or worse, since it gives incorrect information most of the time) than physically (or remotely) looking at each machine to check its status... The reason I came searching for this is that we have clients whose syncs are not working and need to know when this happens so we can fix the issue. Anyone have any suggestions on how to make this tool work--or another tool that would accomplish this?
  • Anonymous
    March 26, 2019
    Firstly, thanks for this. It is very useful. We have rolled this out to 1500 users and in the main part, it appears to be accurate. I have noticed that it returns "Not Installed" for some users that have a fully working client. All users have a standard build so OneDrive is installed in the same place and is the same version for all. Any ideas why only a few would be incorrect?
    • Anonymous
      March 27, 2019
      There is a test version (look at previous comment). Run it to see what is wrong.
  • Anonymous
    April 19, 2019
    I think we might be missing something. Should this return information about the OD sync client being in an error state if it is (i.e. if there's a file that isn't syncing and the OD icon displays a red X)? Every time we run it the status string returns "SharedSync" regardless of the state of the client. We need something that will alert us when a users sync client is in an error state for some reason.Thanks for the help.
    • Anonymous
      April 24, 2019
      If there is an error, the tool will show state as Error.
      • Anonymous
        April 24, 2019
        That was my point. We intentionally put it in an error state by adding a file type that was blocked. The OneDrive icon had a red X over it indicating a sync error. Still, Get-ODStatus reported only "SharedSync". The SharedSync status never changed even after leaving OD in an error state overnight.