Posts Tagged ‘Folder Structure’

We have had a few failures of the power kind (thanks to the electricity provider in South Africa, who will remain nameless). So we have now had to build in further redundancy to cater for this and for other business needs. There is nothing worse than getting a phone call saying that critical services are unavailable at a CRITICAL time. What a nightmare. So a few plans were set in motion.

FINALLY, I got my request for DFS approved. YAY!!!!

So, the process started. Installing DFS for Windows Server 2008 R2 is really simple and was completed in a couple of minutes, however the fun starts after the install and with the configuration of the replicated folders. The above link covers all aspects of the install and “sub” installs and procedures like configuring a namespace and replicated folders.

There is just one little “gotcha” I came across, when I tried to create the first replicated folder, I configured the replication pair with the “root” folder. When I was running through the wizard I got an error when trying to replicate security permissions. The mistake I was making was to include the “root” folder. Do NOT do this. The solution is simple, create the root DFS namespace and create separate replicated folder pairs for each sub folder and then wait for the replication to occur. Awesome!!!!!!

 

So now, for additional redundancy. we have another 3rd party application which handles printing and we need to keep an empty “folder structure” for this somewhere safe in case of a DR situation. This is a requirement placed on us by the Vendor. So, I like powershell, so I decided to create a powershell script to do this for me and, of course, the reverse of creating the “folder structure”. Scripts are below.

 

Create-FolderStructure.ps1

#Create an array with folder objects
$dirs = get-childitem -Recurse | Where {$_.psIsContainer -eq $true}
 
#get folder full names
$dirs | select fullname  | out-file

 

So, now you have the folder structure, Great!!!!

However now you need to re-create the folder structure. What now?

Of course, I have created a scriptt for that.

Create-Folders.ps1

$dirs = Get-Content –Path <path of file from previous script>

foreach ($dir in $dirs)
{
    New-Item -Path $dir -ItemType Directory

}

Hope this helps,

Follow me

facebook-small3222 twitter-small3222

Advertisements