Sharepoint подключить как сетевой диск
Const CONST_strDisk As String = "X:"
Const CONST_strSite As String = "https://_________________/"
Const CONST_strFile As String = "X:\07 КАЧЕСТВО/ACTIONS_OF_THE_DAY2.xlsx"
Dim spMap As Object
Set spMap = CreateObject ( "WScript.Network" )
Set FSO = CreateObject ( "Scripting.FileSystemObject" )
‘MsgBox "Диск " & Disk & " существует = " & FSO.DriveExists(Disk)
If FSO.DriveExists ( CONST_strDisk ) Then spMap.RemoveNetworkDrive CONST_strDisk , True
spMap.MapNetworkDrive strDisk , CONST_strDisk ‘spPath
Delete Excel file in SharePoint 2010 library only by using VBA
У меня есть книга Excel. Когда человек нажимает на марку, файлы сохраняются в двух новых папках, необходимо удалить файл Excel в SharePoint.
Я попытался функцию «Kill» в Excel VBA, но говорит, что файл не существует.
‘You can use this to delete one xls file in the folder Test
On Error Resume Next
On Error GoTo 0
ли какой-либо один имеет успех или пример, убивая файл с помощью VBA ?!
Создан 06 сен. 12 boje
-
2 ответа Сортировка: Активность Возраст Оценка
F irst your code sample points to a file locally stored on a hard drive, not a SharePoint file.
Sharepoint подключить как сетевой диск
В данной инструкции мы пошагово рассмотрим как подключить облако OneDrive с тарифным планом «Для бизнеса», или «Pro Plus» как сетевой диск в Вашу систему Windows. Процедура отличается от тарифных планов «Для дома» и «Personal».
1) Открываем браузер IE (Internet Explorer) и заходим на страницу https://login.microsoftonline.com/.
2) Совершаем авторизацию под Вашими учетными данными Microsoft Office 365.

На пункте с вопросом «Не выходить из системы?» обязательно нажимаем кнопку «Да».

3) Теперь вы перешли в личный кабинет Microsoft Office. Заходим в приложение OneDrive.

Далее, обратите внимание на адресную строку браузера. Скопируйте ее куда-нибудь в блокнот до начала слова «_layouts».

4) Теперь переходим в настройки браузера Internet Explorer. Свойства браузера => Безопасность => Надежные сайты => Сайты.



Теперь вводите туда в доверенные 4 адреса. Вместо «my_login» вводите Ваш url, который был до .sharepoint (без my):
https://my_login.sharepoint.com
https://my_login-my.sharepoint.com
https://my_login-myfiles.sharepoint.com
https://my_login-my-files.sharepoint.com

5) Теперь можно приступить к подключению самого сетевого диска. Из проводника нажимаем правой кнопкой мыши на «Этот компьютер» => Подключить сетевой диск.

В поле ввода «Папка» вставляем адресную строку из страницы OneDrive по инструкции пункта 3. Внимание! До слова _layouts. Обязательно проставляем все галки.

Следующим окном вводите Ваши данные (логин-пароль) от учетной записи Microsoft Office.

На этом собственно все, сетевой диск подключен. Синхронизация в облаке происходит через папку «Documents» в подключенном диске.


Приобрести бессрочную подписку на OneDrive 5ТБ можете в нашем интернет-магазине. Моментальная доставка доставка данных лицензии на Вашу электронную почту. Гарантия. Круглосуточная техподдержка. В состав лицензии входит Word, Excel, PowerPoint, Outlook, OneNote, Publisher, Access, а так же собственно сам доступ в OneDrive на 5 ТБ.
Как подключиться к каталогу файлов Sharepoint через какое-то программное обеспечение, похожее на WinSCP или SmartFTP
Мне нужно загрузить около 2000 файлов с веб-сайта Sharepoint, и мне понадобятся целые годы, загружая файлы один за другим, когда я подключаюсь к веб-сайту через какой-то веб-браузер .
Я бы предпочел использовать что-то вроде Total Commander, WinSCP или SmartFTP . Это адрес сайта Sharepoint:
Должен ли я также написать учетные данные, чтобы вы пытались подключиться к нему? ;-) Я могу сменить пароль в любое время .
Если бы можно было сопоставить каталог Sharepoint с моим ноутбуком в качестве сетевого диска, это также было бы решением .
How to Perfectly Map SharePoint Drive
Get a new level of security for your M365 data with immutable backup copies on any object storage. Try the new Veeam Backup for M365 v7.
Table of Contents
If you use SharePoint, chances are you’re using it as a repository for your documents. You’re probably accessing your document libraries through a web browser. There is another way to access your files in SharePoint. That is to map SharePoint as a network drive to your computer.
In this article, you will learn how to map SharePoint as a network drive on your computer. In turn, your SharePoint site’s contents become accessible through Windows Explorer, PowerShell, and even in the command prompt.
Prerequisites
This article features step-by-step examples. If you follow along with the examples in this article, there are several requirements that you should have in place.
- A Windows 10 computer with Windows PowerShell 5.1 or PowerShell 7+. The examples in this article use PowerShell 7.1 when running commands, but you should be fine using Windows PowerShell 5.1
- Access to a SharePoint Online site and document library that you will map as network drives. This tutorial will be using the poshlab2.sharepoint.com URL for its demo workspace. The SharePoint site is ITOps, and the document library is Case Review, which contains only one document.
- You must install the OneDrive Sync App. This is only required in the section “Using the OneDrive Sync App to Map SharePoint Document Libraries” in this article.
- You may already have OneDrive installed on your computer. Refer to the Which OneDrive app article on how to confirm your OneDrive sync app installation.
Using WebDav to Map SharePoint Drives
WebDav is an older technology that allows clients access to remote web content. In this section, you learn how to map SharePoint drives using Windows Explorer and command prompt. Both of which depend on WebDav to access mapped remote web contents.
Because WebDav depends on the WebClient service, you need to ensure that the service is enabled and running on the computer. The WebClient service is rarely disabled from user computers. If you need to confirm the WebClient service status, you can use one of the steps below.
- Run this command in PowerShell – Get-Service WebClient .

Getting the WebClient service status using Get-Service
- Run this command in command prompt or PowerShell – sc query WebClient .
- Open the Services management console (Start —> Run —> services.msc), and look for the WebClient service.

Getting the WebClient service status using the Services management console.
Preparing Access to Your SharePoint Site
There are two SharePoint locations that you can map as network drives; sites and document libraries. Depending on your requirement and access level, you may want to map entire SharePoint sites or specific document libraries only.
The screenshot below shows a SharePoint Online document library open in the browser.

Finding the SharePoint Site and Library URL
To make the URL’s anatomy abundantly clear below is the breakdown of the SharePoint URL parts from the screenshot above.
- The root SharePoint URL is ‘https://poshlab2.sharepoint.com’
- The site URL is ‘https://poshlab2.sharepoint.com/sites/ITOps’
- The document library URL is ‘https://poshlab2.sharepoint.com/sites/ITOps/Case Review’
Adding your SharePoint URL to Trusted Sites
A requirement to map a SharePoint drive is to add the web site as a Trusted Site on your client computer. Follow these steps to add a trusted site.
- Click on the Start button and type in “internet options” in the search box. Then, click on the Open button.

Opening Internet Options
2. On the Internet Properties window, go to the Security tab. Click on Trusted Sites from the list of zones. Then, click on Sites.

Selecting Trusted Sites
3. Then, in the Add this website to the zone box, type in the SharePoint URL. Click on Add and Close.

Adding a Trusted Site
4. Back on the Internet Properties window, click on OK to close and apply the changes.

Closing the Intenet Properties
Initiating Access to your SharePoint Site
You’ve added the SharePoint URL as a trusted site on your computer. The next step is to access the web site at least once using Internet Explorer so that you may log in first. WebDav does not support other browsers.
- Open Internet Explorer and navigate to your SharePoint site. Log in and select the option to state signed in.

Logging in to the SharePoint site using Internet Explorer
2. When the site loads up, then you’ve completed the preparation to map the SharePoint drive. If not, then you may have entered the wrong credentials.

Accessing the SharePoint site using Internet Explorer
Performing all the preparation steps as shown above is crucial. Skipping the preparation steps will result in the error below. You will not successfully map SharePoint as a network drive as a result.

Getting an Access Denied error when mapping a SharePoint as a network drive
Using Windows Explorer to Map SharePoint as Network Drive
At this point, you’ve already prepared your SharePoint site or library for mapping as network drives. In this section, you’ll create mapped drives using Windows Explorer (GUI). Follow these steps below.
- First, open Windows Explorer. Go to This PC, then on the Computer ribbon, click on Map network drive.
2. On the Map Network Drive window:
- Choose and assign the Drive letter to the SharePoint drive. In this example, the chosen drive letter is drive S.
- In the Folder box, enter the SharePoint site or document library URL.
- To make the network drive persistent, put a check on Reconnect at sign-in. Enabling this option means that your computer will always keep the network drive mapped, even after a reboot.
- Lastly, click on Finish. Because you’ve already logged in to the SharePoint site using Internet Explorer, this step will not ask you to re-authenticate.

