Mark Minasi's Tech Forum
Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #1 
We are setting up a folder structure for orders, and because it's detailed we created a template for people to copy.  because of the nature of this template, simply copying the folder and it's subfolders will automatically get it's permissions from the parent, undoing any specific permissions i had set up within the template for certain groups. 

I have tried an xcopy command in a batch file which will work locally being run within the file server but when trying to run from another pc through a share to that location, and with permissions it fails.

i've tried unc pathing, I've tried driveletter$/path, i've even tried mapping to the share then using the mapped drive letter and that fails.

has anyone struggled with this? is it possible to do? 
0
jsclmedave

Administrator
Registered:
Posts: 469
Reply with quote  #2 
Have you tried Robocopy?  I believe that will retain the permissions after the copy is completed.  Long ago I used a script with icacl as well...  I will see if I can find the artcile.
__________________
Tim Bolton @jsclmedave
Email: [string](0..20|%{[char][int](32+('527377347976847978324785847679797514357977').substring(($_*2),2))}) -replace ' '  

New to the forum? Please Read this
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #3 
Well Robocopy isn't something the enduser could run in order to create a copy of the directory.  there are many tools that work great for the admin but what i'm looking for is a way for the user to make a copy of the directory, along with its permissions so they can rename the copy to the order number then start dumping documents into it. 
0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 301
Reply with quote  #4 
Hi,

your problem is probably the user not having the right to set permissions in the target so not being able to apply permissions from the source to the copy. The tools all utilize the same APIs so non of them can circumvent the missing rights.

__________________
Evgenij Smirnov

My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 301
Reply with quote  #5 
That said, you could achieve this by using PowerShell JEA which is not for the faint of heart to configure and maintain.
__________________
Evgenij Smirnov

My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #6 
Wow i'm going to experiment with that.  That makes sense.  I'm not that great with powershell and i would have to create a script that others can run, but since there's only a handful of people who will need to make copies, i'm going to experiment with providing the group temporary full access to see if that allows for the batch file to work, if it does i may have to consider that.  i'll update the string with what I find.  i'll have to give both the group and the share full rights to the directory.
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #7 
hmm forgive my lack of experience in this area.. i'm using the following command in a batch file.  the window pops up and runs the command and then closes but nothing happens.  I then run the batch file from a command prompt from the server itself and i'm getting an invalid drive specification which doesn't really tell me a lot.

the batch file command is

xcopy \\drifs\orders\Units\Units_template \\drifs\orders\Units\test222 /o /x /e /h /k

another issue i get is it asking whether it's a drive or a file in which i would like to resolve for but that's not a big priority right now.
0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 301
Reply with quote  #8 
Quote:
Originally Posted by msandlie

another issue i get is it asking whether it's a drive or a file in which i would like to resolve for but that's not a big priority right now.


Adding /I into the mix should resolve that.

Quote:
Originally Posted by msandlie

i'm getting an invalid drive specification which doesn't really tell me a lot

You really should start using ROBOCOPY as suggested earlier. Try surrounding the UNC path by double quotes.

__________________
Evgenij Smirnov

My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #9 
your right, i'm now trying robocopy, i'm very close to having this resolved.  i'm using the following command and it's working for most, i need to find out why it's not working for a couple of people.

robocopy \\servername\orders\Units\Units_template \\servername\orders\Units\changeme /MIR /Copy😃ATSO


please let me know if you have any suggestions with this command.  i have no idea what DATSO does, i just know it works.  i haven't had any time to research the different tags as i just got this working
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #10 
i'm still having some very odd issues where some can run it, others can't, they all have the same group memberships. 
0
Donato

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 47
Reply with quote  #11 
What's the error message?
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #12 
it's going to be some kind of permission issue I need to work through.  Once i figure it out i'll update you on this. 
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #13 
Fixed..  my command had one too many tags.  I had to remove O from DATSO.  there's no way you can transfer ownership the way i was doing this, nor was it necessary.

i also added another line for it to name the new file during creation which is cool.. 

@echo off
set /p id=Enter New Order Number:
echo %id%
robocopy \\servername\orders\Units\Units_template \\servername\orders\Units\%id% /MIR /Copy😃ATS /log+:\\servername\order-logs$\%id%.txt
0
msandlie

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #14 
BTW thank you everyone who chimed in to help me.  Much appreciated!  and Thanks Mark Minasi for maintaining the forums for us!
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.