Greetings Powershell Gurus –
Here I am again with more Powershell newbie questions. The task I would like to accomplish today is to use NTBackup to backup Active Directory on my domain controller to a file on my file server. Here is a brief summary of my environment:
Domain controller: DC-1 running Windows Server 2003
File server: FS-1 running Windows Server 2003
Here is what I’m thinking:
#Map a network drive
(New-Object -ComObject WScript.Network).MapNetworkDrive("B:","\\FS-1\adbackups")
#Format the date as desired
$date = Get-Date -Format M-d-yyyy
ntbackup.exe backup systemstate /j "DC-1 AD Backup $date" /F "B:\adbackups\DC-1 AD Backup $date.bkf"
I have a couple of questions here.
1. Can someone explain the drive mapping? I found the example and it worked, but I couldn’t explain what exactly it is doing if someone asked.
2. Am I going down the right road with this script?
As always, my apologies for such newbie questions and my sincere gratitude for any and all help/explanations provided.