Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = "Select Name, unCName, ManagedBy from " _
& "'LDAP://DC=Fabrikam,DC=com' where objectClass='volume'"
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo "Share Name: " & objRecordSet.Fields("Name").Value
Wscript.Echo "UNC Name: " & objRecordSet.Fields("uNCName").Value
Wscript.Echo "Managed By: " & objRecordSet.Fields("ManagedBy").Value
objRecordSet.MoveNext
Loop
Rgds.
On Thu, 16 Sep 2004 14:56:56 -0400, Klenke, Brian <brian.klenke (at) 53 (dot) com [email concealed]> wrote:
> I am looking for a VBScript that will return a list of shares of a given
> computer, along with each share's share permissions and NTFS permissions...
>
> Brian Klenke, CISSP CCNA
>
> This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated.
>
> ------------------------------------------------------------------------
---
> ------------------------------------------------------------------------
---
>
>
--
__________________________________
Lucas A. Gomez
Enumerate Published Shares
(http://www.microsoft.com/technet/community/scriptcenter/filefolder/scrf
f34.mspx)
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = "Select Name, unCName, ManagedBy from " _
& "'LDAP://DC=Fabrikam,DC=com' where objectClass='volume'"
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo "Share Name: " & objRecordSet.Fields("Name").Value
Wscript.Echo "UNC Name: " & objRecordSet.Fields("uNCName").Value
Wscript.Echo "Managed By: " & objRecordSet.Fields("ManagedBy").Value
objRecordSet.MoveNext
Loop
Enumerate File Attributes
(http://www.microsoft.com/technet/community/scriptcenter/filefolder/scrf
f34.mspx)
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = "Select Name, unCName, ManagedBy from " _
& "'LDAP://DC=Fabrikam,DC=com' where objectClass='volume'"
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo "Share Name: " & objRecordSet.Fields("Name").Value
Wscript.Echo "UNC Name: " & objRecordSet.Fields("uNCName").Value
Wscript.Echo "Managed By: " & objRecordSet.Fields("ManagedBy").Value
objRecordSet.MoveNext
Loop
Rgds.
On Thu, 16 Sep 2004 14:56:56 -0400, Klenke, Brian <brian.klenke (at) 53 (dot) com [email concealed]> wrote:
> I am looking for a VBScript that will return a list of shares of a given
> computer, along with each share's share permissions and NTFS permissions...
>
> Brian Klenke, CISSP CCNA
>
> This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated.
>
> ------------------------------------------------------------------------
---
> ------------------------------------------------------------------------
---
>
>
--
__________________________________
Lucas A. Gomez
------------------------------------------------------------------------
---
------------------------------------------------------------------------
---
[ reply ]