WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mcvpjd3 on April 15, 2014, 02:58:46 AM

Title: Filecopy and dssetcredent question
Post by: mcvpjd3 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
Title: Re: Filecopy and dssetcredent question
Post by: td 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.
Title: Re: Filecopy and dssetcredent question
Post by: ChuckC 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...
Title: Re: Filecopy and dssetcredent question
Post by: td on April 17, 2014, 10:48:17 AM
Good idea!