Questions tagged [net-use]

Net-use connects or disconnects a computer or a shared drive and controls net connections.

Net-use connects or disconnects a computer or a shared drive and controls net connections.

121 questions
53
votes
2 answers

Why "net use * /delete" does not work but waits for confirmation in my PowerShell script?

I have a script where I want to disconnect from the mapped drives before I create a new PSDrive. Otherwise I get this error: New-PSDrive : Multiple connections to a server or shared resource by the same user , using more than one user name, are…
pencilCake
  • 51,323
  • 85
  • 226
  • 363
16
votes
2 answers

Mapping a network drive and having trouble saving password

I'm running a batch: "net use j: \\192.168.1.241\sausb /user:srvfeskar\administrator Ratata12 /persistent:yes /p:yes" After restarting the windows 8 computer. I need to insert the password again.
13
votes
3 answers

Error 1312 from net use when mapping samba share

I have written a service that monitors if my app is running and starts it if not. In result the app is run as a "system" user - which is the way I want it to be. I have several of those installations working properly. The app should mount a network…
Maciej
  • 161
  • 1
  • 1
  • 7
12
votes
8 answers

PowerShell Test-Path returns False when testing a network share

The user has appropriate permissions to read the share, and the share maps properly. This issue seems to happen only in PowerShell v2.0. If I remove all mapped drives, remap one drive, and run Test-Path: net use /delete * /y net use G:…
user3418092
  • 123
  • 1
  • 1
  • 4
9
votes
1 answer

CFEXECUTE assigning it to run with administrator rights

I am trying to change a password with active directory using cfexecute. The only code on my page is this (username and the new password are filled in):
David Brierton
  • 6,977
  • 12
  • 47
  • 104
8
votes
2 answers

Error 1219. Multiple connections to a server or shared resource by the same user

I am trying to map network drive, but get error 1219 on Windows XP: net use z: \\serverA\tests password /user:serverA\alex I have tried net use * /del /yes But it has no effect, and the net use shows empty list. \\serverA\tests is a valid path,…
alex2k8
  • 42,496
  • 57
  • 170
  • 221
8
votes
2 answers

Vista UAC - Trouble Mapping Network Drives

We have an application that programmatically maps network drives. On Vista with UAC on, we get some strange issues. Our application maps the drive non-elevated, so if the user browses explorer and double clicks to run an exe, it prompts for UAC. …
jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
7
votes
1 answer

Equivalent of net use (to list computer's connections) in powershell?

According to windows help NET USE, when used without options, lists the computer's connections. I'd like to find a way in powershell to get a list of the Remote entries in net use's output. I know that as an extreme measure I can parse the result…
mic.sca
  • 1,688
  • 2
  • 18
  • 34
6
votes
2 answers

Phantom Mapped Network Drive Letter From Windows To Linux

I've been using robocopy and mapped network drives to copy backups across untrusted windows domains to a central location, then push them to a Ubuntu storage device and I'm running into a lot of anomolies. One that I am seeing right now is mapped…
Ali Razeghi - AWS
  • 722
  • 1
  • 6
  • 19
5
votes
2 answers

Error 1219 occurs when I try to map a network drive multiple server

I have a network drive (for instance, G: on Server A). And I am trying to map an additional network drive (H:) to a new server (Server B). I tried the net use command, giving to rise to error 1219 on Window XP. net use h: \\ServerB\docs…
Samuel.P
  • 83
  • 1
  • 1
  • 5
3
votes
2 answers

How do I get disconnected networkdrives in Powershell?

I need to get all mapped networkdrives, even the ones who are currently disconnected. I tried it with Get-PSDrive but that only shows the ones that are currently connected. It is possible get all mapped networkdrives with net use but I can´t reuse…
Manu
  • 83
  • 6
3
votes
1 answer

How to process 'net use' command error output in batch file with a FOR loop?

I'm using net use command in batch file to connect a remote location. I want to store the output of it into a variable and process it. When the command completes successfully, my code works fine. However, if there is some error, like wrong password,…
Abhi
  • 177
  • 1
  • 3
  • 16
3
votes
2 answers

Simple PowerShell script to make a directory share it with everyone permission and map it as a shared network drive

I'm trying to automate a simple but repetitive task for a non-it-literate friend. I'm a TV editor, but I have a simple working knowledge of this, so I appreciate your skill and knowledge. On a Windows PC, with PowerShell available, I'd like a script…
Ogriff
  • 41
  • 1
  • 3
2
votes
2 answers

get status column from "net use" with winapi via C#

When issuing the "net use" command in Windows there is a "Status" column. Is it possible to get that via any of the methods found in the mpr.dll? I'm currently using WNetOpenEnum and then using WNetEnumResource to iterate though the drives that are…
Idaho
  • 241
  • 2
  • 5
2
votes
0 answers

Migrating scripts using "net use" to PowerShell' "New-PSDrive"

I have some scripts that copy files between a local system and a few shares. These scripts use net use to manage their connections. Since net use doesn't allow mutliple connections I have to be careful to execute these scripts in order so that they…
t3chb0t
  • 16,340
  • 13
  • 78
  • 118
1
2 3
8 9