Habitat OneDrive Monitor

Detailed descriptions and imagery explaining each tool available inside Habitat. Feel free to post feature requests under each tools forum post if you would like to see something added or changed in the tools.
Post Reply
User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Habitat OneDrive Monitor

Post by Cubert »

The Habitat OneDrive Status Monitor
This tool is used to collect and monitor the the status of personal and business OneDrive directory syncs. Automation checks the status and will create an alert that goes to the default Alert Template (23) but can be redirected to any alert template. You can disable alerting for any agent by selecting the OneDrive directory then checking the "Ignore Status" checkbox.


Habitat OneDrive collects and displays Agents OneDrive statuses

OneDriveClientConsole-NewView.PNG
OneDriveClientConsole-NewView.PNG (58.08 KiB) Viewed 12873 times

In the first version of this tool everything is pretty much hardwired. Once you enable the automation of the service it will seek all online Windows (non Server) agents. It will execute a quick scan of the systems if the following conditions are met and will do this 4 times a day.

#1 Agent is a desktop Windows OS at least Windows 7
#2 agent is online
#3 There is an active user, data will only appear if using Onedrive when logged in.

You will only see in the plugin agents that have returned valid OneDrive Data

For us to be able to retrieve the current status Onedrive must be active and inuse on the agent. Thus the script will skip idle/logged off agents during scans. However the automation does try several times a day to collect this data which allows it to catch most if not all agents on a network daily if not several times a day to update drive status.

To Enable this tools scanning services you will open Habitat Automation Services and find the OneDrive Service and enable it. There is a ReScan Button for each client that will force a scan now if you need to seed or capture a particular agent.

There is also the actual script to scan agents available under scripts/maintenance/Habitat OneDrive Status which can be blindly executed on an agent, location or client and will follow the guidelines to scan the agent(s). You can use this script to capture one off agent or use in searches and groups to preform needed tasks.

Selecting an agent will display some basic agent data
OneDriveClientConsole-AgentInfo.PNG
OneDriveClientConsole-AgentInfo.PNG (52.35 KiB) Viewed 12873 times

Selecting a OneDrive Directory will provide data about the status of OneDrive
OneDriveClientConsole-VolumeView.PNG
OneDriveClientConsole-VolumeView.PNG (54.4 KiB) Viewed 12873 times

In the current build, the alternate Alert template setting is manually set via SQL.

To set alternate alert template:

Open the alert templates and acquire the template ID for the template you would like to use. Using the code below in the Habitat SQL analyzer tool, change the value of "69" with the ID of your alert template and execute. This query does not return data.

Code: Select all

REPLACE INTO  plugin_p4a_habitat_properties (`Name`,`Value`)  Values( 'OneDriveAlertTemplate','69')
We will be looking to simplify this selection in later builds.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat OneDrive Monitor

Post by Cubert »

We have found that the Status text reported back may come in different languages depending on your OS type and language settings. This will cause the folder images to show red when the status should be green.

So now in build 1.0.2.23 you can override this value using the habitat properties table.


(In the case of German)
Instead of receiving "Up to date" we receive "Aktuell" which translates to "currentlly" or "current". This does not match "Up to date" so the folder image turns red.

To fix this execute in Habitat SQL Analyzer

Code: Select all

REPLACE INTO plugin_p4a_habitat_properties (`Name`,`Value`) Values('OneDriveStatusText','Aktuell')

TechAtCanoncapital
Posts: 2
Joined: Tue Jul 28, 2020 3:08 pm
3

Re: Habitat OneDrive Monitor

Post by TechAtCanoncapital »

I am testing the onedrive monitor. I opened up the onedrive client console for my company in automate. my computer shows 4 valid onedrive folders, but only 1 of them is green, the other 3 are red. I checked onedrive and everything is syncing properly. Any idea why three would show red?

User avatar
mbeaudet
Posts: 2
Joined: Tue Apr 06, 2021 1:39 pm
2

Re: Habitat OneDrive Monitor

Post by mbeaudet »

I have a similar problem. For all PCs, their OneDrive indicates an error in red even though all are correctly synchronized. Thank you.
2023-09-26_001519.png
2023-09-26_001519.png (549.94 KiB) Viewed 5130 times

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat OneDrive Monitor

Post by Cubert »

Its possible some thing has changed in POSH module.

If you would post or send me a PM/email with the following info I can have a look.

On agent in question, download to c:\temp\ the following POSH module

https://github.com/rodneyviana/ODSyncSe ... iveLib.dll

Next open a powershell windows as a user (not admin) on the same agent and execute the following.

Code: Select all

Unblock-File -Path C:\temp\OneDriveLib.dll
Import-Module  C:\temp\OneDriveLib.dll
Get-ODStatus
Send me the exacts output from this request so we can see if something is reported differently.

Possible values:
public enum ServiceStatus
{
Error,
Shared,
SharedSync,
UpToDate,
Syncing,
ReadOnly,
NotInstalled
}

ray@dominiontech.com
Posts: 3
Joined: Fri Jul 15, 2022 5:24 pm
1

Re: Habitat OneDrive Monitor

Post by ray@dominiontech.com »

I have what appears to be the same thing happening.
Screenshot 2023-10-19 234413.png
Screenshot 2023-10-19 234413.png (40.21 KiB) Viewed 4862 times
The one that works is a Personal Business OneDrive and show "Up to date", "Syncing", etc.. and the icon in File Explorer looks like this
Screenshot 2023-10-19 235010.png
Screenshot 2023-10-19 235010.png (635 Bytes) Viewed 4862 times
The one's that don't work are Teams Channels/SharePoint Library's that are synced to my computer.
Screenshot 2023-10-19 235605.png
Screenshot 2023-10-19 235605.png (43.93 KiB) Viewed 4862 times
They all show "<ERROR>No status text found>" and the icon in File Explorer, looks like this
Screenshot 2023-10-19 235132.png
Screenshot 2023-10-19 235132.png (409 Bytes) Viewed 4862 times
If I go through the process of using the .dll and PowerShell, the results for "Status String" is what I mentioned above and is shown in the image. <ERROR>No status text found>

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat OneDrive Monitor

Post by Cubert »

Ok lest see if we can get some where with this issue.

Below is a small exe that you execute in a non admin command shell. It should spit out all the one drive connections the PC has.

The output looks like:

Screenshot 2023-10-20 091437.png
Screenshot 2023-10-20 091437.png (54.32 KiB) Viewed 4852 times


Run this and post your output here,
StorageApp.zip
(665.03 KiB) Downloaded 113 times

ray@dominiontech.com
Posts: 3
Joined: Fri Jul 15, 2022 5:24 pm
1

Re: Habitat OneDrive Monitor

Post by ray@dominiontech.com »

So, when I run it on my computer in a non-elevated Command Prompt, this is what I get (with some of the strings obfuscated of course).
Screenshot 2023-10-20 191752.png
Screenshot 2023-10-20 191752.png (68.68 KiB) Viewed 4847 times
So, not as verbose as yours.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat OneDrive Monitor

Post by Cubert »

Actually neither are "mine". The same gentlemen that created the OneDriveLib powershell module also created this exe. I am reviewing the bug threads and several people are complaining that its not picking up the enterprise one drives statuses correctly.

I will keep my eyes open to see if they post any updates.

Post Reply

Return to “Habitat Documentation Forum”