Copy file to remote computer using remote admin credentials

前端 未结 2 1630
温柔的废话
温柔的废话 2020-11-30 07:11

I am using C#...

I need the ability to copy a set of files to about 500 unique computers. I have successfully been able to use the LogonUser() method to impersonate

2条回答
  •  时光取名叫无心
    2020-11-30 07:29

    WNetAddConnection2 will do the trick. Just use an empty string for the local device name, to avoid mapping a drive. You also want to make sure and close the connection when you're done. I wrap it into a NetworkConnection class that implements IDisposable.

提交回复
热议问题