|
|
How to connect to remote server from a machine over the network and query active directory for groups , users, computers which will be given by the user
|
|
"arun" <arunonw3[ at ]gmail.com> wrote in message news:71940db8-7f41-4a15-bb82-c836ac1a912c[ at ]v53g2000hsa.googlegroups.com...
[Quoted Text] > How to connect to remote server from a machine over the network and > query active directory for groups , users, computers which will be > given by the user
That is a somewhat vague specification, so if I give you this answer:
no need to specify a remote server, just get the information from any DC with batch code something like this:
net user /domain username net group /domain groupname net computer /domain computername
/Al
|
|
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> wrote in message news:eLgw0oCKJHA.1156[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > > "arun" <arunonw3[ at ]gmail.com> wrote in message > news:71940db8-7f41-4a15-bb82-c836ac1a912c[ at ]v53g2000hsa.googlegroups.com... >> How to connect to remote server from a machine over the network and >> query active directory for groups , users, computers which will be >> given by the user > > That is a somewhat vague specification, so if I give you this answer: > > no need to specify a remote server, just get the information from any DC > with batch code something like this: > > net user /domain username > net group /domain groupname > net computer /domain computername
< sorry, I posted before I finished by adding this: >
would that suffice, or would you fill in more detail that I was unable to deduce from your question?
> /Al > >
|
|
Thanks Al Dunbar,
What I was trying to do was as follows.
There is a machine win2003, and clients. I want to access the active directory running on the server from any of the client and delete it.
So I am able to connect by the following code. This will create an OU on the domain.
Set objDomain = GetObject("LDAP://dc=*,dc=*") Set objOU = objDomain.Create("organizationalUnit", "ou=*") objOU.SetInfo
As of now fine. Suppose this script is example.vbs. I have logged into the local machine (client) as a normal user with less prvileges. So when I run this script on the remote server win 2003, I want to use something like "RunAs" etc. If I use run as it is not showing me what happened . It just runs, opens and closes one cmd window. And the operation also not done.
Please help if you can?
|
|
Thanks Al Dunbar,
What I was trying to do was as follows.
There is a machine win2003, and clients. I want to access the active directory running on the server from any of the client and delete users, computers etc.
So I am able to connect by the following code. This will create an OU on the domain.
Set objDomain = GetObject("LDAP://dc=*,dc=*") Set objOU = objDomain.Create("organizationalUnit", "ou=*") objOU.SetInfo
As of now fine. Suppose this script is example.vbs. I have logged into the local machine (client) as a normal user with less prvileges. So when I run this script on the remote server win 2003 from a client, I want to use something like "RunAs" etc. If I use run as it is not showing me what happened . It just runs, opens and closes one cmd window. And the operation also not done.
Please help if you can?
|
|
"arun" <arunonw3[ at ]gmail.com> wrote in message news:aff891c4-6b8f-4fd4-8897-0170b7523fcf[ at ]k13g2000hse.googlegroups.com...
[Quoted Text] > Thanks Al Dunbar, > > What I was trying to do was as follows. > > > There is a machine win2003, and clients. I want to access the active > directory running on the server from any of the client and delete > users, computers etc. > > > So I am able to connect by the following code. This will create an OU > on the domain. > > > Set objDomain = GetObject("LDAP://dc=*,dc=*") > Set objOU = objDomain.Create("organizationalUnit", "ou=*") > objOU.SetInfo > > > As of now fine. Suppose this script is example.vbs. I have logged > into > the local machine (client) as a normal user with less prvileges. So > when I run this script on the remote server
You are not running this script on the remote server, you are running it on the computer that you are logged into. The script, in turn, is making changes to your Active Directory, which exists on the domain controller(s) in your network.
> win 2003 from a client, I > want to use > something like "RunAs" etc. If I use run as it is not showing me what > happened . It just runs, opens and closes one cmd window. And the > operation also not done.
How are you running the script when it works for you? Have you changed the default scripting engine from wscript to cscript? If so, have you done this under the profiles of the privileged account you are using?
If you want to see the output of the script, I'd suggest that you run a batch script via runas that looks something like this:
[ at ]echo off cscript.exe //nologo example.vbs pause
/Al
|
|
|