w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to check if a particular service is running in a remote computer using PowerShell
If they all have the same name or display name you can do it in one command. If not you need to run 3 commands. If all have the same name or display name: Get-Service -ComputerName server-a, server-b, server-c -Name MyService | Select Name, MachineName, Status If they have different names or display names: I would do this -- @{ 'server-a' = 'service-a' 'server-b' = 'service-b' 'server-c' = 'service-c' }.GetEnumerator() | ForEach-Object { Get-Service -ComputerName $_.Name -Name $_.Value } | Select Name, MachineName, Status To output to a text file use ... | Set-Content ~DocumentsService_Status.txt where ... is one of the above. Note - your account will need to have privileges to query the remote machines.

Categories : Powershell

Powershell script to check if a file exists on remote computer list
The equality comparison operator is -eq, not eq. The boolean value "true" in PowerShell is $true. And if you want to compare the result of Test-Path to something the way you do, you must run the cmdlet in a subexpression, otherwise -eq "True" would be treated as an additional option eq with the argument "True" to the cmdlet. Change this: if(Test-Path "\$_c$Windowssvchosts" eq "True") into this: if ( (Test-Path "\$_c$Windowssvchosts") -eq $true ) Or (better yet), since Test-Path already returns a boolean value, simply do this: if (Test-Path "\$_c$Windowssvchosts")

Categories : Powershell

how to increase efficiency of invoke-command using session to collect logs from remote computer in powershell?
(I can't comment yet as I don't have enough reputation) Would some of the other Event Log based cmdlets be useful here? For example: Get-EventLog (if using v2 or newer) Get-Event (if using v1) Get-WinEvent Take a look at the output of Get-Command *event* for more options depending on what exactly you need to collect and what you need to do with it. You could use the Measure-Command to see which returns the data faster.

Categories : Powershell

Ping remote computer from another remote computer and get result back
According to Windows IT Pro (referred in Microsoft TechNet): PsExec displays the process's exit code and returns the exit code as its own exit code. So, your batch should work. Put ECHO ErrorLevel=%ERRORLEVEL% after PSEXEC ... just to get sure. To disable outputing, append >NUL 2>NUL or >NUL 2>&1 to PSEXEC ... command-line. Without /f as you used (where did you get it???)

Categories : Windows

How Can I Return Exit Code To Variable On Local Computer From Script Run On Remote Computer?
I do it like this: invoke-command -session $Remote -scriptblock { mycommand } $remotelastexitcode = invoke-command -session $Remote -ScriptBlock { $lastexitcode } if ( $remotelastexitcode -ne 0 ) { "$remotelastexitcode" exit 1 }

Categories : Powershell

Programatically set the time server of a remote computer to match the control computer?
You might be better off using Group Policy to set the time server. http://technet.microsoft.com/en-us/library/cc779145(v=WS.10).aspx

Categories : C#

get list of logged on users on remote windows computer from a list computer
It (csv file) should be formatted as follows: computername server1 server2 server3 'Computername' is the column name. This can be derived from the code snippet as the Foreach-Object refers to the ComputerName property.

Categories : Windows

How to get the IP address of Remote Computer
Refer following Code: IPHostEntry iPAddress = DNS.GetHostByName (HostName); IPAddress [] IPAdd = iPAddress.AddressList; for (int j = 0; j < IPAdd.Length; j++) { Console.WriteLine ("IP Address {0}: {1} ", j, IPAdd[j].ToString ()); } Can also refer THIS doccument.

Categories : C#

Python - Detect if remote computer is on
It seems like what you're looking for is a network/host monitoring tool, or just a simple heart beat monitor. Depending on the specifics (like number of hosts to monitor), something like Nagios, Munin or Heartbeat might help.

Categories : Python

How can I read a file from a remote computer?
I was able to find the answer in this post - by creating a temporary network share. Works well!

Categories : File

Get last logon time,computer and username together with Powershell
How about Event logs: $dcname = $dc.name $lastevent = get-winevent -FilterHashtable @{LogName="security"; ID=4624} -computername $dcname | select -first 1 That will get you the most recent logon event - you will have to work from there to pull the user name from the message, which could be tricky, but there are probably several ways. Pull the string between "Account Name:" and "Account Domain:" from $lastevent.message. Also need a way to filter out SYSTEM and non-user accounts. Computer accounts will end with $.

Categories : Powershell

