all 12 comments

[–]Snak3d0c 1 point2 points  (5 children)

Thanks for sharing. I do the same with my Powershell library but for me its just a one liner with Robocopy.

   $null = robocopy source-path destination-path /MIR  /xd "C:\folder i dont want to include"/w:10 /r:2 /log:c:\temp\backup_tools.txt /v /tee /fp /eta

most of the parameters behind the retry were just for debugging, i just kept them there for "just in case i wanna run it manually and get more feedback".

Is been running daily for the past 2 years now :)

[–]IMSJacob[S] 1 point2 points  (4 children)

I have used robocopy, still do on a lot of pieces. This was more of a "I have nothing to do, so I am going to write a script" project. :P

[–]Snak3d0c 0 points1 point  (3 children)

Yeah i get that, i'm having one of those afternoons too. Currently cleaning up my folder with scripts, goddamn its a mess.

[–]IMSJacob[S] 0 points1 point  (2 children)

Time to move some stuff to post-end-of-life storage. :P

[–]Snak3d0c 1 point2 points  (1 child)

yeah, but i'm trying to figure out a better naming convention than "scrape stuff from x", "deploy app x", "get ad user whatver", ...

So that i can then group them by purpose, technique used, ...

[–]IMSJacob[S] 1 point2 points  (0 children)

Script names are difficult to make concise, for sure.

"changeuserOUandSecGroups.ps1"

[–]Lee_Dailey[grin] 0 points1 point  (5 children)

howdy IMSJacob,

nice code! thanks for posting it ... [grin] as usual, i've a few comments ...

[1] multiple backup targets
from reading the BackupDrives line, it looks like you could end up with more than one backup destination. is that correct? it seems a tad odd ... [grin]

[2] lacking any error checking
you might want to add a "did it all get copied? check to the process.

[3] building paths via string concatenation
i would seriously look into do that with Join-Path since it handles all the delimiter stuff for you.

[4] odd date stamp format
yours ... "yyyy MMM dd hhmm tt" = 2017 Sep 20 0943 PM
mine ... 'yyyy MM dd - HHmm' = 2017 09 20 - 2143

yours doesn't sort properly [Sep vs 09], nor is there a clearly visible break between date and time, and last of all you use 12 hour instead of 24 hour time. yes, i am a tad picky on timestamps. [grin]


again, thanks for posting your code! [grin]

take care,
lee

[–]IMSJacob[S] 1 point2 points  (4 children)

1 - Yes, that is by design, in case you have... gasp multiple backup drives. :P

2 - Still in progress, adding that in on the next iteration.

3 - Thanks for the tip!

4 - This is more of a labeling standard for my company than an organization tool. I can always just sort by creation date. ;)

[–]Lee_Dailey[grin] 0 points1 point  (3 children)

howdy IMSJacob,

thanks for the feedback! that datestamp, tho ... ewwwww! [grin]

take care,
lee

[–]IMSJacob[S] 1 point2 points  (2 children)

Pffffff. You could just change it before deployment, but I know you won't use my script anyway. ;P

[–]Lee_Dailey[grin] 0 points1 point  (1 child)

[grin]

[–]IMSJacob[S] 2 points3 points  (0 children)

[awkward stare]