Posts Tagged ‘restore’

I was swapping DB’s on a Citrix cluster , I shutdown the DB’s per


Add-PSSnapin Citrix*
Set-LogSite -State Disabled
Set-LogDBConnection -DataStore Logging -DBConnection $null
Set-MonitorDBConnection -DataStore Monitor -DBConnection $null
Set-MonitorDBConnection -DBConnection $null
Set-AcctDBConnection -DBConnection $null
Set-ProvDBConnection -DBConnection $null
Set-BrokerDBConnection -DBConnection $null
Set-EnvTestDBConnection -DBConnection $null
Set-SfDBConnection -DBConnection $null
Set-HypDBConnection -DBConnection $null
Set-AnalyticsDBConnection -DBConnection $null
Set-ConfigDBConnection -DBConnection $null -force
Set-LogDBConnection -DBConnection $null -force
Set-AdminDBConnection -DBConnection $null -force

When Trying to change to new DB

$dbs = “Server=XXXX;Initial Catalog=XXXX;Integrated Security=True”

set-ConfigDBconnection -dbconnection $dbs

There was an error “There Was a Problem Communicating with the Citrix Delegated Administration Service”

I had to restart the powershell as Admin , then it let me set again

GD Star Rating
GD Star Rating

This enables you to make a change , and if it doesn’t work , the config gets rolled back

config system global
set cfg-save revert
set cfg-revert-timeout 300

(Press Enter)

**Make Change**

If not issue then , change back

config system global
set cfg-save auto

(Press Enter)



In the new firmware, a new option added to GUI for saving configuration, previously this was in CLI only.

Default is automatic, changes apply as made.

Workspace, changes do not commit until saved manually. Workspace + Revert upon timeout, FortiGate reboots and changes revert if not committed within the configured number of seconds. Very useful for remote changes that might cause loss of connectivity.

Adds a new option to save in GUI top right corner


GD Star Rating
GD Star Rating

If the SQL databases are in simple recovery





Backup database dbname

to disk = 'C:\...\dbname.bak'


Restore database dbname

from disk =  'C:\...\dbname.bak'

with recovery, replace





If the databases are in full recovery model


Backup database dbname

to disk = 'C:\...\dbname.bak'

Backup log dbname

to disk = 'C:\...\dbname.trn'

with norecovery


Restore database dbname

from disk = 'C:\...\dbname.bak'

with norecovery, replace

Restore log test2

from disk = 'C:\...\dbname.trn'

with recovery
GD Star Rating
GD Star Rating

Upon restoring a domain controller to a new or isolated network in example a DR environment, the domain controller will lose access to its other domain controllers for replication. You might find you cannot start the DNS server and or Active directory services.

To force the server to start without checking for others modify the below key and reboot the server

 Add the Following reg Key

Value name:  Repl Perform Initial Synchronizations
Value type:  REG_DWORD
Value data: 0

You should then go into Active Directory Sites and services and remove the old Domain Controllers and Also go into the DNS server and remove any references in the Nameserver tabs for the Zones



GD Star Rating
GD Star Rating

On Restore of a Configuration backup , all the jobs started running Full backups in Veeam in folders with _1 in the same directory

Per this

“If a new backup set is created, but the folder containing the original backup set is not moved, deleted, or renamed, new backup files will be stored in a folder named <job name>_1.”

For some reason the backups were ignoring their existing backup sets and starting new ones filling up the drives and creating new VBK Files to resolve this


  1. Stop all the backups running
  2. Delete all the new folders on your Backup Location that were created with _1 , important : ( Check the Created Date as some of the _1 might be old backups )
  3. Go to Backup Infrastructure  , Backup Respositories , and run a rescan on all the repository that will clear these in ( Disk Imported ) 
  4. Now go to each job , edit the properties, Go to Storage , Backup Repository , and click Map Backup and choose the correct Repository for each job

Run a backup again and make sure it’s creating a file into the existing folder


GD Star Rating
GD Star Rating

Veeam[1]After copying a VBK and VBM file from one server to another , after a test restore the following error showed up in the logs and in Gui

