Powershell Script which allows me to RDP into multiple servers with single login credential

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
y2india_007
Posts: 1
Joined: Mon Sep 24, 2012 7:53 am

Powershell Script which allows me to RDP into multiple servers with single login credential

Post by y2india_007 »

Hi,

My main purpose of this Question is to get a Powershell Script which allows me to RDP into multiple servers. Also, the RDP Session should get the Authentication credential from the Script itself via secure password entry from a form (just like get-credential).

Requirements:

1. Form-based entry which allows me to select single or multiple servers. If single, the entry should be on the screen itself. If multiple servers, it should get entry from a file
2. RDP Session should get the Authentication credential from the Script itself via secure password entry from a form (just like get-credential)
3. Authentication Credential should be entered only once, which should be utilised automatically on all other servers.
4. My Servers are having a Audit Message like "Your login is monitored, etc" while I login to any Server. So This script should bypass this message automatically & connect using the above mentioned Credential.

Please help me on this regard as it is really a pain to type in my credentials whenever I RDP to many servers.

Thanks,

Indhar

jvierra
Posts: 14611
Joined: Tue May 22, 2007 9:57 am
Answers: 2
Has voted: 1 time
Been upvoted: 3 times
Contact:

Powershell Script which allows me to RDP into multiple servers with single login credential

Post by jvierra »

Are you asking for us to design and write a scrip for you.

I think you need to satrt small. Ask a single question and provide a script that you have tried.

User avatar
aaron-saic
Posts: 2
Joined: Thu Feb 14, 2013 6:43 am

Powershell Script which allows me to RDP into multiple servers with single login credential

Post by aaron-saic »

I am just starting out with powershell, but try the attached script. I would then think that you could write a loop using a file called "servers.txt" that contains a list of the servers you want to RDP to. something similar to this..

$arrServers = get-content
foreach ($server in $arrServers)
{
.Start-RDP -Server $server -Fullscreen
}


NOTES:

make sure that the path to Start-RDP is absolute if not being executed from the directory where it exists...

1) I'm not sure how to pass credentials to this script, it is one I found myself a while ago.. so it will take modifying.
2) I'm not sure how to bypass your security message when it connects...

Attached files /FileUpload/58/df444bb26eb6e9d26fba1941f8d331.txt (7.8 KB)

jvierra
Posts: 14611
Joined: Tue May 22, 2007 9:57 am
Answers: 2
Has voted: 1 time
Been upvoted: 3 times
Contact:

Powershell Script which allows me to RDP into multiple servers with single login credential

Post by jvierra »

Sorry we didn't get a notification for teh reposnse here.

YOu posted the header for the script but not the script. There is no argument for credentials and no way to add one. You need to post the full script.

jvierra
Posts: 14611
Joined: Tue May 22, 2007 9:57 am
Answers: 2
Has voted: 1 time
Been upvoted: 3 times
Contact:

Powershell Script which allows me to RDP into multiple servers with single login credential

Post by jvierra »

Sorry - I see this forum has fooled me again. The file does not display all of its contents but wiull if saved.

You need to add a -connectionfile argument. The connectionfile can be made to save the credentials after the first connection and retreive them on each subsequent call.

The scrip is just a simple wrapper arounf MSTSC andf is probably not even necessary. Just put everything in a batch file.

Locked