Forum Widgets
Latest Discussions
How do I stop onedrive from being my default directory
I am trying to setup an external hard drive as my default directory for pictures but my computer is forcing me to use onedrive. How can I disable this feature? I am using windows 10. This is what happens. There are no folders in any of the directories.BlueRoccoSep 20, 2020Copper Contributor23KViews3likes5CommentsDetect File Attribute for files on demand (PINNED/UNPINNED)
We try to work with the attributes of files in OneDrive for Business on Windows 10 (1709). This article ha a great overview: https://www.petri.com/managing-onedrive-files-demand-windows-10-fall-creators-update This is a link that documents the attributes flags: https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx I don't find an exact representation of the pinned and unpinned attribute: C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer> attrib /? Displays or changes file attributes. ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [+O | -O] [+I | -I] [+X | -X] [+P | -P] [+U | -U] [drive:][path][filename] [/S [/D]] [/L] + Sets an attribute. - Clears an attribute. R Read-only file attribute. A Archive file attribute. S System file attribute. H Hidden file attribute. O Offline attribute. I Not content indexed file attribute. X No scrub file attribute. V Integrity attribute. P Pinned attribute. U Unpinned attribute. B SMR Blob attribute. [drive:][path][filename] Specifies a file or files for attrib to process. /S Processes matching files in the current folder and all subfolders. /D Processes folders as well. /L Work on the attributes of the Symbolic Link versus the target of the Symbolic Link We want to interact with the files in C and/or C#. This is a sample directory with files and the three states: This is a LS on a folder with different files Directory: C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer Mode LastWriteTime Length Name ---- ------------- ------ ---- -----l XX.XX.XXX 11:09 5386058 o365api.pbix -----l XX.XX.XXX 21:25 18325 test.docx -----l XX.XX.XXX 16:25 (3631219) When-To-Use-What-In-Office-365.pdf This is the attribute as an int: C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer> get-item *.* | % { $_.Attributes } ReparsePoint 525312 4199936 C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer> get-item *.* | % { [int]$_.Attributes } 1024 525312 4199936 The system is capable to represent the cloud only file as a ReparsePoint, but the pinned and unpinned file are not matched. Is there an offical documentation regarding these "missing" flags.Marco ScheelFeb 16, 2018Iron Contributor11KViews3likes4CommentsScript to get EmailID and Force OneDrive Signin
Hello Team, In my Organization we have rolled out OneDrive for Business. We are controlling the OneDrive silent Login using GPOs. There are 1000+ users having different samaccount and EmailID, so Single sign on is not working. We used a Powershell script to fetch the emailID and force the OneDrive login which was working fine, but Powershell is restircted for a OU where we unable to use this PS script. Query: Anyone have VB script or Batch file to fetch the current logged on user email ID and force the OneDrive to Login? Kindly assit.JulieSukiApr 27, 2021Copper Contributor8.2KViews0likes4CommentsListing Files form OneDrive Using Python
Hello, I am trying to build an App in Python that automate files creation and deletion in OneDrive. I decided to use Microsoft Graph API for this. I wrote the following script to get started. import msal import requests import json # Define the MSAL application configuration client_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' authority = 'https://login.microsoftonline.com/common' scope = ['https://graph.microsoft.com/.default'] # Create a PublicClientApplication object app = msal.PublicClientApplication(client_id=client_id, authority=authority) # Check if the user has already signed in accounts = app.get_accounts() if accounts: # Get an access token silently result = app.acquire_token_silent(scope, account=accounts[0]) else: # Sign in and get an access token interactively result = app.acquire_token_interactive(scope) # Get the access token from the result access_token = result['access_token'] headers = {'Authorization': 'Bearer ' + access_token, 'Content-Type': 'application/json'} # url = "https://graph.microsoft.com/v1.0/me" # works just fine url = "https://graph.microsoft.com/v1.0/me/drive/root/children" # send a request response = requests.get(url,headers=headers) # check the status code of the response if response.status_code == requests.codes.ok: print(response.json()) else: # Print the error message if the request failed print(f'Request failed with status code: {response.status_code}') print(response.json()) Fetching the profile information using the URL in line 27 works as expected. However, listing the drive items using the URL in Line 28 gives the following error: {'error': {'code': 'itemNotFound', 'message': 'Item not found', 'innerError': {'date': '2023-04-07T11:58:04', 'request-id': '.........', 'client-request-id': '.........'}}} This is the App permission: Any idea what is going on?DuhaiAlshukailiApr 07, 2023Copper Contributor6.4KViews0likes1CommentHow to enable "Create a link to view and edit user OneDrive files" of all MS365 users on Azure
How to enable "Create a link to view and edit user OneDrive files" for all users in bulk through the shell? We also want a particular user account to access the one drive shared link of all users as that account will post multiple files on users' shared drive on a daily basis. Kindly advise how to give a particular user read/write access to all users' one drive shared link.Omer_FaheemMay 09, 2023Copper Contributor5.9KViews0likes1CommentHow to generate a direct download link from the shared OneDrive link
Dear Experts and Supporters I'm a developer working on an issue related to downloading files from OneDrive. Everything was running fine until a few days ago when I reopened my app Here are my lines // shared OneDrive link example // https://1drv.ms/u/s!Atj71Lw5QEdsrQnTRHMj-fjGc49N?e=hOB5gO if (string.IsNullOrWhiteSpace(sharingURL)) return string.Empty; var base64Value = Convert.ToBase64String(Encoding.UTF8.GetBytes(sharingURL)); var encodedUrl = "u!" + base64Value.TrimEnd('=').Replace('/', '_').Replace('+', '-'); var directlyUrl = $"https://api.onedrive.com/v1.0/shares/{encodedUrl}/root/content"; And now when I cannot download from OneDrive, I have debugged and realized that there was a 401 Unauthorized exception But the file has been shared for Everyone with Edit permissions. I thought Microsoft had changed something about the shared link recently and the current way to get the direct download link as it is now is not possible. The shared link I see it's longer than before and different in format (no s!, no ?e=) So please kindly help me to solve this case. Thanks in advance! Henry Tien (email address removed for privacy reasons)tienitAug 08, 2024Copper Contributor4.6KViews2likes7CommentsOneDrive login issue - When proxy is enabled
Hi Team, I'm using a Titanium web proxy to block the URL from accessing. When I tried to log in the OneDrive with a normal account, it works fine. But, when I tried with 365 accounts, it has the below error. Attached image and code link for your reference. Image: https://prnt.sc/-JQLb00YmGlJ Github: https://github.com/Elanchezhiyan-AIT/BlockURLApp Image: https://prnt.sc/QsEA2W3LdWq1 https://prnt.sc/-JQLb00YmGlJ https://prnt.sc/S7jTJwNl1UUPElanchezhiyanPMar 30, 2023Copper Contributor4.5KViews0likes1Comment