Filecopy and dssetcredent question

Started by mcvpjd3, April 15, 2014, 02:58:46 AM

Previous topic - Next topic

mcvpjd3

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

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

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

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade