OfficeDocs-SharePoint
OfficeDocs-SharePoint copied to clipboard
Central documentation of OneDrive.exe Command Line Options
Hello,
I have tried to find a listing of OneDrive.exe Command Line Arguments, but I cannot find anything. I tried opening a Microsoft Support case (Case #:1026127313) but they told me that OneDrive and they told me "unfoortunately [sic] there are no Command-line switches for OneDrive", even though there most definitely are. A couple examples of Command-line parameters here.
It would be very helpful to update the Documentation for OneDrive to include some of these similar to this page - Command Line switches for Microsoft Office Products. For example:
Through experimentation and scouring dozens of docs pages, hundreds of computer's activity, and random blogs, I have found this list of Command Line switches/parameters for OneDrive.exe, and there may even be several more, but I have not found them.
/allUsers
/Background
/client=
/configure_business
/configure_business:$tenantID
/firstSetup
/onPrem
/perMachineUpdate
/update
/RemoteBindToObjectWW
/remotedebug
/remoteport
/rz possibly
/silentConfig
/takeover
/url
/url:odopen://
/wait
/OneDrivePid:
/Shutdown
/Reset
These functions could be extremely useful for IT Admins when they are scripting. For example, Onedrive.exe /Shutdown
is extremely useful - it shuts down OneDrive gracefully, and onedrive.exe /background
starts it back up again without throwing up the File Explorer window.
OneDrive.exe /URL:odopen://$SharePointLibraryIDInfo
will start a SharePoint site Syncing through to File-Explorer - mostly silently.
Or, another example, this could be used so that instead of making the user click several layers/pages deep on multiple sites to sync their libraries, the IT Admins could script it to sync the respective directories/sites.
Currently, there is very little way to know what a given parameter like /silentConfig
does though - Does it attempt to login with the settings from Group Policy? Does it Reset the current Profile's OneDrive and THEN try to login with the Registry Settings? Is it happy to just guess that you're logged in as [email protected] - so I'll see if I can SSO in with that?
We need actual documentation on these kinds of these Enterprise tools/features that are already in OneDrive and OneDrive.exe.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 9733a774-90dc-8726-3300-4660a092e427
- Version Independent ID: 3ab12184-9b19-1686-e9d9-a96a93e3fea4
- Content: OneDrive guide for enterprises - OneDrive
- Content Source: OneDrive/plan-onedrive-enterprise.md
- Service: one-drive
- GitHub Login: @kaarins
- Microsoft Alias: kaarins
Thank you for submitting feedback and contributing to the docs. We are currently investigating this.
@PsychoData I'm the new owner of this content. Thanks so much for bringing this to our attention. I absolutely agree that this information would be extremely helpful to Admins. I will get started on creating documentation accordingly. Your feedback is greatly appreciated!
I've been looking all over for this, and I've seen many threads of people asking the same question. I'm glad the documentation is going to be produced. In the meantime, is there a switch for pause and resume sync without shutting down onedrive, or are the switches only for starting a new instance?
One unlisted switch I found in a support doc /reset appears not to do anything. I tested it with a known changed and online file, and the reset switch did not force a sync. This switch may only apply to onedrive for business.
I shotgunned my way into /restart, which causes Onedrive to resync the entire drive. (hard lesson to learn - I have half million objects pending in my sync)
Hey @Slaymeister , you shoud first read the Limits and restrictions (here 300.000) files. So you will get into trouble Second: Reset is do, what it should, Also here an Article for you.
Thank you for this! It was a huge help just the other day. We're just starting to roll out the client and someone thought it'd be a good idea to change our Azure tenant name without researching the potential impact. We use Azure AD SSO w/ Hybrid Joined workstations and domain group policies for configuration so our OneDrive client automatically signs in the Windows user. Some notes that may help others. Using this code running under logged on user context (with some other company specific code) I was able to update my pilot user's OneDrive folders to the new name. Silently re-logged in the user with the new path and Known Folder Move even re-applied.
Get-Process onedrive | Stop-Process -Force
Start-Sleep 5
$regPath = Join-Path -Path 'HKCU:\Software\Microsoft\OneDrive\Accounts' -ChildPath 'Business*' -Resolve
if($regPath){
Remove-Item -Path "$regPath" -Recurse -Force
}
Set-ItemProperty -Path "HKCU:\Software\Microsoft\OneDrive" -Name 'ClientEverSignedIn' -Value 0 -Force | Out-Null
Set-ItemProperty -Path "HKCU:\Software\Microsoft\OneDrive" -Name 'SilentBusinessConfigCompleted' -Value 0 -Force | Out-Null
Start-Process 'C:\Program Files\Microsoft OneDrive\OneDrive.exe' -ArgumentList '/silentConfig /configure_business:<Your TenantID>'
@PsychoData: Wow, I just missed /shutdown
there because while it was in the text but not in the list formatted as code. So I just assumed it had been removed 😅 . If you feel like editing your post, it would be amazing to have it in the list explicitly, too 🤓
Thank you for compiling this!
(Denis Molodtsov over on StackOverflow additionally listed /takeover
and /reset
and maybe most interestingly /odopen:
)
/odopen I knew about, it's how the odopen:// protocol works, which is how SharePoint syncs folders to your local explorer through OneDrive
How did I miss adding /shutdown?? That's the one that I found and started this whole thing with! I'll add that thanks
I made a OneDrive module in PowerShell that does some things with a couple of the parameters, and edit the local config file to remove synced libraries https://www.powershellgallery.com/packages/Onedrive-client https://github.com/PsychoData/Onedrive-Client
Is there any movement with this? Still no idea how many of these switches work, if there are new ones, if any are removed, et cetera
Hello @PsychoData Kevin, we are still working on this
It seems as though the /Background
switch isn't behaving as expected. When users logon to our Azure Virtual Desktop infrastructure they're getting the explorer window popup.
Running OneDrive Build 22.121.0605.0002.
Has there been any movement on this?
Hi, any news please?
Thank you, everyone, for sharing this information. The documentation team has OneDrive command-line options on their list of items to document. Unfortunately, there is not an ETA for when that documentation will be published.
@tiburd Could you please keep this issue open as long as it's not done? I fear that otherwise it could get lost and never be improved :/
@tiburd Could you please keep this issue open as long as it's not done? I fear that otherwise it could get lost and never be improved :/
I understand that perspective/request. However, because our team has confirmed that the documentation team is tracking the issue in their workflow, our process is to close the issue.