Hi,
I tried to create a very simple macro, which should only open the dos console with a user account from the repository
I´ve configured this way:
Tab General:
Run: %COMSPEC%
Tab Execution Mode:
Checked "run as different user"
That´s all, very simple. But when I try to run this "macro", RDM ask me to choose a credentials (fine) and after choose one I get an error message:
"Unable to execute the command line [C:\Windows\system32\cmd.exe] The stub received bad data"
Hi,
Could you try to execute RDM with the Run As Adminstrator to see if it makes a difference?
David Hervieux
Same behaviour
What version of RDM are you using?
Are you running RDM in English? Is the OS English?
Could you please export both the macro and the session that you are testing against.
To export select the session in the tree view, right-click -> Clipboard -> Copy. Then paste it in your favorite text editor and remove all sensitive information (replace with 'a' or something). Result should be something like:
Macro<?xml version="1.0"?><ArrayOfConnection> <Connection> <Cmd> <RunAsAdministrator>true</RunAsAdministrator> </Cmd> <CommandLine>%COMSPEC%</CommandLine> <ConnectionType>SessionTool</ConnectionType> <CreatedBy>DEVOLUTIONS37\Stefane Lavergne</CreatedBy> <CreationDateTime>2014-10-30T08:52:11.9191072-04:00</CreationDateTime> <Encrypt>true</Encrypt> <Events /> <ID>3855ac87-bb96-4bec-a608-1797fb008c5b</ID> <MetaInformation /> <Name>COMSPEC</Name> <PlayList /> <ShowInTrayIcon>false</ShowInTrayIcon> <Stamp>08ca72aa-34cc-455f-ac64-6d3518c7ed28</Stamp> <Tools /> </Connection></ArrayOfConnection>
Test RDP sesson<?xml version="1.0"?><ArrayOfConnection> <Connection> <UserName>aaaaaaaaaaa</UserName> <ConnectionType>RDPConfigured</ConnectionType> <CreatedBy>DEVOLUTIONS37\Stefane Lavergne</CreatedBy> <CreationDateTime>2014-10-30T08:59:33.1920549-04:00</CreationDateTime> <Events /> <ID>8f7a952c-908b-4186-802b-679855c859d0</ID> <MetaInformation> <PasswordHistory> <PasswordHistory> <ModifiedBy>DEVOLUTIONS37\Stefane Lavergne</ModifiedBy> <ModifiedDateTime>2014-10-30T08:59:33.1930357-04:00</ModifiedDateTime> <SafePassword>aaaaaaaaaa=</SafePassword> </PasswordHistory> </PasswordHistory> </MetaInformation> <Name>Sample</Name> <OpenEmbedded>true</OpenEmbedded> <PinEmbeddedMode>False</PinEmbeddedMode> <PlayList /> <RDP> <LoadAddOns>false</LoadAddOns> <NetworkLevelAuthentication>true</NetworkLevelAuthentication> <RedirectDirectX>false</RedirectDirectX> <SafePassword>aaaaaaaaa=</SafePassword> <SmartSizingStreched>false</SmartSizingStreched> <UserName>aaaaaaa</UserName> <VideoPlaybackMode>Disabled</VideoPlaybackMode> </RDP> <Stamp>a43f5f71-b13d-4db1-979f-6f0dbf0c80cc</Stamp> <Url>192.168.1.10</Url> <UsesSerialPorts>false</UsesSerialPorts> </Connection></ArrayOfConnection>
Stéfane Lavergne
RDM Version: 10.0.4.0 in english
OS: MUI also in english
Macro:
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<Cmd>
<RunAsDifferentUser>true</RunAsDifferentUser>
</Cmd>
<CommandLine>%COMSPEC%</CommandLine>
<ConnectionType>SessionTool</ConnectionType>
<CreatedBy>domain\username</CreatedBy>
<CreationDateTime>2014-10-30T10:20:47.2952249+01:00</CreationDateTime>
<Encrypt>true</Encrypt>
<Events />
<ID>db5e3b99-d587-46c6-b02d-689d31effd91</ID>
<MetaInformation />
<Name>Commandline</Name>
<PlayList />
<ShowInTrayIcon>false</ShowInTrayIcon>
<Stamp>0225c71b-9c92-4fb7-b195-6ca42ad39853</Stamp>
<Tools />
<UpdateDateTime>2014-10-30T10:23:20.0251913+01:00</UpdateDateTime>
<UpdatedBy>domain\username</UpdatedBy>
</Connection>
</ArrayOfConnection>
RDP:
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionType>RDPConfigured</ConnectionType>
<CreatedBy>domain\username</CreatedBy>
<CreationDateTime>2014-02-04T11:32:07.3234252+01:00</CreationDateTime>
<CredentialConnectionID>00000000-0000-0000-0000-000000000000</CredentialConnectionID>
<DescriptionMode>Url</DescriptionMode>
<DescriptionUrl>http://url:8080/tfs</DescriptionUrl>
<Events />
<ID>f28f88e2-ff52-4166-84a3-ce74fb99ec1c</ID>
<MetaInformation>
<ServerHomePageUrl>https://url/tfs</ServerHomePageUrl>
</MetaInformation>
<Name>TFS 2012 Q-System / pcname</Name>
<PinEmbeddedMode>False</PinEmbeddedMode>
<PlayList />
<RDP>
<SmartSizingStreched>false</SmartSizingStreched>
</RDP>
<ScreenSize>FullScreen</ScreenSize>
<Stamp>a1b9fb3b-0ae7-4bd9-a66b-feb29ce4f61b</Stamp>
<Tools>
<CredentialConnectionID>1441a602-eafc-40f0-8f32-d09bda790a64</CredentialConnectionID>
<CredentialSource>CredentialRepository</CredentialSource>
</Tools>
<UpdateDateTime>2014-10-30T08:21:09.3182401+01:00</UpdateDateTime>
<UpdatedBy>domain\username</UpdatedBy>
<Url>pcname.subdomain.domain.tld</Url>
<UsesSmartDevices>true</UsesSmartDevices>
</Connection>
</ArrayOfConnection>
edited by MarkusR on 10/30/2014
You are doing a "Run as different user" therefore we can not do a "shell execute" for you. It must be done manually. Try setting the command as:cmd.exe /k %COMSPEC%Does that resolve the issue?
Best regards,
Stéfane Lavergne
No, the same behaviour. Still the error message.
But whats interessting, for some Server the message box doesn´t appear, but the command prompt is open with me local account instead of the diffrent account which I´ve choosen.
May it is important, the credentials are saved in KeePass
Hi,
Could you try just for a test to replace %COMSPEC% by "c:\". I'm not sure if the envirionment variables are resolved by the run as command
edited by dhervieux on 10/31/2014
David Hervieux
Doesn`t Change anything
Perhaps stefane could post his working session.
David Hervieux
Hello,
Can you describe the outcome of what you are trying to achieve? A Macro/Script/Tool is meant to be used against hosts that are in sessions, so it sounds like you are trying to do a remote command session, which is not feasible as far as I know.
If you want a local command prompt under other credentials, you need to create a command line session (Entry-Session-Other-Command Line).
Maurice
I want to open a dos prompt local on my pc with different user. Like right click on the shortcut and chossing the Option "run as diffrent user".
I thought it would be a little bit more comfortable when I have just to open a session and choose a credential from the repository
But also you Suggestion with "Entry-Session-Other-Command Line" throws the same exeption
My config:
Hi, as I already wrote we are using KeePass to store our crendential. When I store the logon info directly in the session, it work.
At least the last Suggestion, add it as "(Entry-Session-Other-Command Line)"
It also works when I store the credentials directly in RDM as credential (not using KeePass). So I believe ist a Problem with KeePass
edited by MarkusR on 11/3/2014
Please include details on your keepass entry.
Are you using dynamic credential linking or a hard link to a specific credential?
Maurice
Which details should I include in the KeePass entries?
The data which are stored in KeePass are Username including the Domain (eg Domain\username), the password and the histrory, thats all. And a small modification for Auto-Type, that only the Password will be "typed"
Actually we have an entry in the credentials from RDM for each entry in the KeePass file, I think this is what you mean with "hard link" but I tried now also to just add the KeePass file to get prombt for choosing an account from the KeePass list, (is this the dynamic linking?)
But both cases failed with the same error message, as wrote in the first post
Any suggestions because of this problem?
Please follow http://help.remotedesktopmanager.com/tipsandtricks_variables.htm
you will use $USERNAME$ and $PASSWORD$, you will need to go in the advanced settings of the session and check "allow password use in variable" though
This will show you what is resolved from your keepass entries.
Maurice