473,396 Members | 1,891 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,396 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 3074
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.