Jacob connect to Remote Computer for WMI support
After some searches I managed to solve my problem... Here's the code if anyone need it. ActiveXComponent wmi = new ActiveXComponent("WbemScripting.SWbemLocator"); Variant variantParameters[] = new Variant[4]; variantParameters[0] = new Variant(_IPADDRESS); variantParameters[1] = new Variant("root\cimv2"); variantParameters[2] = new Variant("username"); variantParameters[3] = new Variant("password"); ActiveXComponent axWMI; try { Variant conRet = wmi.invoke("ConnectServer", variantParameters); axWMI = new ActiveXComponent(conRet.toDispatch()); }catch(ComFailException e) { axWMI = null; } if (axWMI == null) return false;

Categories : Java

find what program is using port on remote computer
You can't really determine this. Any application can send any stream of data over TCP, and for security reasons, this information is not exposed remotely. You can, however, probe the port with different messages and see what happens, allowing you to experimentally infer the application. In addition, some services/protocols will have distinctive greetings, headers, and messages, and can even expose debugging information.

Categories : Java

How to sync changes done to remote repo on diff computer?
Add the repository from computer X to the repo on computer Y directly without passing from your central one. See here, how to add a connection directly between X and Y. X ---- central / origin ------- Y more documentation here :http://git-scm.com/book/en/Git-Basics-Working-with-Remotes

Categories : GIT

Java: is it possible for a client to use same port on remote computer twice?
Have you tried it? Yes, it is possible as one communication end is defined by ip address and port together. As both servers will have different ip addresses there will be no problem. Also thought about the internet? Nearly all web servers are running on port 80 and it works just fine.

Categories : Java

How to access remote object from other computer in remoting
The message means most of the time that the client cannot find the service. You can use the following steps to determine where the connection fails: Check if the service is running on the remote machine. Check if the port number is correct. Ping the remote machine from the client. Open a telnet session to the remote machine on the port number of service. The step on which it fails gives an indication of why it is failing.

Categories : C#

Powershell : Find the first free computer name in Active Directory
Try something like this: Import-Module ActiveDirectory $computers = Get-ADComputer * | % { $_.Name -replace 'PC' } $i = 1 while ( $computers -contains ("{0:d2}" -f $i) ) { $i++ } $computername = "PC{0:d2}" -f $i echo $computername

Categories : Powershell

PowerShell Command for reset Computer in Active Directory
You could use dsmod: Get-ADComputer -Identity "computername" | % { dsmod computer $_.distinguishedName -reset }

Categories : Powershell

Acess a long javascript file from the computer of the user
Yes! There is a way. Few days ago I was also searching for the same answer. But, unfortunately, I did not get a proper answer. So, I did a lot of research and found the remedy. First of all, lucky you including the tag "html5" in your question as you can do it ONLY using HTML5. You can do it by just making a cache of your javascript file in the local computer. Just include the following lines in your code:- <html <!-- add this => --> manifest="a_file.appcache"> and in your a_file.appcache file include this:- CACHE MANIFEST demo_time.js img_logo.gif NETWORK: * FALLBACK: /html/ /offline.html This is only a demo. You must learn application cache. Just check out the tutorials at http://www.w3schools.com/html/html5_app_cache.asp and at http://www.html5rocks.com/en/tutori

Categories : Jquery

