Extreme Newby quest. 
Author Message
 Extreme Newby quest.

Hello all:

Very new to WHS Scripting.  Been looking at snippets of code that claim to
be able to determine group membership of a user.  However, all of the code
is making calls to Active Directory through ADSI.  Is it possible to make
this same determination on an NT 4 domain account?  Code would be greatly
appreciated.

Thanks in advance.

Ed Thurber



Wed, 27 Jul 2005 02:53:59 GMT  
 Extreme Newby quest.
Hi Ed,

ADSI is not strictly for Active Directory or other LDAP directories. NT is
also possible. You can connect to an NT SAM using something like:

Set objGroup= GetObject("WinNT://domain/groupname,"group")

I'm sure if you do a search in this grou p or through a search engine on

GetObject("WinNT:

you can find the code you are looking for

Vincent


Quote:
> Hello all:

> Very new to WHS Scripting.  Been looking at snippets of code that claim to
> be able to determine group membership of a user.  However, all of the code
> is making calls to Active Directory through ADSI.  Is it possible to make
> this same determination on an NT 4 domain account?  Code would be greatly
> appreciated.

> Thanks in advance.

> Ed Thurber



Fri, 29 Jul 2005 23:03:59 GMT  
 Extreme Newby quest.

Quote:

> Hello all:

> Very new to WHS Scripting.  Been looking at snippets of code that claim to
> be able to determine group membership of a user.  However, all of the code
> is making calls to Active Directory through ADSI.  Is it possible to make
> this same determination on an NT 4 domain account?  Code would be greatly
> appreciated.

Hi

For a NT 4 domain (as well as a local NT 4.0/Win2k computer), you can use ADSI's
WinNT provider:

WinNT Binding String (ADsPath)
http://msdn.microsoft.com/library/en-us/netdir/adsi/winnt_binding_str...

ADSI WinNT Provider
http://msdn.microsoft.com/library/en-us/netdir/adsi/adsi_winnt_provid...

Example to list all group memberships for a user:

sUserName = "some user"
' for current user, use this
' Set oNetwork = CreateObject("WScript.Network")
' sUserName = oNetwork.UserName

' if local computer, exchange "some domain" with computer name
sDomain = "some domain"

Set oUser = GetObject("WinNT://" & sDomain & "/" & sUserName & ",user")

For Each oGroup In oUser.Groups
  WScript.Echo oGroup.Name
Next

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



Fri, 29 Jul 2005 23:49:52 GMT  
 Extreme Newby quest.
Thank you both, very much.


Quote:
> Hello all:

> Very new to WHS Scripting.  Been looking at snippets of code that claim to
> be able to determine group membership of a user.  However, all of the code
> is making calls to Active Directory through ADSI.  Is it possible to make
> this same determination on an NT 4 domain account?  Code would be greatly
> appreciated.

> Thanks in advance.

> Ed Thurber



Sun, 31 Jul 2005 20:25:03 GMT  
 Extreme Newby quest.
    An excellent resource for WSH/ADSI scripting in VB is the following:

http://cwashington.netreach.net/depo/default.asp?topic=adsifaq

--
Tim Munro



Tue, 02 Aug 2005 23:12:40 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Extreme Ghostscript Newbie !

2. Extreme newbie question

3. Click here for Extreme Net Toolz

4. Extreme Newbie needs help!

5. Oulook Scripting Questing

6. Newbie VBScript quest..

7. Newbie quest.: Show visited pages in a Web

8. script debugger quest

9. RegDelete Quest - Please help

10. Quest: On LARGE postscript pictures

11. Quest for VGA/DOS support

12. newbie quest. - client script with server controls

 

 
Powered by phpBB® Forum Software