What if GetObject cannot be used with domain name ?

What if GetObject cannot be used with domain name ?

Post by Piotr Strychar » Thu, 18 Apr 2002 00:09:26



OK.

There is a problem. Everyone provides funny examples with
GetObjets("Winnt://DOMAIN-WHATEVER-CALLED")
However: What if I do not know the domain name or (worse) there is no domain
name and I want to access users ot groups.
The reason for this is to remove ACE entry from file using VBScript. The
code should work on every Win2K version, including non-english version. So:
I cannot say:
CACLS myfile /E /R Everyone
because there is no "Everyone" group in other languages. There is S-1-1-0
SID.
I would browse "WinNT://Domain" object and find groups and SIDs, but... I do
not know the domain name (or computer if it is standalone server or
workstation).

Will someone tell me what to do ?

Piotr.

 
 
 

What if GetObject cannot be used with domain name ?

Post by Darren Handle » Thu, 18 Apr 2002 00:42:54


Quote:> There is a problem. Everyone provides funny examples with
> GetObjets("Winnt://DOMAIN-WHATEVER-CALLED")
> However: What if I do not know the domain name or (worse) there is no
domain
> name and I want to access users ot groups.
> The reason for this is to remove ACE entry from file using VBScript. The
> code should work on every Win2K version, including non-english version.
So:
> I cannot say:
> CACLS myfile /E /R Everyone
> because there is no "Everyone" group in other languages. There is S-1-1-0
> SID.
> I would browse "WinNT://Domain" object and find groups and SIDs, but... I
do
> not know the domain name (or computer if it is standalone server or
> workstation).

In my apps I create a little combo box and let the user tell the app where
to look:

    Dim NameSpace
    Dim Domain

    Set NameSpace = GetObject("WinNT:")

    cboDomain.Clear
    cboDomain.AddItem ("Select a Domain")

    For Each Domain In NameSpace
        cboDomain.AddItem Domain.Name
    Next

Darren Handler
Pediatrix Medical Group

 
 
 

What if GetObject cannot be used with domain name ?

Post by Piotr Strychar » Thu, 18 Apr 2002 15:56:33



Quote:> In my apps I create a little combo box and let the user tell the app where
> to look:

The solution does not solve the problem where there is NO domain (standalone
server or W2K Prof in workgroup).
Also - somewhat useless. I want to use it in the installation script, so it
should run without user interaction. I think that telling user to change ACL
manually could be faster than asking user for domains, checking for
errors....

Another solution, please ?

Regards.

Piotr.

 
 
 

What if GetObject cannot be used with domain name ?

Post by Marc Scheune » Thu, 18 Apr 2002 23:51:09


On Wed, 17 Apr 2002 08:56:33 +0200, "Piotr Strycharz"


>The solution does not solve the problem where there is NO domain (standalone
>server or W2K Prof in workgroup).

Not sure about the stand-alone server (if it's a DC, there is a
domain), but ADSI does not work on a standalone Win2K Pro box that is
not attached to a domain - the Active Directory resides on a Win2K
Server that runs as a Domain Controller, so you always have a domain.

Marc

 
 
 

What if GetObject cannot be used with domain name ?

Post by Piotr Strychar » Fri, 19 Apr 2002 16:06:39



Quote:> Not sure about the stand-alone server (if it's a DC, there is a
> domain), but ADSI does not work on a standalone Win2K Pro box that is
> not attached to a domain - the Active Directory resides on a Win2K
> Server that runs as a Domain Controller, so you always have a domain.

Another words: when finding users or groups on machine (unsure of what
kind), ADSI is useless (because it's not universal).
OK, I'm switching to VBScript group and asking again...

Piotr.

 
 
 

1. Using VB GetObject using a specified security context?

Hi

I am using the GetObject function in a VBScript to create a new user in an
AD with the security context of a domain admin. This works fine from a
domain member server, but what I would like to do is run it from a stand
alone server and run the script with a specified security context ( a
specific user account on the domain ). MSDN specifies that the GetObject
function can "explicitly specify the credentials" but in the examples given
does not cover this method of authentication.

Any Ideas

Thanks

2. How can I change the look of captions?

3. LAN domain name vs. registered domain name question

4. HP 4 plus prints extra pages

5. DNS domain name changed to internet domain name!!

6. HELP PLEASE!!!! Sendmail Hangs on HELO or EHLO

7. SBS2000 & ISP & DNS Domain Name & Netbios Domain Name

8. FS: O2 $3500+S&H

9. Q: (WFW/SAMBA using TCP/IP and NetBEUI) computer name cannot be located

10. Cannot get on Internet with a domain name??

11. GetObject error: 'Cannot create ActiveX component'

12. network name cannot be found - files cannot be viewed

13. Domain Name duplicate when using Exchange Internet Service