Results 1 to 4 of 4
  1. #1
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,413
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Has anyone used PSEXEC to run CMDKEY?

    This is a rather long shot, but I am trying to apply CMDKEY to each of a number of Windows 7 Pro PCs in a workgroup by using PsExec in an Elevated/Run as Administrator BATch file run on an additional PC, using (on one line):

    psexec \\%pc% -h cmd /c CMDKEY /ADD:targetpc /USER:username /PASS:password

    and get the message:

    CMDKEY: Credentials cannot be saved from this logon session.

    I've tried a number of variations on the PSEXEC parameters:
    * using /l instead of /h
    * omitting these parameters entirely
    * omitting cmd /c
    but I get the same error message.

    Has anyone ever got this to work, or can someone tell me what's wrong?
    If I run CMDKEY natively on any PC it works correctly!
    Last edited by RetiredGeek; 2015-09-07 at 14:35.
    BATcher

    Time prevents everything happening all at once...

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    BATcher,

    I was able to get the command to run from my Win 8.1 Pro machine using an Elevated Command Prompt:
    cmdkey.JPG
    It returned an error code of 0!

    Note: I had to pass the remote machine a user account & password that already existed on that machine to get it to work. Also some info blacked out for my protection.

    However, going to the other machine (Win 7 HP) the account was not there!

    I could not get it to connect to my Win 10 Build 10532 machine even though I was logged on with a Local Account it insisted on requiring the credentials for the MS Account on the machine, very long PW so I didn't try but I will if you want.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,413
    Thanks
    33
    Thanked 195 Times in 175 Posts
    RG, you are an intergalactic superhero!

    There should have been no need to supply PsExec with a username and a password, because those on the target machine are the same as on the source machine.

    But when supplied, It Works - just as in your screenshot!

    Thanks!
    BATcher

    Time prevents everything happening all at once...

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,164
    Thanks
    47
    Thanked 976 Times in 906 Posts
    PSexec uses credentials on local connections only, thus the need to supply them on the network.

    cheers, Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •