using getobject to refer to local computer

using getobject to refer to local computer

Post by joh » Sun, 13 Apr 2003 03:41:29


Is there a convenient way to have GetObject() refer to the local
computer when getting objects from the WinNT provider?

In other words, if want to do this:

     user = GetObject("WinNT://ThisComputer/SomeUser")

Is there a way to leave out the reference to "ThisComputer" and have
GetObject understand to retrieve the user from the local account
database?  A la...



using getobject to refer to local computer

Post by Max L. Vaughn [MSF » Wed, 16 Apr 2003 02:48:43

No.  You will need to specify the local machine.

You can retrieve the local machine name from the WinNTSystemInfo object.

for example if you always want to bind to the administrator account on a local box you can try:

set oSys = CreateObject("WinNTSystemINfo")
comp = oSYs.ComputerName
set oAdMin = GetObject("WinNT://"&comp&"/administrator,user")
WScript.Echo oAdMin.Name

Max Vaughn [MS]
Microsoft Developer Support

Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.


1. what utility is MS using to migrate local computer profiles to SBS 2003 domain accounts?


I am experimenting around in my lab environment getting SBS 2003 up and
running (all my experience is with regular Windows 200x server/domains).  
Needless to say, it is interesting but MS does a really good job of
automating a lot of the procedures that I am normally used to doing
manually or with my own scripts.  I can definately see why a small business
wouldn't find this product as daunting.

My question is during the process of adding my test workstations to the SBS
domain I go to the URL http://<servername>/ConnectComputer/ and associate
the local machine profiles to the new domain profiles.  It then goes
through the process of migrating all the data and settings.  Can someone
point me in the right direction of some whitepaper that describes what is
going on in the background as well as the exe that was used to migrate to
the new domain profiles?  Is it some new tool or just a GUI front-end to
the moveuser tool from the resource kit?  


2. Strange Problem Related to Norton Firewall

3. Using VB GetObject using a specified security context?

4. Infile

5. Add a user to the local Admin Group on local computers

6. Is there a version of SEDT for SunOS?

7. Getting distinguished name of a computer object (not the local computer)

8. RNIS/X25 on Sun ?

9. GetObject fails when accessig webpage from remote computer

10. What if GetObject cannot be used with domain name ?

11. bind to AD using getObject

12. calling GetObject using GUID with SiteServer

13. How can I getObject based on displayName without using adodb?