Send commands to CM15A via commandline over the network???

Started by berniejr72, November 11, 2008, 06:58:24 PM

Previous topic - Next topic

hawk1

koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

Talisman

Quote from: jrwhit on August 01, 2011, 12:38:06 PM
Just curious, have you tried it using WMI in Windows without PSEXEC?
If you copy the 2 lines below into a new file called A1 on.vbs and double click this file on your networked PC, what happens?

Set objProcess = GetObject("winmgmts:{impersonationLevel=impersonate}!\\hm\root\cimv2:Win32_Process")

result = objProcess.Create ("C:\Program Files\Common Files\X10\Common\ahcmd.exe sendplc A1 on", null, null, intProcessID)


if i run that from either of the two pc's i get

script d:\tools\pstools\a1on.vbs
Line: 1
Char: 1
Error The remote server machine does not exist or is unavailable:
getobject
code 800a01ce





Noam

Quote from: hawk1 on August 01, 2011, 12:50:27 PM
This link might help.  I don't know.   http://www.windowsitpro.com/article/remote-computing/psexec

I took a look at that link. There are a lot of good suggestions (like trying to run "ipconfig" or "cmd" remotely to test the connection).
I did a test myself, going from one of my XP Pro machines to two different Win7 machines.
One worked, the other got an error that indicated invalid login credentials (which I expected).

I think I may have been able to reproduce your error.
Using two XP Pro machines, I tried to run "ipconfig" remotely.
However, I used the "-u" and "-p" with a username that did NOT have admin rights on the remote machine.
I got this error:

Couldn't access [Remote Pc]:
Access is denied.

Is that the same error you are getting?

I thought I read that you are using XP Home on the two "local" PCs from which you are trying to send the commands.
I don't have an XP Home system to test with, but I know that it doesn't handle network authentication the same way that XP Pro does.
Check out this link for another possible fix:
http://serverfault.com/questions/8805/psexec-access-is-denied/11043#11043

Talisman

i was but as said i re installed the server over the weekend.

basically i need 2 pc's to be able to run this psexec to the server

HTPC1 and HTPC2

HTPC1 = XP Pro
HTPC2 = Win7

Server now is Win7

Server is running with user HS which is the ADMIN


yes thats the error i get everytime

Noam

Quote from: Talisman on August 01, 2011, 01:49:43 PM
i was but as said i re installed the server over the weekend.

basically i need 2 pc's to be able to run this psexec to the server

HTPC1 and HTPC2

HTPC1 = XP Pro
HTPC2 = Win7

Server now is Win7

Server is running with user HS which is the ADMIN


yes thats the error i get everytime

Okay, NOW I think we might be getting somewhere.
1. What version of win7 is in the server and HTPC2? (Home, pro, ultimate, starter?)
2. Are you using a username AND password on all three PCs?
3. Is the Guest account disabled on all three PCs?

From a command prompt on both HTPC1 and HTPC2, try doing "psexec \\server ipconfig" and see what happens.
Next, try this: "psexec \\server -u HS -p [password_for_HS] ipconfig"  , and see what happens.

Make a note of the errors, and if they are any different.

Talisman

win 7 ulitimate on htpc2, gamespc, server

htpc1 xp pro

tried user names and passwords on all, as well as making all the accounts and passwords the same

yup guest accounts disabled

tried both. same as norm, access denied

Noam

That still sounds like a permissions issue.
all of the machines are in he same workgroup (in the network settings), right?
what type of sharing setup do you have on the win7 machines (home network, work network, public)?

you should be able to open up the C: drive of the user using \\server\c$ from the other PCs. It may or may not ask you to authenticate.
If you can't, then thre is still something not set up correctly in your permissions, firewall, or sharing setup.

Make sure the XP machines have "use simple file sharing" turned OFF (in the advanced options for Windows Explorer, under folder options)
Make sure that file and printer sharing is turned ON on all the machines.

Turn ON "password protected sharing" on the Win7 machines.

Talisman

your right it was (notice the WAS) stupid stuff.

with a lot of help from here and a mate of mine finally cracked it.

on the server had to go into control panel\windows firewall\advance settings.

clcik inbound rules. find Remote Service Management (RPC) Private and make it enabled.

then into Control Panel\User Accounts. clcik Change User Account Control Settings and drop it down to never notify.

Then ive changed the Server, HTPC1 and Games PC user names to all be HS and no password.

This seems to have cracked it  >!


dbemowsk

Quote from: hawk1 on July 31, 2011, 11:05:09 PM
I know for a fact that I read somewhere that you can not send a psexec command to a XP Home pc it has to be XP Pro.  I too went through this problem a while back and found it in the Systernal's forum somewhere.

If it is XP Pro that your sending it to then it will work just have to work out the kinks.   :)

Hawk1, I see now that you are correct.  It has to do with aco**** sharing.  I stumbled on this post from vbforums.com of all places.

"There is no way to exec psexec or other remote execution tools under home edition since the account sharing is disabled. XP home allows printers and files sharing only via a simplified networking method. The same for Vista home Premium. On the web you may find tricks to work around this but they force to enable the Professional version facilities in way I don't suggest to follow."

I also stumbled onto one that said that it is not meant for vista either, but some have found workarounds that can make it work.  So I suspect you may run into similar issues on Windows 7.
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

Noam

Quote from: Talisman on August 01, 2011, 06:29:45 PM
your right it was (notice the WAS) stupid stuff.

with a lot of help from here and a mate of mine finally cracked it.

on the server had to go into control panel\windows firewall\advance settings.

clcik inbound rules. find Remote Service Management (RPC) Private and make it enabled.

then into Control Panel\User Accounts. clcik Change User Account Control Settings and drop it down to never notify.

Then ive changed the Server, HTPC1 and Games PC user names to all be HS and no password.

This seems to have cracked it  >!
I'm glad to hear you finally have it working.
I know you can turn UAC back on (I have it on, and psexec works fine).
You can also set passwords on those accounts (I have passwords, and it works fine).
Also, try logging into one of the remote PCs as a different username, and use the -u and -p parameters to send the commands. It should work now.
Most likely it was the firewall issue that was blocking it.

Talisman

i tried the fire wall enable first and no joy.
it was a case in the end of 5 hours of head scrathing and clicking this and that.

Im going to continue tweaking as id like a password on the server (its on all the time) and the other two pcs HTPC1 & HTPC2 im not to fussed about.

But at least i know i can make subtle changes now and if it doesnt work put it back.

Ive now full control of my automation devices by remote control from either of the two machines when watching films now :) #:)

Noam

Did you try logging into HTPC1 or HTPC2 with a different user name, and then using the -u and -p on the psexec command?
If that works, you should be able to put a password back on the accounts on the server, and turn UAC back on.

Talisman

i did try that and it didnt work so have had to resort to all 3 pcs having HS as the user name and no password currently.

Talisman

ive posted this in diff section to but....

im wanting to use this to send a command key to another pc that runs all me Home Theatre stuff.

ive learned how to use psexec to send from the HTPC pc to the Server running this activehome pro sofware to control lights when i press play on the htpc system.

im looking to to reverse the process to when a sensor is activated it will send a commang from the server to the htpc and in essense press the space bar on the keyboard.

any ideas what id have to send? im guess it wont be

psexec.exe \\htpc c:windows\spacebar...

Noam

You can use a program like AutoIt or AutohotKey to fake a keypress.
Or, get a solenoid attached to an X10 universal module, and send an ACTUAL keypress. ;)