Storage version [3701403] is not supported for read-only access.
                               --tr:Failed to open storage for read access. Storage: [\\path\to\file.vbk].
                               --tr:Cannot apply patches stored in folder [HostFS://\\path\to\file.vb[41e6829d-533e-480f-8b38-3726d3fa47a2 (vm-4628)]]
                               --tr:Failed to build restore point.

After my own research ( Trying to copy it locally ) and contacting Veeam support , it turns out the VBK file was corrupt some how. Recopying the file resolved this issue


GD Star Rating
GD Star Rating

Per my backup script before , this restores

You will need to go through and change the values in %


$mailbox = Get-Mailbox %mailbox%
$mailAddress = $mailbox.PrimarySmtpAddress.ToString();
[Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft\Exchange\Web Services\2.1\Microsoft.Exchange.WebServices.dll") | Out-Null
$s = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP1)
$cred = New-Object System.Net.NetworkCredential("%username%","%password%")
$windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$sidbind = "LDAP://<SID=" + $windowsIdentity.user.Value.ToString() + ">"
$aceuser = [ADSI]$sidbind
$s.Credentials = $cred
$MailboxRootid = new-object  Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot,$mailAddress)
$MailboxRoot = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($s,$MailboxRootid)
# Get Folder ID from Path
Function GetFolder()
	# Return a reference to a folder specified by path
	$RootFolder, $FolderPath = $args[0];
	$Folder = $RootFolder;
	if ($FolderPath -ne '\')
		$PathElements = $FolderPath -split '\\';
		For ($i=0; $i -lt $PathElements.Count; $i++)
			if ($PathElements[$i])
				$View = New-Object  Microsoft.Exchange.WebServices.Data.FolderView(2,0);
				$View.Traversal = [Microsoft.Exchange.WebServices.Data.FolderTraversal]::Deep;
				$View.PropertySet = [Microsoft.Exchange.WebServices.Data.BasePropertySet]::IdOnly;
				$SearchFilter = New-Object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo([Microsoft.Exchange.WebServices.Data.FolderSchema]::DisplayName, $PathElements[$i]);
				$FolderResults = $Folder.FindFolders($SearchFilter, $View);
				if ($FolderResults.TotalCount -ne 1)
					# We have either none or more than one folder returned... Either way, we can't continue
					$Folder = $null;
					Write-Host "Failed to find " $PathElements[$i];
					Write-Host "Requested folder path: " $FolderPath;
				$Folder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($s, $FolderResults.Folders[0].Id)
$file = [System.IO.File]::ReadAllBytes("c:\%folder%\%binaryfile%")
$data = [System.Convert]::ToBase64String($file)
#change folder where needed
$folderobject = GetFolder($MailboxRoot, "\Quick Step Settings\");
$folderid = $
$folderchangekey = $
$expRequest = @"
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi=""
    <t:RequestServerVersion Version="Exchange2010_SP1" />
        <t:Item CreateAction="CreateNew" IsAssociated="true">
          <t:ParentFolderId  Id="$folderid" ChangeKey="$folderchangekey"/>
$mbMailboxFolderURI = New-Object System.Uri($s.url)
$wrWebRequest = [System.Net.WebRequest]::Create($mbMailboxFolderURI)
$wrWebRequest.KeepAlive = $false;
$wrWebRequest.Headers.Set("Pragma", "no-cache");
$wrWebRequest.Headers.Set("Translate", "f");
$wrWebRequest.Headers.Set("Depth", "0");
$wrWebRequest.ContentType = "text/xml";
$wrWebRequest.ContentLength = $expRequest.Length;
$wrWebRequest.Timeout = 60000;
$wrWebRequest.Method = "POST";
$wrWebRequest.Credentials = $cred
$bqByteQuery = [System.Text.Encoding]::ASCII.GetBytes($expRequest);
$wrWebRequest.ContentLength = $bqByteQuery.Length;
$rsRequestStream = $wrWebRequest.GetRequestStream();
$rsRequestStream.Write($bqByteQuery, 0, $bqByteQuery.Length);
$wrWebResponse = $wrWebRequest.GetResponse();
$rsResponseStream = $wrWebResponse.GetResponseStream()
$sr = new-object System.IO.StreamReader($rsResponseStream);
$rdResponseDocument = New-Object System.Xml.XmlDocument
$Datanodes = @($rdResponseDocument.getElementsByTagName("m:ResponseCode"))
GD Star Rating
GD Star Rating