Windows error 0x800706BA, -2147023174

Detailed Error Information

HRESULT analysis[1]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode7 (0x007)
NameFACILITY_WIN32[1][2]
DescriptionThis region is reserved to map undecorated error codes into HRESULTs.[1][2]
Error Code1722 (0x06ba)

This is a Win32 error which has been mapped into an HRESULT. More information may be available in error 0x000006ba.

Questions

74votes
7answers

Try/catch does not seem to have an effect

I am new to powershell, and I am trying to add error handling via try/catch statements, but they don't seem to actually be catching the error. This is powershell v2 CP3. $objComputer = $objResult.Properties; $strComputerName = $objComputer.name write-host "Checking machine: " $strComputerName try { $colItems = get-wmiobject -class "Win32_PhysicalMemory" -namespace [...] read more
powershell
error-handling
47votes
18answers

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

When I run Get-WmiObject win32_SystemEnclosure -Computer hostname | select serialnumber it works for both local and remote hosts. When I do this for a list of hosts using ForEach ($_ in gc u:\pub\list.txt) { Get-WmiObject win32_SystemEnclosure -Computer $_ | select serialnumber | format-table -auto @{Label="Hostname"; Expression={$_}}, @{Label="Service Tag"; Expression={$_.serialnumber}} } [...] read more
powershell
14votes
3answers

WMI: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) throws when try to connect to remote machine