Entering the SharePoint Site Details
3. When the mapping process completes, the new network location will be added to Windows Explorer as a mapped network drive.

Confirming the new mapped drive
Mapping a SharePoint Drive using the NET USE command
So far, you’ve learned to map a SharePoint drive using Windows Explorer. Using the same preparations earlier in this article, you can use the net use command to map SharePoint as a network drive.
If you’ve already mapped a SharePoint drive as shown in the previous section, you can list the existing mapped drives using the net use command. As you can see in the screenshot below, the SharePoint drive mapped in the previous section appears in the list.

Getting the list of mapped network drives
The remote location path is not written in normal URL format. Instead of the URL https://poshlab2.sharepoint.com/sites/ITOps/, the path is formatted as \\[email protected]\sites\ITOps.
To add a new mapped drive pointing to your SharePoint online site, use the command below. In the command below, net use is assigning the drive letter T to the remote path. The argument /persistent:yes keeps the mapped drive connected even after a reboot.
Run the command above in Windows PowerShell. If there are no errors, you’ll see a similar result to the one shown below.

Mapping a SharePoint site as a network drive
You’ll then see that the new network drive appears in the list of mapped drives when you rerun net use .

Listing the mapped network drives
The ultimate test to determine if the SharePoint drive mapping is successful is access the contents using the file explores. You can see in the screenshot below, the contents of the SharePoint drive are accessible in Windows Explorer as a mapped network drive T.

Accessing the contents of the mapped SharePoint network drive
Mapping a SharePoint Drive using PowerShell
If you’re more comfortable with PowerShell, you can map a SharePoint drive, too! Using PowerShell is an excellent option if you want to incorporate mapping network drives in a script.
PowerShell can use Component Object Model (COM) objects to perform actions that are not native to PowerShell. There are a variety of COM objects in existence. In this example, the target COM object to use is WScript.Network.
The script below will map the SharePoint object library as a network drive and assign the drive letter X. Also, the mapped drive will be persistent.
Copy the code above and run it in your PowerShell session. The demo below shows you how the code works in real-time.
Your SharePoint network drive may stop working due to reasons such as:
- When you cleared your browser data.
- Your Microsoft 365 credentials expired.
- The SharePoint Online access token issued by Office 365 expires.
Keep an eye on your SharePoint network drives. Don’t forget to re-authenticate from time to time by logging in to your SharePoint site using Internet Explorer.
Using the OneDrive Sync App to Map SharePoint Document Libraries
If you have a Microsoft 365 account, then you might already have access to OneDrive for Business. Did you know you can use the OneDrive Sync App to map and sync SharePoint document libraries to your computer?
To map SharePoint as a network drive using the OneDrive sync app does require WebDav. Hence, you do not have to use Internet Explorer or add a drive letter to your computer. Follow the steps below to map SharePoint as a network drive using the OneDrive sync app.
- First, navigate to the SharePoint document library that you want to map.
2. Then, once inside the document library, click on the Sync button.

Syncing a SharePoint document library
3. If you get a notification saying that the site is trying to open Microsoft OneDrive, click on Open.

Allowing the site to open OneDrive
4. Wait for the sync process to begin. When the sync completes, you should see a toast notification at the bottom right of your screen like the one shown below.

Syncing the document library toast notification
5. At this point, you can now close the browser. Open Windows Explorer, and you’ll find the document library listed on the navigation pane on the left.

Viewing the mapped SharePoint document library
As long as the OneDrive sync client is up and working, the mapped SharePoint document libraries remain synced and accessible.
Next Steps
To map SharePoint as a network drive, you can choose two underlying technologies. The first one is WebDav, which is the older technology. The newer one is the OneDrive client sync, which comes with OneDrive for Business.
In this article, you’ve learned how to use Windows Explorer, net use , COM Object, PowerShell, and the OneDrive sync client to map SharePoint sites and document libraries.
How do you think you can further apply the techniques you’ve learned in this article? Automating your Team’s SharePoint libraries’ network drive mapping using group policies or login scripts would be an excellent next step.
Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.
More from ATA Learning & Partners
Recommended Resources!
Recommended Resources for Training, Information Security, Automation, and more!
Get Paid to Write!
ATA Learning is always seeking instructors of all experience levels. Regardless if you’re a junior admin or system architect, you have something to share. Why not write on a platform with an existing audience and share your knowledge with the world?
ATA Learning Guidebooks
ATA Learning is known for its high-quality written tutorials in the form of blog posts. Support ATA Learning with ATA Guidebook PDF eBooks available offline and with no ads!