Need help logging into remote computer and reading text file
Is the remote machine on a domain? If so, consider including that in ConnectionOptions: conOpt.Authority = string.Format("ntlmdomain:{0}", domainName); Also, try using a SecureString for the SecurePassword property instead of a regular string. Don't think it matters, but is worth a shot. This is how you create a SecureString: SecureString secureString = new SecureString(); foreach (char character in password) { secureString.AppendChar(character); } conOpt.SecurePassword = secureString; As you mentioned, it's possible that the firewall is blocking the connection, although RPC connections usually aren't blocked on local networks (unless configured otherwise). Also, to add to paqogomez's comment regarding services, make sure the Remote Procedure Call (RPC) (or Remote Procedure Ca

Categories : C#

Is it possible to view a remote database in heroku on my computer (using Induction)?
Yes, you can. Heroku Postgres allows connections from outside Heroku's network. The credentials displayed from heroku pg:credentials will be all you need and should work. Maybe try using the official PGAdmin tool instead?

Categories : Ruby On Rails

Connection string for SQL Server Express on remote computer?
Here is a list of things you need to check on the other computer: Is TCP/IP protocol enabled? Go to SQL Server Configuration Manager -> SQL Server Network Configuration -> Protocols for {instance} What IP addresses are enabled for listening in configuration manager? Go to TCP/IP properties -> IP Addresses tab SQL Server browser started Firewall set properly – you want to enable TCP and UDP traffic on port 1433 Server allows remote connections? In SSMS open properties for that instance and check Connections tab.

Categories : C#

Running a jar file located on Raspberry PI from a remote machine (My computer)
r.exec(new String[] { "cmd","/c", "start /home/pi/JARTest/JavaApplication24.jar", "file1" }); That is Windows code. It calls "cmd", the Windows command shell. So that won't work on other OS (like the Linux on your Pi). Try to rewrite it using the "java" command.

Categories : Java

ibase_connect: remote computer host and shared db file from windows
Do not attempt to access a Firebird or Interbase database via any form of mount. The server process should be on the same machine as the disk containing the database. Your client would then communicate with the server process to interact with the database.

Categories : PHP

Checking to see if cmd shutdown command restarted remote computer on windows 7
you could try to query the eventlog of the remote computer and check for eventid 6005 example with the wevtutil utility from windows7 wevtutil qe system /q:*[System[EventID=6005]] /c:1 /f:text /rd:true /r %Computer%

Categories : Batch File

How to debug an Asp.Net Mvc Application in Visual Studio 2012 from a remote computer
If your remote machine is also the IIS server: If you share your Remote Debugger Folder out so it can be accessed on the remote machine. Folder for 2012 should be C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDERemote Debugger On the remote machine access the folder and run the msvsmon.exe It will give you a server name once launched. Then on your local machine, in VS2012, in the debug menu, select attach to process. Enter the server name provided by the remote debugger into the Qualifier field and attach to the w3wp.exe process if your IIS server is the localhost and your remote machine connects to it: You dont need remote debugger, just attach to process from the debug menu and select the w3wp.exe process. For good measure, here is the MSDN

Categories : Asp Net Mvc

How do I filter Fiddler sessions to show only a specific remote computer
Your first and simplest step is to untick the Capture Traffic option on Fiddler's File menu; this will unregister Fiddler as the system's proxy. Beyond that, you could write a rule inside Rules > OnBeforeRequest: if (!String.IsNullOrEmpty(oSession["x-ProcessInfo"])) { oSession["ui-hide"] = "localprocess"; } This will hide any traffic from a process on your local PC, thus showing only remote traffic. If you had multiple remote computers and wanted only traffic from one of them, you'd write your rule to examine the oSession["X-CLIENTIP"] flag.

Categories : Android

Heroku- was working before computer restarted, now can't push to remote repository- access denied
It sounds like a problem with your ssh keys. Check your ~/.ssh directory for the keys and ensure that they match up with what you have on Heroku. https://devcenter.heroku.com/articles/keys this link taks about setting up your keys for use with their system. Hopefully that helps :)

Categories : GIT

Can the computer that I'm (p)ssh'ing into be showing different than the original $PATH under certain circumstances?
The server(s) you are connecting to probably set a different $PATH depending on whether or the shell that is run remotely is a login or interactive shell or not. When you ssh interactively, an interactive, login shell is invoked on the server. When you ssh non-interactively, a non-interactive, non-login shell is invoked (with a -c option to directly run the specified command without entering interactive mode). Many shells source different startup files depending on whether they are invoked as login shells and/or interactive shells. For example, bash reads ~/.profile (or variants) only when it is a login shell, and ~/.bashrc only when it is an intractive shell. The server probably sets up a $PATH that includes the directory for Java from one of those startup files. The solution to this is

Categories : Unix

C# Automatically Detecting the computer name/ file path
I'm assuming that it's not working for some reason. You need to: Make sure that you already have an "Error Log" folder on the desktop Use Path.Combine to combine filepath with "Error Log", rather than concatenation

Categories : C#

How to generate path of a file residing on another computer
Use Path.Combine to work with path files and remember that the backslash is a special character in C# and it is used to escape other chars. So you need string ID = "test"; string TrackingPath = "tracking"; string serverName = "server_name"; string tmpPath=string.Empty; if (serverName != "") { tmpPath = Path.Combine(@"\", serverName, TrackingPath ,"u00" + ID); } Console.WriteLine(tmpPath); To insert a backslash in a string you need to double it or prefix with the Verbatim string prefix character @ Using 3.5 Framework and below tmpPath = Path.Combine(Path.Combine(Path.Combine(@"\", serverName), TrackingPath) ,"u00" + ID); Well not very efficient but it works

Categories : C#

COUNT(*) takes long even after deleting all rows
After DELETE FROM Sdata try using OPTIMIZE TABLE Sdata to really discard the unused rows, or in the future, use TRUNCATE Sdata which will do this automatically for you. Quote from here: In MyISAM tables, deleted rows are maintained in a linked list and subsequent INSERT operations reuse old row positions. To reclaim unused space and reduce file sizes, use the OPTIMIZE TABLE statement or the myisamchk utility to reorganize tables.

Categories : Mysql

Deleting charachters as long as button is pressed
If you want to change things like that, you will have to actually implement your own text editor. Most default text editors react on keypress events which are auto repeated by the OS after it has been held down for a time. You can change your OS settings to minimize the delay but that works on everything system-wide for all keypresses (and only for you). If you want to change the behavior of your specific text editor, you will have to implement your own text editor that reacts exactly on keydown/keyup events and handles the repeating internally through a timer.

Categories : Objective C

ASP.NET MVC application, localhost working, remote computer returning "An error occurred while processing your request."
I had this error running on a virtual machine in Amazon AWS. The website had been working some time ago.. like a few months when I left it last. No configuration changes, nothing. Now it doesn't work.... And why would it stop working? Real head scratcher. Maybe a virus infection - It was not set to auto patch... Hmmm.. I'd set the machine to the smallest (micro instance) as a kind of "hibernation" of the site, very little traffic expected and I didn't have this site on my list of priorities... The site "worked" in "micro" instance when I last left it. Tried rebooting first off. Nothing. Then I checked the localhost and it works from there. Weird. Anyway it is time to make some modifications on this site and some upgrades. "Micro" instances are useless when upgraded so I shut

Categories : C#

Git: Deleting Remote Branch Doesn't Synch?
To remove from your local repo branches that were deleted remotely, you have to run git fetch --prune. If you have a local branch tracking the deleted branch, your local branch won't be removed, but tracking will be unset.

Categories : GIT

Deleting items from a dynamic array of strings in Powershell
Note that PowerShell Uses .Net like code . So declare the array as follow: $a = New-Object System.Collections.ArrayList Now you can add items to this array: $a.Add("Server1") $a.Add("Server2") $a.Add("Server3") If you print the array you get: PS C:UsersWork> $a Server2 Server1 Server3 Now $a does have a Remove method: $a.Remove("Server2") Now If you print the array you get: PS C:UsersWork> $a Server1 Server3

Categories : Arrays

Deleting files within a directory through remote 3rd party service
Logmein will only log onto the profile that you have setup to access that computer. For example if your credentials are admin/pass you will get the admin profile, for tirefire/pass you will log on as TireFire. Prior to logging in you will not be able to see who is logged in. This is not the answer your looking for but it is the limitation of the software. You could use a batch like: CD.. FOR /D %%P IN (*.*) DO DEL /S/Q %%PTRACING*.* This will look in the folders under c:users (/D) and assign all user folders to the variable (%%P) and delete (DO DEL) anything in the tracing folder (%%PTRACING*.*) for all users on the machine. Source: I use logmein daily to log onto machines that we service.

Categories : Batch File

remote procedure call failed after deleting account
Re-creating an account with the same name isn't going to work, because SQL Server uses the UID of the account and not the name for authentication. Create a new Active Directory service account, and do a clean install of SQL Server using this new service account as the account to run SQL Server. Then, restore your database backups (including master, model, and msdb).

Categories : Sql Server

Recursively deleting files within folders without prompting the user via Powershell
You could first do a recursive search for the directory(ies) from which to delete files, then do a non-recursive delete of the files in each of those. Function Clear-Cache { $localFolders = Get-ChildItem 'C:UsersAdminDocumentsGI Studies' -Directory -Recurse | Where-Object {$_.FullName -match 'data\local$'} $localFolders |% { dir $_.FullName -File | del -Force } } Edit Use FullName of directory when searching for files

Categories : Powershell

A default path when downloading PDF file in computer/mobile phone
When you write a Web Application you shall never use hard coded paths, and the last place where you should save files is C:Users !! It does not matter whether this is Azure or not. It is general rule for any kind of web applications! In your case I suggest that you create a folder within your application named pdf or something like that and save files there with the following code: var fileName = Server.MapPath("~/pdf") + filename; using (var output = File.Create(fileName) ) { // do what you want with that stream // usually generate the file and send to the end user } However there is even more efficient way. Use the Response.OutputStream and write the resulted PDF directly to the response. Will save you a lot of space on the local server, and the logic to delete unused generated fil

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.