Posts

Showing posts with the label powershell

PowerShell Script to Copy File Names to Matching Files in Another Folder

At times in one's digital life, new files are acquired to replace existing ones on a 1:1 basis. I'll leave it to your imagination to think of specific situations, but I have a recurring one, and my normal tool ( Bulk Rename Utility ) didn't have a quick solution. I looked around online, but couldn't find anything I liked enough to steal, so I made my own PowerShell script. It's nothing complex or ground-breaking, but for others with the same need, it should be pretty easy to grab and use. As with any script you didn't write, do not use this in any consequential situation unless you have read through it, fully understand what it's doing, and have performed the appropriate backup tasks.   Requirements Access Requirements : -Write access to destination directory -Read access to source directory Script Language : PowerShell Version : 5.1 Input File? No Other Requirements : -PowerShell execution policy that allows unsigned local scripts -The specified folders m...

Windows PowerShell DNS Backup Script

Summary Several things suck about Microsoft's DNS implentation, but the top two for me have to be security and backups. I don't know how many times I've had to explain to a team that I was not going to give them access to the DNS MMC snap-in because it would mean dozens or hundreds of Deny ACLs on zones in that environment. But that's another post. This post is about DNS backups. After experiencing the kind of event that causes one to review one's DNS backup plan, I found there wasn't a tidy way to back up AD-integrated zones like the options for AD, DHCP, and other infrastructure services. I started with a 36-line .bat file that required modification and an individual scheduled task for each zone that needed to be backed up. With the advent of the basic DNS cmdlets in Server 2008 R2, I moved on to an unholy combination of a PowerShell script that gathered zone info and called my old script in a loop. Not efficient, but it only needed one scheduled task. ...