I'm using the following code to connect to remote machine using WMI: ConnectionOptions connOptions = new ConnectionOptions(); connOptions.Impersonation = ImpersonationLevel.Impersonate; connOptions.EnablePrivileges = true; connOptions.Username = "admin"; connOptions.Password = "password"; ManagementScope scope = new ManagementScope(String.Format(@"\\{0}\ROOT\CIMV2", remoteMachine), connOptions); scope.Connect(); I'm getting the following exception: The RPC server is unavailable. (Exception from HRESULT: [...] read more
c#
.net
wmi
12votes
5answers

"The RPC server is unavailable" using WMI query

I have a workgroup of web servers running Server 2008 R2 in which I'm trying to manage a script that checks the disk space of all of them. I had set this up a few months ago when the servers were being set up and I believe it was working [...] read more
c#
asp.net
wmi
rpc
wmi-query
10votes
4answers

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

Occasionally I get this error when working on remote computers. It's hit or miss on which computer I get it on. But I am able to ping the computer and test-connection pans out. For example, the computer I got this error on today I was able to get to yesterday. [...] read more
networking
powershell
10votes
7answers

Catch Exception with Condition

Note: I am very happy to tell you that exception filters are now in the C# 6.0 language. This is a thought experiment, I'm interested in your opinion: Does it make sense to you? Do you know whether something similar has already been proposed for the C# programming language? I [...] read more
c#
exception
syntax
9votes
9answers

Remote WMI connection

I want to connect to remote PC running Windows 7, from another PC using ManagementScope on a local network. On remote PC I've created a new user account "Samuel" without password and set as administrator. ConnectionOptions options = new ConnectionOptions(); options.Username = "Samuel"; options.Password = ""; ManagementScope scope = new [...] read more
c#
wmi
8votes
4answers

Windows 2016: Docker container error

I'm using docker on Windows server 2016, I have created a container using the "microsoft/windowsservercore:latest" image. On this image i have installed "Print-Server" role but when I try to call "Get-Printer" cmdlet I obtain an error with the spooler service. These are the commands used to recreate the problem: docker [...] read more
windows
docker
windows-server-2016
7votes
1answer

Windows Server 2012 member server reports - there is a time or date difference between your computer and the remote computer

PROBLEM Domain member service reports the following when attempting to RDP from any Windows 10 workstation on the same domain or any Windows client from an external source: * > Remote Desktop cannot verify the identity of the remote computer because > there is a time or date difference between [...] read more
windows-server-2012-r2
domain
rdp
internal-dns
rpc
7votes
2answers

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

My application requirement is like below. Application will run on domain admin system which will ping all machine under that domain, it will take disk drive, CPU and RAM details from all domain systems. Whenever I'm trying to ping machine I'm getting error that > "The RPC server is unavailable. [...] read more
c#
wmi
rpc
remote-access
windows-applications
7votes
2answers

BUG: Word 2013 VSTO Cannot Handle Image in Header Formatted Behind or In Front of Text

I am cross-posting this question from Microsoft Community because I haven't gotten any response there, and maybe someone here can shed some light on this. I have noticed an issue that is specific to Word 2013 when using VSTO to process a document. The document contains an image in the [...] read more
c#
ms-word
vsto
com-interop
word-2013
7votes
1answer

Azure Diagnostics not working in my Worker Role

I'm trying to get trace logs for my worker role in windows azure but it's not working and cannot see any error. I've configured my application to use azure diagnostics as explained here: https://www.windowsazure.com/en-us/develop/net/common-tasks/diagnostics/ First, I have this in the app.config of my worker role: <system.diagnostics> <trace> <listeners> <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, [...] read more
azure
azure-worker-roles
diagnostics
azure-diagnostics
6votes
1answer

Unable to cast COM object to interface type 'WUApiLib.UpdateSession c#

I am using WUApiLib.dll, and writing a program to detect which updates can be downloaded and installed. Type t = Type.GetTypeFromProgID("Microsoft.Update.Session", "10.81.4.213"); UpdateSession session = (UpdateSession)Activator.CreateInstance(t); ISearchResult SearchResults = UpdateSearchResult.Search("IsInstalled=0"); foreach (IUpdate x in SearchResults.Updates) { Console.WriteLine(x.Title); } most of the time it works perfectly, but in some cases I [...] read more
c#
.net
casting
wuapi
5votes
1answer

New Domain Controller Cannot Enroll for KerberosAuthentication Certificate

I have an AD domain. 2003 FFL/DFL. The schema was upgraded to version 56 for Server 2012. The domain contains a mix of domain controllers from Server 2003, Server 2008, Server 2008 R2, and now Server 2012. I have an Enterprise Issuing Certificate Authority running 2008 R2. On the Server [...] read more
active-directory
windows
ad-certificate-services
5votes
1answer

How to catch Exceptions with PowerShell

I am getting this error. Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At F:\Code\powershell\network_shutdown\TurnNetworkOff.ps1:19 char:26 + Get-WmiObject <<<< -computername $computer Win32_NetworkAdapter -filter "AdapterTypeId =0" | % { + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand Here is my code #Define variables used in [...] read more
powershell
logging
4votes
4answers

How to use PowerShell and/or Python to restart router?

How to use PowerShell to restart router? My computer is connected to the router using a network cable, the router acts as a modem, it connects to the ISP through PPPoE, my computer is behind NAT. The model of my router: Huawei HS8545M, LAN address: 192.168.1.1, webpage administrator login: CMCCAdmin, [...] read more
windows-10
networking
router
powershell
python
4votes
1answer

The RPC server is unavailable from .NET over AWS

I am trying to access EC2 machines remotely to get some info using C#. I wrote code as below:- ConnectionOptions options = new ConnectionOptions { Username = serverspace.ServerIP + @"\xxxxxx", Password = "xxxxxxx", Impersonation = ImpersonationLevel.Impersonate, EnablePrivileges = true }; ManagementScope scope = new ManagementScope(String.Format(@"\\{0}\ROOT\CIMV2", serverspace.ServerIP), options); scope.Connect(); But an [...] read more
amazon-ec2
wmi
windows
3votes
1answer

Get computername by username

I am trying to find a computername that is used by certain user. To do it I get a list of computers by Get-ADComputer and then ask all of them if there is a user I am looking for logged on. This is my script: $pcs = Get-ADComputer -filter {name [...] read more
powershell
3votes
3answers

Adding remote machine to AD via Powershell

So I have a powershell script, Add-Computer -ComputerName $computername -LocalCredential $computername\admin -DomainName $domain -Credential domain\$username -Force -Restart So if I have a machine that has either fallen off the domain or is disabled, and I run the following command, I get an error: Remove-Computer : Cannot establish the WMI connection [...] read more
windows
active-directory
domain
powershell
3votes
1answer

LDAP reset password from outside the domain network C# Error: RPC server is unavailable. (exception from hresult: 0x800706ba)

We're trying to Reset LDAP password, its working on development environment but not working on production environment. Our development environment is inside the Domain and production environment is outside the Domain. In development to connect LDAP, we have used Domain name like abc.com and production environment we use IPaddress:389, which [...] read more
c#
asp.net
asp.net-core
authentication
ldap
3votes
4answers

The rpc server is unavailable (exception from hresult : 0X800706BA)

My application scan through the excel files and generate a report having count of Activex controls in each excel file. But while running the tool from client machine we are getting an error on opening the file (for some file not all) and the files are located in the sever [...] read more
vb.net
excel
2votes
1answer

Change certificate auto enrollment settings from long gone CA to new CA

We started getting event ID 13 from a our domain controllers: > Certificate enrollment for Local system failed to enroll for a > DomainController certificate with request ID N/A from > OLDSERVER.domain.local\oldserver (The RPC server is unavailable. 0x800706ba > (WIN32: 1722)). OLDSERVER was a 2003 domain controller and certificate services [...] read more
windows
certificate-authority
2votes
0answers

RPC Server unavailable. 0x800706BA

I've alsready seen some similar threads on the RPC server unavailable messages; HRESULT: 0x800706BA. I've read some and looked at the recommendations on this thread; WMI query between two different AD sites? While there were some helpful hints it doesnt quite fit my questions... I'm using an endpoint security platform [...] read more
windows-server-2008
domain-name-system
wmi
rpc
endpoint
2votes
1answer

InternetExplorer COMException: System.Runtime.InteropServices.COMexception: The RPC server is unavailable

I'm very new to C# so please excuse me if it's a silly question. I created a console application that uses the "InternetExplorer" from SHDocVw. This application goes to a website and performs some operations. It works just fine on my computer, but when I try to publish it I [...] read more
c#
.net-core
console-application
2votes
2answers

'The RPC server is unavailable.' when looping through word documents

I am working on a utility to find and update DOC VARIABLES in Word. I have a section of code to loop through the documents and present a Message Box with the variable name, but I'm receiving an error when it tries to open the next document. The error is: [...] read more
vb.net
ms-word
office-interop
2votes
1answer

Powershell Workflow to reboot computers

Code: workflow Test-RemoteReboot{ param ([string[]]$serverNames) foreach -parallel($server in $serverNames){ Restart-Computer -PSComputerName $server -Wait -Force } } Test-RemoteReboot SP,SP2 Issue: this is a small excerpt from a pretty long workflow I built in powershell. By all accounts, this should work but I get the following error (even when running this script [...] read more
powershell
2votes
1answer

How do I connect to a remote VisualSVN server?

I am trying to use VisualSVN and PhpStorm to connect to a remote VisualSVN Server. I have the IP address to the machine, and I have specified the path to the machine in both programs. The paths I have tried: svn://ip.ad.dr.ess/c:/Repositories svn+ssh://ip.ad.dr.ess/c:/Repositories In Visual SVN, I receive Cannot connect to [...] read more
svn
phpstorm
remote-server
visualsvn-server
visualsvn
2votes
1answer

Azure webroles recycle after configuration change despite handling the RoleEnvironment.Changing event and setting Cancel to false

When changing some of the configuration settings of a webrole, the RoleEnvironment.Changing event is triggered. As far as I understand it, if Cancel is set to false in the RoleEnvironmentChangingEventArgs, the role should not recycle and the changes are just accepted and should be applied as soon as the RoleEnvironment.Changed [...] read more
azure
azure-web-roles
2votes
1answer

Connecting to Azure SQL Database via Powershell

I was trying to get powershell connect to Azure SQL Database from local. I tried the following snippet $params = @{ 'Database' = 'dbsitenamehere' 'ServerInstance' = 'instancename.database.windows.net' 'Username' = 'abcites' 'Password' = 'atbasIcpr0d' 'OutputSqlErrors' = $true 'Query' = 'SELECT * FROM Users' } Invoke-Sqlcmd @params But I was getting this [...] read more
sql-server
powershell
azure
arm-template
2votes
3answers

Office automation (Interop) on Windows Server 2012

I'm successfully using Office automation on Windows Server 2008 R2 with Office 2007 in order to convert Office documents to PDFs. The code is rather simple: public class WordConvert { /// <summary> /// Converts a word file to PDF /// </summary> /// <param name="sourceFilePath">The path of the word file to [...] read more
ms-office
office-interop
2votes
2answers

Catch RPC lock before error 0x800706BA

we have some tools and services which communicate with the same COM server. After some time we get the error COMException (0x800706BA) RPC server unavailable It seems that one application blocks the RPC while second tries to communicate and fail. It's not ever the same app and sometimes it takes [...] read more
c#
com
rpc
2votes
1answer

open specific word doc. depending on user selection c#

i currently have a word doc. file merging program and am attempting to open a specific word doc. depending on user selection. // sample of code used: string outputFolder = null; ... // file selection ... string outcomeFolder = outputFolder; string outputFile = "Combined Folder " + fileDate + " [...] read more
c#
2votes
1answer

The RPC server is not available (Excep_FromHResult 0x800706BA) when calling Background Task in UWP

I have developed UWP application where it play audio files in Background or when the phone is locked. The application works fine and everything seems perfect for 5-10 minutes. After that when I run the app, I cannot play audio file and I am getting the exception attached in the [...] read more
win-universal-app
windows-10
windows-10-universal
windows-10-mobile
2votes
0answers

Connecting to remote SQL Server instance using SQL auth via SqlPowershell?

I'm trying to use SqlPowershell/SqlPS (Import-Module sqlps) to connect to a server on my local network. I followed the instructions here to create a function that predefines a server/database and the login and prompts each time for the password: function sqldrive { param( [string]$name, [string]$login = "<myLogin>", [string]$root = "SQLSERVER:\SQL\<serverName>\<databaseName>" [...] read more
sql-server
powershell
sqlps
1vote
0answers

WBEMTEST fails with RPC Server is Unavailable (Tried all suggested possibilities and no luck)

I am using WMI to authenticate to a remote windows machine and not able to succeed. Therefore to dig deeper, I have used wbemtest and then tried to connect to the windows machine and got the below error message "RPC Server is unavailable". Any pointers on how to further narrow [...] read more
windows
networking
wmi
rpc
1vote
0answers

Whitelisting RPC dynamic ports

OS: Win Srv 2012 R2 and Win Srv 2016 Hello, I am quite confounded with the following: We get the following error when trying to execute certain commands and see the same error in Event Viewer for certain processes: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) I found [...] read more
windows-registry
windows-server-2012-r2
windows-server-2016
rpc
1vote
1answer

Windows XP services are offline and not starting

I recently installed a version of nLite on a computer, and after booting I noticed that a few things went wrong. 1. The theme was Windows 2000 2. None of the applications I had told nLite to install had installed 3. I could not switch the "Luna" theme 4. I [...] read more
windows
windows-xp
services
1vote
1answer

Domain Controller not auto enrolling Kerberos Certificate from new 2016 CA

I migrated a Windows 2008 R2 DC and Enterprise Root CA to a new Windows 2016 DC and CA. Everything seemed stable except I had a few RODCs and writeable DCs that were showing "Failed Requests" in the CA for their auto enrollment of the KerberosAuthentication Certificate. The error is: [...] read more
certificate
kerberos
certificate-authority
windows-server-2016
1vote
2answers

PowerShell script error: the RPC server is unavailable

Im slowly getting my feet wet with Powershell, so I am a new beginner. Trying to have PS pull from a text file a list of PCs and let me know the status of their App Identity Service. The basic script errors out (below). I added in the $ErrorActionPreference = [...] read more
windows
powershell
scripting
1vote
2answers

Create Azure VM with Windows Firewall ports open?

I'm working on a Powershell script that will automate setting up an Azure VM, adding it to my Active Directory domain, and setting up a number of other settings. The idea is to be able to spin up and kill off VMs as needed without any manual interaction (including not [...] read more
active-directory
powershell
azure
virtual-machines
windows-firewall
1vote
1answer

How to enable connection security for WMI firewall rules when using VAMT 2.0?

I want to use VAMT 2.0 to install product keys and active software in remote machines. Everything works fine as long as the ASync-In, DCOM-In, and WMI-In Windows Firewall rules are enabled and the action is set to Allow the connection. However, when I try using Allow the connection if [...] read more
security
wmi
windows-firewall
1vote
1answer

What can I do to get rid of the error message: "The DSM service was delayed by 2409807 seconds for a driver query/download/install on device '...'"?

My little laptop runs with MS-Windows 8 and I am not getting windows updates anymore. I looked all day for a solution and so far came up empty handed. All the solutions proposed do not explain what could really be wrong. I tried to delete the "database" that's used to [...] read more
windows-update
drivers
windows-8.1
1vote
2answers

Error: "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)" when using CNAME

Running Get-WmiObject Win32_ComputerSystem -ComputerName 'MyCnameRecord' gives error: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA). However running Get-WmiObject Win32_ComputerSystem -ComputerName 'ServerNameToWhichTheAboveCnameRefers' all works. Equally Get-WmiObject Win32_ComputerSystem -ComputerName 'IPOfServerWhichCnameAlsoCorrectlyResolvesTo' works. Is anyone aware of some configuration / security setting which may be required to allow RPC calls to a server [...] read more
domain-name-system
cname-record
rpc
1vote
1answer

Restart-Server Powershell Port

I just ran into a problem with my remoting project in Powershell. I'm trying to remotely reboot a server sitting in a DMZ from within our intranet but get an RPC server unavailable error. The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) I know that that probably means that [...] read more
powershell
rpc
1vote
0answers

Add-Computer fails to run just after server is sysprep'd

I've developing a PowerShell 3 script to automate the deployment of a XenApp Windows 2008 image to a Hyper-V 2013 host. The basic steps are this: 1. Create and boots VM - script goes into wait loop for 15 mins 2. VM boots and sysprep runs. One of the steps [...] read more
windows-server-2008
deployment
sysprep
xenapp
1vote
1answer

Is it possible to backup an SQL Database hosted on an Azure VM, to our internal DPM2012?

I've got an SQL database on an azure VM (non domain) that i'd like to backup to our internal DPM 2012 server. I've installed the DPM agent on the Azure VM, setup DCOM to use only the ports 5000 to 5025 on both the VM and the DPM server, created [...] read more
backup
azure
scdpm
1vote
1answer

Certificate Error on Server 2008 R2 Event ID 6 and 13

I have two DC, one is a Windows Server 2003 (certificate server), the other is Windows Server 2008 R2. The Windows Server 2008 R2 has the following events in the event viewer. Source: Microsoft-Windows-CertificateServicesClient-AutoEnrollment Event ID: 6 Automatic certificate enrollment for local system failed (0x800706ba) The RPC server is unavailable. [...] read more
windows-server-2003
windows-server-2008-r2
ad-certificate-services
1vote
0answers

Certificate enrollment for Local system failed to enroll Event ID:13

I've just finished installing a second domain controller to gain redundancy in the network. (and to solve some issues) After installation and configuring all errors are gone but one that is: > Event Id 13: Certificate enrollment for Local system failed to enroll for a > DomainController certificate with request [...] read more
windows-server-2008-r2
domain-controller
certificate-authority
1vote
1answer

WMI query between two different AD sites?

I'm having problem in querying WMI between two different AD sites that is not trusting each other What I have tried: Telnet between Windows Server 2008 using IP address and port 135 is all working good vice-versa Start | run "WBEMTEST" between sites always end up in Error 0x800706BA with [...] read more
windows-server-2008
active-directory
wmi
1vote
1answer

RPC Error with Remote WMI Calls

On some of my servers, I am unable to make WMI calls remotely, even know the service is running and the firewall rules are there. When running something like: Get-WmiObject Win32_UTCTime -ComputerName ... I get: Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) read more
windows-server-2008
powershell
1vote
0answers

Trouble with PowerShell Try-Catch not working

I'm having trouble with Try-Catch in PowerShell. Here is the code I'm trying to use (note that $Wksn is passed to this routine): $BitLockerNameSpace = "root\cimv2\security\MicrosoftVolumeEncryption" $BitLockerClass = "Win32_EncryptableVolume" $Filter = "DriveLetter = 'C:'" Try { $BitLocker = Get-WmiObject -namespace $BitLockerNameSpace -Class $BitLockerClass -Filter $Filter -ComputerName $Wksn } Catch { [...] read more
powershell
1vote
3answers

Powershell Try Catch on Get-Printer

I have a little function to get all printer objects from a print server, the cmdlet throws an error if the spooler service is not available (e.g. the hostname is wrong). I want to catch that error message with a try catch, but it wont catch? Can someone explain this [...] read more
powershell
printing
try-catch
1vote
2answers

Windows Azure - RPC Server is unavailable error

We are working on the Windows Azure platform. The application is working fine if we work from Visual Studio but when we deploy it to Windows Azure and tried to Run from the URL created its throwing RPC Server Unavailable. If Anyone of you people facing the same issues kindly [...] read more
asp.net
windows
azure
cloud
1vote
1answer

Why do the windows of my Outlook mail items become unusable after my application terminates?

I have a VB6 application which creates and displays mail items in Outlook using Redemption's RDO. Everything works except after my application terminates the window of every mail item originally created and displayed by my application becomes unusable, i.e. I cannot send, save or print from that window. Requested clarification: [...] read more
vb6
outlook
outlook-redemption
1vote
0answers

Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass to interface type Microsoft.Office.Interop.Excel._Application

I'm working on a Asp.net MVC project, which have a function that allow user to upload an excel file to server,server then process data from excel and save to database, It's working perffectly until to day,as the title, I met the follwing error: Unable to cast COM object of type [...] read more
c#
excel
asp.net-mvc
1vote
3answers

Internet Explorer object doesn't have Document child

I'm trying to get my hands on filling in a form with PowerShell. So I am simply trying to do this: $ieObject = New-Object -ComObject 'InternetExplorer.Application'; $ieObject.Visible = $true;; $ieObject.Navigate('https://www.randomizer.org/'); $currentDocument = $ieObject.Document; $inputbox = $currentDocument.getElementByID('randSets'); $inputbox.value = "My Value"; However this gives me the error > You cannot call [...] read more
powershell
internet-explorer
1vote
2answers

How to handle System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

I am developing a Windows application where I manipulate Word Application. More specific, I am opening a Word Document but when I quit it and try to open another Word Document this Error comes out. How to handle > System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is > unavailable. (Exception from HRESULT: [...] read more
c#
winforms
office-interop
comexception
1vote
1answer

Error catching some info from remote computers who dont answer to ping

With little knowledge, I managed to assemble the script shown below, to obtain the amount of ram memory that the teams registered in the AD of the company have. #Import AD's module Import-Module ActiveDirectory #Grab a list of computer names from Active Directory (in City 3) $ComputerList = Get-ADComputer -Filter [...] read more
powershell
scripting
rpc
1vote
2answers

Error handling - PowerShell script

I have the following powershell script that cycles through a list of hostnames and changes the DNS settings for the active interfaces: $servers = Get-Content C:\users\kevin.todd\desktop\serverlist.txt foreach($server in $servers) { Write-Host "Connect to $server..." $nics = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $server -ErrorAction Inquire | Where{$_.IPEnabled -eq "TRUE"} $newDNS = "10.100.10.81","10.100.10.82" foreach($nic [...] read more
powershell
error-handling
1vote
1answer

Difference between Invoke-Command and query directly

I'm currently working on a script that queries the disk information from a server. I'm stack with a problem and I really don't know whats going on here. May you can help me. The following code is working (ComputerName replaced): $space1 = Invoke-Command -ComputerName "xxxxxx" -ScriptBlock { Get-WmiObject -Class Win32_LogicalDisk [...] read more
powershell
wmi
rpc
powershell-remoting
1vote
0answers

PHP exec doesn't return output of external program

I've the following program: function execute_query($ip, $username, $password, $query){ $runCMD ="python run_query.py " . escapeshellarg($ip). " ". escapeshellarg($username) . " " . escapeshellarg($password) . ' ' . escapeshellarg($query); $output = []; exec ($runCMD, $output); print_r ($output); //return (implode("\n", $output)); } However the array $output is always empty, the program is [...] read more
php
windows
exec
1vote
2answers

Passing an array as parameter from CMD to PowerShell give problems

I have problems to pass an array to PowerShell script as parameter from CMD. Here an example of the PS code: [CmdletBinding()] Param( [string[]]$serverArray, ) $serviceName = 'service1' function getState { Process { $serverArray foreach ($server in $serverArray) { $servState = (Get-WmiObject Win32_Service -ComputerName $server -Filter "name='$serviceName'").State } } getState [...] read more
powershell
cmd
1vote
2answers

How to Remove a Ghost Server in Web Farm After Migrating a Reporting Services Installation?

Just followed the steps in https://msdn.microsoft.com/en-us/library/ms143724.aspx to migrate a Reporting Services installation onto a new server (from and to SQL 2012 Standard Edition) But when I'm ready to verify my deployment using the Report Manager web interface I get the error: > The feature: "Scale-out deployment" is not supported in [...] read more
sql-server
reporting-services
migration
1vote
0answers

VirtualBox import appliance error - oracle R12

I am using virtualBox 5.1.0 and I am going to import the oracle R12 ova into the virtualBox. However, there appear a error that terminate the importing. Error massage: enter image description here [https://i.stack.imgur.com/rUnce.png] > Callee RC: RPC_S_SERVER_UNAVAILABLE 0x800706BA (0x800706BA) How can I fix this error and install the R12? [...] read more
virtualbox
1vote
1answer

Try-Catch: Why I'm still having uncaught errors?

I'm running the following script to identify whether there is drive Z: on a server. It contains try/catch, but I'm still getting "RPC-server is not available" errors like this: Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At C:\Users\vlitovch\Documents\Get-DriveZRemotely.ps1:19 char:26 + ... $a = Get-WmiObject Win32_LogicalDisk -ComputerName [...] read more
powershell
error-handling
try-catch
1vote
0answers

Parallel Access to Word

I'm occasionallyfacing problems when programmatically dealing with two or more Word documents simultaneously. In my application I'm listening on the buttons of a Philips SpeechMike, of which one is used to save and close the Word document. There may be multiple process of my application (all listening on the buttons) [...] read more
c#
c++
ms-word
com
office-interop
1vote
1answer

C# Powershell Execution Error (Script runs fine in Powershell)

Quick synopsis of issue: I have a Powershell script I downloaded off net which purpose allows me to supply a parameter named 'computername' with a value of comma delimited IP addresses to run netstat on the remote machines and return the values. When I execute this script from Powershell console [...] read more
c#
powershell
1vote
2answers

VSTESTcode coverage broken after SP1 for Visual Studio 2015 installed

This worked before SP1 was installed. namespace Test { public class Adder { public int Add(int n1, int n2) { return n1 + n2; } } } namespace AdderTest { [TestFixture] public class Class1 { [Test] public void AddTest1() { var add = new Adder(); var res = add.Add(2, 3); [...] read more
visual-studio-2015
nunit
code-coverage
vstest
0votes
1answer

Trying to revoke locally-generated certificate : No local CA error

For some automated tests on my project, I need to revoke a certificate which has been generated locally by makecert.exe. First, I generate a signer certificate and associated CRL using the following commands, and use certutil to install them to my machine # Generate Signer Cert makecert.exe -pe -n CN=SignerCert [...] read more
powershell
certificate
certificate-authority
certutil
0votes
2answers

Outlook 2010 no longer synchronizes with iCloud

I recently bought an iPhone and want to sync with Outlook 2010 via iCloud (App). At first it worked and after I installed and uninstalled some more applications (to test the sync with the iPhone) the synchronization suddenly stopped working. And I can't get it to work even after intensive [...] read more
windows-10
microsoft-outlook-2010
iphone
icloud
0votes
1answer

How can I stop a buffer overrun in Windows Server 2019 after installing updates KB4551853 and KB4556441?

On 13th May 2020, our Windows server downloaded and began to install two updates: KB4551853 and KB4556441. It restarted to finish the installation at 1:05am on Thursday morning. However, when people arrived to work on Thursday morning (whether physically or virtually) the server was not working; it was unresponsive. MEMORY [...] read more
memory
windows-update
windows-server-2019
0votes
1answer

Windows 8 update error

When trying to update my computer to Windows 8.1 I get a message saying it couldn't update, so it restored the previous version and it gave this code 0x800706BA - 0x20003. I am very computer illiterate but I thought I could at least do an update. Before I could even [...] read more
windows
windows-8
windows-update
windows-8.1-upgrade
0votes
0answers

RPC server is unavailable 0x800706BA, while updating password for user in active directory

I am using System.DirectoryServices.AccountManagement apis to create a new user/disable an account in Active Directory. When i am trying to create a new user, and set its password, m/c throws an exception with the message The RPC server is unavailable. (Exception from HRESULT: 0x800706BA). The following snippet is used to [...] read more
active-directory
.net-4.5
0votes
0answers

How to retrieve the serial number of my NAS?

I need to retrieve the serial number of a NAS. From another PC, I wrote: wmic /node:x.y.z.k bios get serialnumber but I get this message: ERROR: Code = 0x800706ba Description = The RPC server is unavailable. Facility = Win32 I went to the server farm because I needed it quickly, [...] read more
nas
remote-connection
wmi
0votes
1answer

Windows 2008 Web Enrollment Fails The RPC server is unavailable. 0x800706ba (WIN32: 1722)

I am setting up an RA and a Subordinate CA who is also an AD. I can issue certs through certutil and the mmc snap-in with no problem. But when I try using Web Enrollment in the RA, it fails saying "The RPC server is unavailable. 0x800706ba (WIN32: 1722)" This [...] read more
windows
windows-server-2008
active-directory
ad-certificate-services
0votes
1answer

certutil -TCAInfo error message RegConnectRegistry/RegOpenKeyEx: The network path was not found. 0x80070035 (WIN32: 53 ERROR_BAD_NETPATH)

Recently we noticed the following errors were occurring daily in our Event Logs for servers in our DMZ: CertificateServicesClient-CertEnroll EventID 82 Certificate enrollment for Local system failed in authentication to all urls for enrollment server associated with policy id: {00B9F3A7-...-50628BC5AE7E} (The RPC server is unavailable. 0x800706ba (WIN32: 1722 RPC_S_SERVER_UNAVAILABLE)). Failed [...] read more
windows
certificate-authority
certutil
0votes
2answers

How do you edit a Powershell script to continue on an error?

I modified this script(https://gallery.technet.microsoft.com/scriptcenter/Create-HTML-Uptime-and-68e6acc0) to hit multiple servers, but it doesn't generate a report even if only one of the systems are down. How do I modify the script to continue on errors and generate the report at the end? The error is: Get-WmiObject : The RPC server is unavailable. [...] read more
windows-server-2008
powershell
0votes
1answer

'The RPC server is unavailable' when converting a physical ISA/Forefront TMG machine to virtual (P2V) in SCVMM

When I try to convert a physical ISA/TMG machine to virtual using SCVMM, i keep getting an error in the Collect machine configuration step ('Scan Now' button): > VMM is unable to complete the request. The connection to the agent > MACHINE_NAME was lost. > > Ensure that the computer [...] read more
wmi
isa-server
rpc
physical-to-virtual
tmg
0votes
2answers

The RPC server is unavailable. with hMailServer

Everything was running fine, until I restarted the server (there may have been some updates installed as well during that restart) and now I can't connect to retrieve mail and Administrator comes up with this exception when I try to view the status: The RPC server is unavailable. (Exception from [...] read more
windows-server-2008
sql-server-2008
rpc
0votes
2answers

Removing Cert Server from AD

My CA server crashed. It was used to deploy certs to messenger clients for live communication. I am no longer using live communication. I removed the server object from AD but my clients and servers envent logs have a lot of the following entries 1. Automatic certificate enrollment for local [...] read more
active-directory
certificate
certificate-authority
0votes
1answer

PowerShell : error handling when using -asjob parameter

I can't figure out how to get the computernames that did not respond when using -asjob, could someone advise? try{ gwmi "Win32_OperatingSystem" -ComputerName $ordis -asjob $resu=get-job | ? {$_.psjobtypename -eq "wmijob" } |wait-job |receive-job } catch{"error"} $resu | select PSCOMPUTERNAME, @{name="lastboottime";expression={$_.converttodatetime($_.lastbootuptime)}} |sort lastboottime |ft remove-job * -force some hosts failed [...] read more
powershell
powershell-4.0
dsc
0votes
0answers

Copy data from multiple excel files into one master workbook. However, the data should be added worksheet wise using powershell script

I am trying to copy data using PowerShell script from multiple excel files, each excel file has 10 worksheets and the data must be added to the master file worksheet-wise for each excel file. My code works for a single file copy and add, but when I try to do [...] read more
excel
powershell
0votes
1answer

WMI Connection to a Windows server on Azure

I am not able to make a WMI connection to any VM on Azure running windows OS. The same commands work perfectly well on my LAN and WAN to connect to any Windows machine. For example Get-WmiObject -Namespace "root\cimv2" -Class Win32_ComputerSystem -Impersonation 3 -ComputerName RemoteWinHost -Credential domain\username Works fine and [...] read more
powershell
azure
wmi
remote-access
0votes
2answers

How can I fix "Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' / The RPC server is unavailable"?

I get the above error, which suspends activity in my app, when run on a particular machine. When I run it on my own machine, no such error occurs. Perhaps "The RPC server is unavailable" is the crux of the problem, but what would cause that to pop up after [...] read more
c#
office-interop
assemblies
com-interop
comobject
0votes
0answers

Writing to Excel worksheet but I keep receiving this error "The RPC server is unavailable"

I am trying to write to an Excel worksheet but I keep receiving this error, "System.Runtime.InteropServices.COMException: 'The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)'" ExcelIO excel = new ExcelIO(@"C:\Users\" + Environment.UserName + @"\OneDrive\Desktop\CountiesWindSpeeds.xlsx", 1); public void WriteData(int i, int k, string value) { excel.WritetoCell(i, k, value); excel.Save(); } ===========Above============ [...] read more
c#
excel
0votes
1answer

Has anyone come accross the RPC server not available issue when sending email on Outlook with Blue Prism?

When I try to send an email via Outlook with Blue Prism, at random moments, it will give me an error on the RPC server (Exception from HRESULT: 0x800706BA). Would anyone know the problem for this issue? If yes, how do you fix it? read more
outlook
rpc
rpa
blueprism
0votes
2answers

Powershell - Catch RPC Server Unavailable Error HRESULT: 0x800706BA

I want to print custom error message in case of error Foreach ($server in $servers){ Try{ $admins = Gwmi win32_groupuser –computer $server $admins = $admins |? {$_.groupcomponent –like '*"Administrators"'} $admins = $admins |% { $_.partcomponent –match “.+Domain\=(.+)\,Name\=(.+)$” > $nul $matches[1].trim('"') + “\” + $matches[2].trim('"') | Where-Object {$_ -like "$domain*"}} } [...] read more
powershell
try-catch
0votes
0answers

Outlook Interop Email - 2 mailitems issue

In my winforms application(VB net) I need to open Outlook app using Interop and open mailitem with some prefilled data (like subject). The AIP(Azure Information Protection) defaults to the previous email classification setting which is not desirable. To resolve this, I open and close a mailitem before displaying the actual [...] read more
.net
outlook
rpc
com-interop
0votes
1answer

How to fix "CCertRequest::Submit: The RPC server is unavailable. 0x800706ba" error?

Scenario: I am learning AWS CloudHSM. So far, I have * created an EC2 instance with Windows Server 2019 Datacenter as OS * created a certification authority (root CA) on this server with Dintinguised Name "CN=myservername-CA1" (https://docs.aws.amazon.com/cloudhsm/latest/userguide/win-ca-setup.html ) * while connected to EC2 instance via RDP, I can login to [...] read more
c#
amazon-web-services
amazon-ec2
cryptography
hsm
0votes
0answers

How to avoid IE Navigation error which says the RPC server is unavailable?

I have a service which is installed on my server. It suddenly stops with the following error log: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object [...] read more
vb.net
0votes
0answers

Re naming multiple PC' and then Joining a Domain from a CSV File

I need to be able to re name and then join a domain, multiple PC's from a CSV file. Content of CSV is for example :- oldpcname1,newpcname1 oldpcname2,newpcname2 etc.. The code is as follows :- $File = "C:\computer_names.csv" $domain = "MBTEST.LOCAL" $password = "password" | ConvertTo-SecureString -asPlainText -Force $username = [...] read more
windows
powershell
dns
hostname
0votes
1answer

How to create Powershell custom error output?

I want to make a small PS script that checks the status of a service logon account against a server list. What i need to do is, if a server is down, it shows a custom error message that tells me which server from the list is offline, instead of [...] read more
powershell
error-handling
0votes
0answers

The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) - C# ChangePassword

I need to change the password of a domain user on windows server 2012 r2 automatically. For this reason I created an application which basically performs the following operations: var userPrincipal = PrincipalContextService.AcquireUserPricipal(principalContext, model.Username); // Validate user credentials if (principalContext.ValidateCredentials(model.Username, model.CurrentPassword) == false) { LoggerService.printLogError(_logger, null, "user : " + [...] read more
c#
windows
rpc
0votes
3answers

Nagios Issue - gwmi : The RPC server is unavailable

I'm struggling with a problem regarding the RPC server being unavailable specifically for a Nagios script written in PowerShell. When the script is run locally, it runs perfectly and as expected. When it is called via the NRPE agent and run by the nscp service, it fails with this error: [...] read more
powershell
windows-server-2008
wmi
nagios
0votes
1answer

Why am I getting 'The remote procedure call failed' error after stopping excel process?

I have the following code that converts an excel sheets to csv files. If the csv files do not exist/or exist already but not in use (e.g. opened in excel), the script generates the csv files successfully (overwriting them if they exist already)! However, if the csv file is opened [...] read more
excel
csv
powershell-5.0
0votes
1answer

C# How to RDP Connect to On Premise Windows Server from Azure App Services?

I have an Asp.net core web api hosted in azure app service. My web api should connect to one or many On Premise windows servers to create DNS records. The windows servers are running the DNS service. I am using System.Management to connect to the on premise windows servers. However, [...] read more
azure
wmi
azure-web-app-service
remote-desktop
0votes
0answers

DCOM was unable to communicate with the computer using any of the configured protocols

I am currently on a problem, here is the situation : The aim is to use a dll from serverA to write in a database on serverB (it's not SQL database it's RAIMA database). A webservice on a serverB runs the following script : oClassType = System.Type.GetTypeFromProgID("Wonderware.MaterialSrv.wwMaterialDB.1", serverA); oMaterialDB = [...] read more
c#
dcom
clsid
0votes
1answer

Using IWebBrowserApp without admin rights possible?

I have a program that reads some data from a website, then clicks a link on that website and reads data again from the new site after navigation. Everything works fine as long as the program is started with admin rights. The problem occurs when I start the program without [...] read more
c#
internet-explorer
0votes
1answer

How to configure firwall to allow RPC

I am trying to change IIS App Pool Identity (user) remotely using C# and getting an error > System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is > unavailable. I am able to do it properly if I allow all RPC dynamic port (in the range of 49152 to 65535) from firewall for [...] read more
c#
iis
rpc
windows-firewall
0votes
2answers

Check/read registry key value on remote computer with local admin credential

How to check registry key value on computer which is not in domain?? I think that I must use local admin credential for this but I dont know how I tried this: $user = "admin" $password = "pass" | ConvertTo-SecureString -asPlainText -Force $computer = "computer" $domain=$computer $username = $domain + [...] read more
powershell
powershell-4.0
powershell-remoting
powershell-5.0
powershell-v6.0
0votes
2answers

If statement in PowerShell dependant on if RPC Server is unavailable

I'm writing a script in PowerShell that ideally would gather information from another server. If it's not able to reach that server, I want to prompt it to have the user manually enter the information. I know how to do all of these, but I'm getting hung up when the [...] read more
powershell
if-statement
rpc
0votes
1answer

How to properly access elements of Internet Explorer?

I have a script that tests whether one of our websites is working properly. 1. Test 1: It checks the HTTP status. (no problem here) 2. Test 2: It checks whether user authorization is working because we have had issues with this in the past. Then it waits one hour [...] read more
powershell
dom
com
internet-explorer-11
0votes
1answer

unable to get installed software details of vm machine of azure using System.Management

My requirement is to get installed software details of vm machine of azure and store the details in db. but when I try to get the details using System.Management class I am getting the below error > System.Runtime.InteropServices.COMException: 'The RPC server is unavailable. > (Exception from HRESULT: 0x800706BA)' below is [...] read more
c#
azure
azure-virtual-machine
0votes
1answer

Get-WmiObject deprecated now what?

I am trying to get the following function to work within PowerShell 6.0.2, however apparently Get-WmiObject has been deprecated. Can anyone help me figure out how to replace it with Get-CimInstance which has replaced it? Get-WmiObject is within the PROCESS area of the code below. Complete function code provided in [...] read more
powershell
0votes
0answers

Programmatically create a restore point

I checked around and even utilized/tweaked several solutions including the following, but I keep getting one of two errors. I either get ************** Exception Text ************** System.Runtime.InteropServices.COMException (0x80070422) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options) at Check_In_Tool.checkInForm.CreateRestorePoint() in C:\Users\Greg\Source\Repos\Check In Tool\Check In Tool\Check In Tool\Form1.cs:line [...] read more
c#
.net
windows
systemmanagement
0votes
1answer

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

I tried to write data to a excel template file using asp.net c#. But I got following exception. ExceptionType: "System.Runtime.InteropServices.COMException" Message: "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)" Sometimes it works for small count of rows. I cannot find what is the issue. try { int rowNumber = [...] read more
c#
asp.net
excel
interopservices
0votes
2answers

C# Word SaveAs RPC server is unavailable

private void CreateDocument(string date, string name, string phone, string father_name, string address, string village, string post, string taluka, string city, string district, string pincode, string product, int price) { string currentPath = System.IO.Path.GetDirectoryName(Application.ExecutablePath); // Get the Word application object. Word._Application word_app = new Word.Application(); // Make Word visible (optional). word_app.Visible [...] read more
c#
ms-word
0votes
1answer

Error handling 0x800706BA - RPC-Server not found

I have written a script to get the OSVersion from a List of Servers. Some Servers don´t respond to the "Get-WmiObject" command. I want a list of all Hostnames where this error occurs. This gives me an list of the first few Servers with this error. When the first Server [...] read more
powershell
exception
rpc
0votes
1answer

Get-WmiObject not handling variable as it's typed

Im trying to get list of all computers and logged on user for each computer. I get the list of computers, and when I query for each string returned, I can get the logged in user. However, when I use the computer name variable to get all users - I [...] read more
powershell
active-directory
0votes
1answer

How can I change several Active Directory user passwords?

I'm trying to programaticaly change several user's password, specifically without using System.DirectoryServices.AccountManagement (PrincipalContext) I have this piece of working code: using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.DirectoryServices; namespace ADScriptService.core { class ExportTool { const AuthenticationTypes = AuthenticationTypes.Secure | AuthenticationTypes.Sealing | AuthenticationTypes.ServerBind; private static [...] read more
c#
.net
active-directory
directoryservices
0votes
0answers

Code to revoke a Microsoft CA certificate from outside the domain

I am trying to develop a .NET application to revoke a certificate obtained from a Microsoft CA. I was able to get it working using ICertAdmin::RevokeCertificate and the pointers given in this link. However, I find that the revocation works only if I run this application from a computer that [...] read more
c#
.net
certificate-authority
0votes
0answers

$ie.document method is not visible for console page in powershell

I am using powershell to automate login page but when i navigate to login console page there is no $ie.document method is visible. and showing the null error. Method present for console page are : CreateObjRef Equals GetHashCode GetLifetimeService GetType InitializeLifetimeService ToString Code I am using is :- $ie = [...] read more
powershell
powershell-2.0
domdocument
getelementbyid
comobject
0votes
4answers

Can't catch GetWMICOMException

Code like this, try { $NIC = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $Computername -Credential $Credential -filter "IPEnabled = $TRUE" } catch [GetWMICOMException] { "Error 1" } catch [System.UnauthorizedAccessException] { "Error 2" } get an error like: > Can't find type [GetWMICOMException]: > > catch [COMException] Same > > catch [System.Runtime.InteropServices.COMException] just ignored [...] read more
powershell
0votes
1answer

Passing filepath parameters to function

Below mentioned code is giving error, and I'm not able to troubleshoot issue. Can anyone please help, we are just passing SourceFile and DestinationFile location to this function... ProcessDocumentsData "D:\Files\Scan1.doc","D:\Files\Scan1.csv" Clear-Host function ProcessDocumentsData { Param( [string]$SourceFile, [string]$DestinationFile ) $DestinationFileName = $DestinationFile $SourceFileName = $SourceFile $tableNum = 13 $delimiter = ',' [...] read more
powershell
0votes
0answers

Get-WmiObject -Class win32_volume

we are using powershell script for capturing the disk space & memory utilization related parameters for x number of servers and using the command "Get-WmiObject -Class win32_volume" we are able to get the required output for most of the servers , however couple of servers are throwing the following two [...] read more
powershell
0votes
1answer

"The RPC server is unavailable" only when running script

I am having issue with Powershell.I try and run my script which is Param ( [string]$ComputerName ) $ComputerName = $ComputerName -replace " ", "," Get-WmiObject Win32_OperatingSystem -ComputerName $ComputerName | select csname, @{LABEL='LastBootUpTime' ;EXPRESSION= {$_.ConverttoDateTime($_.lastbootuptime)}} I run it with: .\GetBootTime.ps1 -ComputerName localhost,<another computer> I get Error Message: > Get-WmiObject : The [...] read more
windows
powershell
0votes
1answer

C#: Why I can only connect to my ip address but the other ip address, getting error (WMI)

I'm trying to connect to other network using my pc but im getting error > (System.Runtime.InteropServices.COMException: 'The RPC server is unavailable. > (Exception from HRESULT: 0x800706BA)') However, It's only working if I connect to my pc itself. Is there any approach aside from this process because I cant even figure [...] read more
c#
networking
0votes
0answers

Generate status report for servers on different domain using Power shell

I am trying to generate server status HTML report for list of servers mentioned in text file. Some of my servers are in different domains so it gives me error. Error : Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At C:\Users\raj.negi.RESONATE\Desktop\WinServ-Status.ps1:143 char:32 + $OperatingSystem = Get-WmiObject [...] read more
powershell
cross-domain
0votes
1answer

Issues with WMI

I'm trying to build an application that can monitor an application on another computer on the network to ensure that it is running. I'm trying to use WMI to do that. I am able to access the server with wmimgmt.msc so it doesn't seem to be an issue of services [...] read more
c#
wmi
wmi-query
comexception
0votes
1answer

Change BIOS password through powershell

I want to build a script to change and/or set up BIOS password to HP workstations. Script i run as follows: C:\> $computers=Get-Content -Path c:\computers.txt C:\> foreach ($computer in $computers) { $passChange=Get-WmiObject -computername $computer -Namespace root/hp/instrumentedBIOS -Class HP_BIOSSettingInterface $passChange.SetBIOSSetting('Setup Password','<utf-16/>MYNEWPASSWORD','<utf-16/>') } Now, the following happen: 1. If my BIOS has [...] read more
powershell
bios
0votes
0answers

Get-PrinterDrvier cmdlet complains about unreachable RPC server

I am trying to receive a list of installed printer drivers from several Windows 7 and Windows 10 machines. Get-PrinterDriver -ComputerName Win7Machine This works on some of our Win7 machines and on others it doesn't. enter image description here [https://i.stack.imgur.com/o4ThV.png] HRESULT 0x800706ba translates to: The RPC Server is not reachable. [...] read more
powershell
remote-access
rpc
0votes
1answer

Error C# Invoke SetPassword AD

I'm trying to do a work for my final school project and I'm using C#, PHP, MySQL and Active Directory. The accounts will be created by the C# program into the Active Directory database, but I get this error while creating: System.Reflection.TargetInvocationException: O destino de uma invocação accionou uma excepção. [...] read more
c#
active-directory
passwords
invoke
0votes
1answer

New-CIMInstance dosent trigger try catch

why did the catch block $ComputerName = "server" try { #Hostname Abfragen der fürs CMI Query passt $OptDCOM = New-CimSessionOption -Protocol Dcom $CimSessionDCOM = New-CimSession -ComputerName $ComputerName -SessionOption $OptDCOM } catch{ Write-Host "Fehler beim CIM-Instance mit DCOM: $ComputerName" $array += $_.Exception.Message $BS = "PSR" } $BS doesnt trigger ? got [...] read more
powershell
try-catch
0votes
1answer

"RPC Server is unavailable" when exporting Outlook contacts to CSV

I am exporting Outlook contacts with a custom form to CSV from a specific Contacts folder. This folder is not the default location. It is a large folder with almost 7,000 contacts. This is a shared mailbox in Office 365, but we can't use the Outlook or Graph APIs because [...] read more
c#
outlook
office-interop
0votes
1answer

trying to automate browsing

I have an HTML Form like this: <input name="member[email]" id="memberemail" style="width: 220px;" type="text" value=""> <input name="member[password]" id="memberpassword" style="width: 220px;" type="password" value="" autocomplete="off"> <input class="continue" type="submit" value="Log In"> and I have a powershell script that authenticates and browses a page: this works fine. $username='xxx@mail.com' $password='<password>' $ie = New-Object -ComObject 'internetExplorer.Application' $ie.Visible= [...] read more
powershell
internet-explorer
ui-automation
0votes
1answer

unable to use SetPassword over domains through Powershell

I am trying to use the SetPassword method on a DirectoryEntry. $Root = New-Object System.DirectoryServices.DirectoryEntry("LDAP://dc.ourdomain.com/OU=Users,DC=dc,DC=ourdomain,DC=com", $ldapusername, $ldappassword, "Secure") $objUser = $Root.Create("user","CN=$DisplayName") $objUser.Put("sAMAccountName", "$username") $objUSer.Put("userPrincipalName","$userPrincipalName") $objUser.Put("givenName", "$firstname") $objUser.Put("sn", "$lastname") $objUser.Put("description", "$description") $objUser.Put("displayName", "$DisplayName") $objUser.Put("mail", "$email") $objUser.Put("company", "$Company") $objUser.SetInfo() $ObjUser.psbase.Invoke("SetPassword","qW12eR34") $objUser.psbase.InvokeSet(“AccountDisabled”,$false) $objUser.SetInfo() Whenever I run this, I keep getting the following error: [...] read more
powershell
active-directory
directoryentry
0votes
1answer

Itcl/Tcom/Tcl/Threads: Is this thread continuously running

In of the places I have written itcl code in a thread that kills excel method Kill_XL {} { thread::create { set rc [catch {exec taskkill /t /f /im Excel*} output] } sleep 5 } After that, for several different wish shells the following command invokes Excel App but I [...] read more
pthreads
tcl
itcl
0votes
1answer

How to write exception details to csv

Import-Module ActiveDirectory $computers = Get-ADComputer -Filter * -SearchBase "OU=workstations,DC=company,DC=org" | Select-Object -Expand Name $wmiObjs = Get-WmiObject -Class Win32_ComputerSystem -Property Name, Model -ComputerName $computers | select Name, Model | Export-Csv c:\temp\workstations-models.csv I am getting errors like the below which I would like to have placed into the CSV as well and [...] read more
powershell
wmi
export-to-csv
0votes
1answer

MVC Model for adding/editing/removing active directory user

The following code: public string AddADUser(string user_name, string password, string first_name, string last_name, string company_name) { try { List<ADUser> ADUsers = new List<ADUser>(); string admin_userName = "Administrator"; string admin_password = "Password!"; string domain = "sneaky"; var context = new PrincipalContext(ContextType.Domain, domain, admin_userName, admin_password); UserPrincipal NewUserPrincipal = new UserPrincipal(context, user_name, password, [...] read more
c#
asp.net-mvc
active-directory
0votes
1answer

Shutting down multiple PCs remotely

i want to shut down almost all PCs at my workplace (if they run more than 2 days) I've worked the last and this week on a Script and trying to get rid of Errors on the way. $days = -0 $date = (get-date).adddays($days) $lastboot = (Get-WmiObject Win32_OperatingSystem).LastBootUpTime $Computer = [...] read more
powershell
shutdown
0votes
0answers

Running multiple Batch files from different threads Java

I have n number of thread getting created at run time according to the input source files present in a folder. For every thread, I have one common class which has all the functions present that are used by every thread. Every thing is working perfectly except the part where [...] read more
java
windows
multithreading
batch-file
0votes
1answer

How to start new word instance without add-ins when word is already started

I am using Word (from 2007 to 2013) to convert documents to PDFA format, and i'm having trouble with users who have certain add-ins. When they use the system they get an assortment of COM Exceptions like RPC_E_SERVERCALL_RETRYLATER and (0x800706BA) RPC server unavailable. If they disable the add-ins it works [...] read more
c#
office-interop
com-interop
0votes
1answer

Error while instantiating MATLAB Engine Interface through COM (Matlab C# Integration)

I have called Matlab functions from C# using COM objects. It runs but on multiple calls it gives an exception while instantiating matlab Engine Interface through COM. //for instantiating MATLAB Engine Interface through COM MLApp.MLAppClass matlab = new MLApp.MLAppClass(); Exception it gives: > > Unable to cast COM object of [...] read more
c#
matlab
matlab-engine
0votes
2answers

Passing parameter to command in powershell

Could you tell my why this works: Get-WmiObject Win32_LogicalDisk -ComputerName xxx, yyy, zzz -Filter "DeviceID='C:'" | Select-Object pscomputername, @{Name="Size GB";Expression={ "{0:N2}" -f ($_.Size / 1GB)}}, @{Name="Free GB";Expression={ "{0:N2}" -f ($_.FreeSpace / 1GB) }} And this is not: $Machines = "xxx, yyyy, zzz" Get-WmiObject Win32_LogicalDisk -ComputerName $Machines -Filter "DeviceID='C:'" | Select-Object [...] read more
powershell
parameter-passing
0votes
1answer

Linphone for Windows Phone Crash - System.Exception: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

I get the git source code for Windows Phone (linphone-wp). I pass all steps from readme file and successfully compiled the project. I'm using Visual Studio 2013. I deploy the application. I can access any screen, but after I enter valid connection data for a real SIP account and after [...] read more
linphone
-1votes
2answers

Loop through servers and output results along with errors

I wrote a simple PowerShell script to retrieve a list of servers' last boot time and output the results to grid view. The results are immediately shown in the grid window but and comes to a short pause whenever a server is not responding to the get command, either due [...] read more
powershell
out-gridview
-1votes
1answer

Powershell - free disk space alert - add Test-connection

Ok, i try add Test-Connection and now the code look likes this: $html= @' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>HTML TABLE</title> <style type="text/css"> .alert {{ background-color: #FB1717 }} .statusCom {{ background-color: #FB1717 }} </style> </head> <body> <table> <colgroup><col/><col/><col/><col/><col/><col/><col/><col/></colgroup> <tr><th>SystemName</th><th>DeviceID</th><th>VolumeName</th><th>Size(GB)</th><th>FreeSpace(GB)</th><th>Status</th></tr> {0} </table> </body></html> '@ $entryTemplate [...] read more
powershell

Comments

Leave a comment

(plain text only)

Sources

  1. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  2. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0