Home All Groups Group Topic Archive Search About

How to logon to computers?



Author
11 May 2005 12:13 AM
James Pang
If I am a normal user logon to another computer use a admin user name and
password?

what if the user is domain admin?
what if the user is a remonte local admin?

Author
11 May 2005 1:29 AM
Shenan Stanley
James Pang wrote:
> If I am a normal user logon to another computer use a admin user name
> and password?
>
> what if the user is domain admin?
> what if the user is a remonte local admin?

What?

--
>=- Shenan -=<
>=- MS MVP -=<
--
The information above is intended to assist you; however, it is
suggested you research for yourself before you take any advice - you
are the one ultimately responsible for your actions/problems/solutions.
Whenever possible, the advice will include the method/places used in
compiling the answer.  Also, questions may have been asked to clarify
your situation OR to give you an idea of where to look - do not dismiss
them lightly.
Author
11 May 2005 6:37 AM
James Pang
I mean like down there, where would I write User name and Password?
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("SERVER")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_DfsNodeTarget", "WQL", _
                                          wbemFlagReturnImmediately +
wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "Antecedent: " & objItem.Antecedent
      WScript.Echo "Dependent: " & objItem.Dependent
      WScript.Echo
   Next
Next

Show quote
"James Pang" <news.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:%23A1w$3bVFHA.2***@TK2MSFTNGP14.phx.gbl...
> If I am a normal user logon to another computer use a admin user name and
> password?
>
> what if the user is domain admin?
> what if the user is a remonte local admin?
>
Author
11 May 2005 3:23 PM
Torgeir Bakken (MVP)
James Pang wrote:

> I mean like down there, where would I write User name and Password?
> On Error Resume Next
> (snip)
Hi,

To connect with explicit user credentials to a remote computer with
WMI, you need to use SWbemLocator.ConnectServer.

IWbemLocator::ConnectServer
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/iwbemlocator_connectserver.asp

Some VBScript examples:

Subject: Login with explicit username and password
Newsgroups: microsoft.public.win32.programmer.wmi
http://groups.google.co.uk/group/microsoft.public.win32.programmer.wmi/browse_frm/thread/9011efe14bf8926c/8f8df17efcd1f9d8#8f8df17efcd1f9d8

Subject: ImpersoantionLevel other than impersonate
Newsgroups: microsoft.public.scripting.wsh
http://groups.google.co.uk/group/microsoft.public.scripting.wsh/browse_frm/thread/5ce3fc7b19dfcdb2/c19c3387b36e37c9#c19c3387b36e37c9


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

AddThis Social Bookmark Button