viewpoint-particle

Author Topic: Filecopy and dssetcredent question  (Read 3011 times)

mcvpjd3

  • Newbie
  • *
  • Posts: 42
Filecopy and dssetcredent question
« on: April 15, 2014, 02:58:46 am »
Hi Folks, need some advice on the following...

We have a share which is currently set to only visible for Domain Admins, however, I need to be able to give a non domain admin the right to copy files to a folder within that share. I was hoping something like this would work...

id="Administrator"
pass="adminpassword"

dssetcredent(id,pass)
filecopy(source,destination,@false)
dssetcredent("","")

However, I'm getting a copyfile error 5 (access denied), what am I doing wrong?

Thanks

td

  • Tech Support
  • *****
  • Posts: 3992
    • WinBatch
Re: Filecopy and dssetcredent question
« Reply #1 on: April 15, 2014, 07:00:44 am »
The dsSetCredent function is part of the ADSI extender and it is used to set the credentials used with other ADSI extender functions when communicating with an LDAP servers like a Windows server that is hosting Active Directory.  It has absolutely no effect on the credentials used by any non ADSI extender functions.

You did not provide any Windows version information but if UAC is involved your options are limited.  If you are dealing with Windows 8.x you have even fewer options. Your best bet may be to setup a share that standard users can copy files to.  You could then create a server side script that moves those files to a more secure area, if security is an issue.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

ChuckC

  • Sr. Member
  • ****
  • Posts: 333
Re: Filecopy and dssetcredent question
« Reply #2 on: April 17, 2014, 09:59:46 am »
Actually, the wntAddDrive() function may well solve the problem as stated by the O.P.

In particular, even if you are logged on as a domain user and the remote server is a domain member, too, if you haven't accessed the remote server recently then using wntAddDrive() with admin credentials specified may solve the problem by establishing an admin identify just for that one remote server session.

Give it a whirl and report back what happens...

td

  • Tech Support
  • *****
  • Posts: 3992
    • WinBatch
Re: Filecopy and dssetcredent question
« Reply #3 on: April 17, 2014, 10:48:17 am »
Good idea!
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade