Passing Log in Credentials with Pushd? other command?
My Scenario: I am running the pushd
command to run searches on remote domain computers. However the search performs very slow/or not at all when a user is not logged on to the machine(machine is still powered on.)
I was wondering if it is possible to pass log in credentials with the pushd
command. If not what are some alternate choices?
I cannot use other software or packages such as PsExec.
You can use:
net use \\RemoteComputer\c$ password /user:MY_DOMAIN\remoteUsername
"\\RemoteComputer\c$\Program Files\Java\jre6\bin\java" -version"
net use \\RemoteComputer\c$ /d
(Edited to add simplifications from grawity from comments. Learn something new every day!)
I would use this command to map a drive. This guarantees that connection will persists and you have a drive name mapped to E: so you can just call that drive name to run commands.
Net Use E: \\server\share my_password /user:username /persistent:MY_DOMAIN/username /y