Afficher un message
Vieux 10/10/2007, 17h44   #2
Richard Mueller [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CSVDE Multiple group export..

You can prompt in vb or VBScript. The trick is how to prompt for multiple
values. Do you always prompt for 4 values, or keep prompting until the user
enters a blank? Do you assume the parent container/OU of the groups? Do you
prompt for Common Name or just a 3 digit number and append "H" to it. An
example could be (not tested):

' Prompt for group names and construct the filter.
strCN = ""
strFilter = "(|"
Do
strCN = InputBox("Enter Common Name of a group or Cancel", "Test")
If (strCN <> "") Then
strFilter = strFilter & "(memberOf=cn=" & strCN _
& ",ou=mygp,dc=mydom,dc=co,dc=uk)"
End If
Loop While strCN <> ""

strFilter = strFilter & ")"

' Use the WshShell object to run the csvde command.
If strFilter <> "(|)" Then
Set objShell = CreateObject("Wscript.Shell")
strCmd = "%comspec% /c csvde c:\get-group\GroupMembers.csv -r " &
strFilter
strCmd = strCmd & " -l
sAMAccountName,givenName,physicalDeliveryOfficeNam e,memberOf "
strCmd = strCmd & "-SERVER.DOM.co.uk"
objShell.Run strCmd
End If

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--

"PK" <PK@discussions.microsoft.com> wrote in message
news:2F8920ED-31C0-403A-A615-A348A5A8CF45@microsoft.com...
> Rich can this be built in to VB some how..?
>
> with like a window to promps for group numbers..?
>
> other than that works a charm
>
> "Richard Mueller [MVP]" wrote:
>
>> Paul wrote:
>>
>> > I got the below to work ok, ( I can also export the entire OU)
>> >
>> > csvde -f C:\Get-Group\GroupMembers.csv -r
>> > "memberOf=cn=H050,ou=mygp,dc=mydom,dc=co,dc=uk " -l
>> > "sAMAccountName,givenName,physicalDeliveryOfficeNa me,memberOf"
>> > -SERVER.DOM.co.uk
>> >
>> > But i need to export all members of just 4 groups (from the same OU)
>> > Not
>> > just H050 ie i need to include H051 H052 H053 also..
>> >
>> > Any options \ideas.
>> >

>>
>> The syntax for the filter would be (watch line wrapping):
>>
>> -r
>> "(|(memberOf=cn=H050,ou=mygp,dc=mydom,dc=co,dc=uk) (memberOf=cn=H051,ou=mygp,dc=mydom,dc=co,dc=uk)(me mberOf=cn=H052,ou=mygp,dc=mydom,dc=co,dc=uk)(membe rOf=cn=H053,ou=mygp,dc=mydom,dc=co,dc=uk))"
>>
>> Wildcards are not allowed and you must specify the full distinguished
>> names.
>> The "|" (pipe symbol) is the "OR" operator.
>>
>> --
>> Richard Mueller
>> Microsoft MVP Scripting and ADSI
>> Hilltop Lab - http://www.rlmueller.net
>> --
>>
>>
>>



  Réponse avec citation
 
Page generated in 0,05682 seconds with 9 queries