The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

Coordinator
Feb 1, 2012 at 10:30 AM
Edited Feb 2, 2012 at 8:07 AM

If experiencing this error, it typically indicates that you dont have permission to comunicate with this machine by WMI. The script uses WMI.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa394603(v=vs.85).aspx

 Review the link above or remove the reliance on WMI by changing the Get-Folders method with the following (This will be added in the next version):

#Region Check for the existence of the required backup share. Check/Create the required backup directories
function Get-Folders  
{				
	# if backup share not found script will exit.
	# if backup directories not found script will attempt to create them.
	try 
	{
		if (!(Test-Path "\\$backupServer\$backupShare"))
		{
			Halt-OnError "Backup share \\$backupServer\$backupShare not found. Action: Check that the share: $backupShare on server: $backupServer exists and is accessible."
		}
		else 
		{
			Write-Log "Info: Backup share \\$backupServer\$backupShare is present and accessible. Action: No action required."
		}
	}
	catch 
	{	
		$errText = $error[0].Exception.Message
		Halt-OnError "Checking for existence of $backupShare failed. Reason: $errText"
	}
	
	$folders = @($spFarmBackupDirectory, $spSiteBackupDirectory, $iisBackupDirectory, $sp14hiveBackupDirectory, $spLogsBackup, $gacBackupDirectory)	
	
	foreach ($folder in $folders) 
	{
		if (!(Test-Path $folder)) 
		{ 
			try 
			{
				New-Item $folder -type directory -ErrorAction SilentlyContinue
				Write-Log "Info: $folder not present. Action: Folder $folder created." 
			} 
			catch 
			{ 
				$errText = $error[0].Exception.Message
				Halt-OnError "There was a problem creating the folder $folder. Reason: $errText"
			}
		} 
		else 
		{
			Write-Log "Info: $folder present. Action: No action required."
		}
	}
}
#EndRegion