473,378 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Sending username/password/domain to remote pc to access services

I have administrator access on 2 different domains on the network at my job.
I wrote a program to query the registry key on remote PC's and return the
results to an excel spreadsheet. However, the program only works for the
domain I am currently logged into. If I try to query a machine on another
domain I get "permission denied". So I have to log out and log back in to
the other domain.

I recently used a program that added users to a group on remote pc's. This
program allowed you to enter your userid & password for each domain, then it
went out to all the pc's in the list and added the users it needed.

I have 2 questions now:

1. How do I send userid, password, domain name to a remote pc for access?
2. Add, change, delete users remotely?

Thanks!
Nov 20 '05 #1
3 3072
You'll have to impersonate the other login. Query the .NET docs in MSDN for
Impersonation and WindowsPrincipal, and you should see some samples.
Be careful of the options you pass to LogonUser (read the API docs for
LogonUser carefully), because some options create a fast login token, but
bypass some of the steps required to access network resouces.

-Rob Teixeira [MVP]

"Terry Olsen" <to******@hotmail.com> wrote in message
news:O1**************@tk2msftngp13.phx.gbl...
I have administrator access on 2 different domains on the network at my job. I wrote a program to query the registry key on remote PC's and return the
results to an excel spreadsheet. However, the program only works for the
domain I am currently logged into. If I try to query a machine on another
domain I get "permission denied". So I have to log out and log back in to
the other domain.

I recently used a program that added users to a group on remote pc's. This program allowed you to enter your userid & password for each domain, then it went out to all the pc's in the list and added the users it needed.

I have 2 questions now:

1. How do I send userid, password, domain name to a remote pc for access?
2. Add, change, delete users remotely?

Thanks!

Nov 20 '05 #2
You'll have to impersonate the other login. Query the .NET docs in MSDN for
Impersonation and WindowsPrincipal, and you should see some samples.
Be careful of the options you pass to LogonUser (read the API docs for
LogonUser carefully), because some options create a fast login token, but
bypass some of the steps required to access network resouces.

-Rob Teixeira [MVP]

"Terry Olsen" <to******@hotmail.com> wrote in message
news:O1**************@tk2msftngp13.phx.gbl...
I have administrator access on 2 different domains on the network at my job. I wrote a program to query the registry key on remote PC's and return the
results to an excel spreadsheet. However, the program only works for the
domain I am currently logged into. If I try to query a machine on another
domain I get "permission denied". So I have to log out and log back in to
the other domain.

I recently used a program that added users to a group on remote pc's. This program allowed you to enter your userid & password for each domain, then it went out to all the pc's in the list and added the users it needed.

I have 2 questions now:

1. How do I send userid, password, domain name to a remote pc for access?
2. Add, change, delete users remotely?

Thanks!

Nov 20 '05 #3
I've used the example found in MSDN for impersonation. But as the article
says, it doesn't work in W2K because of the default security settings. I
get "Client does not posess the required permissions." Is there a way to
override this in the code without changing the security policy? This other
program I have seems to do it, as it "impersonates" users from 2 domains on
a pc logged in with a "standard user" id.
"Rob Teixeira [MVP]" <RobTeixeira@@msn.com> wrote in message
news:eo**************@TK2MSFTNGP10.phx.gbl...
You'll have to impersonate the other login. Query the .NET docs in MSDN for Impersonation and WindowsPrincipal, and you should see some samples.
Be careful of the options you pass to LogonUser (read the API docs for
LogonUser carefully), because some options create a fast login token, but
bypass some of the steps required to access network resouces.

-Rob Teixeira [MVP]

"Terry Olsen" <to******@hotmail.com> wrote in message
news:O1**************@tk2msftngp13.phx.gbl...
I have administrator access on 2 different domains on the network at my job.
I wrote a program to query the registry key on remote PC's and return the results to an excel spreadsheet. However, the program only works for the domain I am currently logged into. If I try to query a machine on another domain I get "permission denied". So I have to log out and log back in to the other domain.

I recently used a program that added users to a group on remote pc's.

This
program allowed you to enter your userid & password for each domain, then it
went out to all the pc's in the list and added the users it needed.

I have 2 questions now:

1. How do I send userid, password, domain name to a remote pc for

access? 2. Add, change, delete users remotely?

Thanks!


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
Hiya I have to develop a web application for my company in which I need to have a facility for username and password for the employees to do certain tasks. How can this be implemented in ASP. I...
1
by: thoducng | last post by:
I am writing some code to access share folder on a remote network. DirectoryInfo dicInfo = new DirectoryInfo("remoteNetwork\shareFolder"); if (dicInfo.Exists) { //application code...
2
by: Terry Olsen | last post by:
I have administrator access on 2 different domains on the network at my job. I wrote a program to query the registry key on remote PC's and return the results to an excel spreadsheet. However, the...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
0
by: Kirk | last post by:
The following C# web service works fine until you uncomment the lines setting UserName and Password. Then, Process.Start throws an Access is Denied Exception. This is with .NET 2.0, of course...
1
by: kamal | last post by:
hi , When i tried to send mails by using smtp authentication it was giving an exception "Could not access 'CDO.Message' object.". can any body help me. string smtpServer = "smtp.domain.com";...
11
by: Kevin O'Brien | last post by:
Hello, I am creating a sign on screen for my application in which I want to store the username and password in a database table. I was thinking of putting a combo box connected to the database...
0
by: ranishobha21 | last post by:
Dear All, I am sending the code below.i have not specifies the host name.i want to send command to server and get the response from it.but it doesnt work.when i connect with the telnet using ssh...
2
by: Danny | last post by:
Hi all, Trying to send mail with System.Net.SmtpClient, using very simple code just for testing: SmtpClient smtp = new SmtpClient("mail.server.com", 25); smtp.Credentials = new...
6
by: Jack | last post by:
Hi, I am still new to .NET so, i'm sorry if my question is a bit too simple :-) I would like to know what is the "best-practice-way" of sending email from asp.net (VbScript). I want to make a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.