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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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