PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms..win.server.scripting > Re: Export Group membership using script\CSVDE
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Export Group membership using script\CSVDE

Réponse
 
LinkBack Outils de la discussion
Vieux 06/10/2007, 01h26   #1 (permalink)
Richard Mueller [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Export Group membership using script\CSVDE

Paul wrote:

>
> Been working on this a whole and im hitting a dead end and need a little
> .
>
> I need to either export Group Membersip, (including several LDAP
> attributes
> as below)
>
> CSVDE -f e:\adusers.csv -r objectCategory=person -d
> "OU=myOU,DC=MyDomain,dc=co,dc=uk" -l
> "userPrincipalName,sAMAccountName,WhenCreated"
>
> This CSVDE script runs through and returns the specified attributes for
> the
> entire OU (myOU), i need to output the same information in the same format
> but by Group.
>
> Ideally however id like to output all users within the OU which created in
> the last 7 days (but i dont know if this is possible).


You can export all groups in the OU and their memberships. That may be the
same thing as your request. Use "-r (objectCategory=group)" and "-l
sAMAccountName,member"

This will output sAMAccountName of all groups in the OU, and Distinguished
Names of all members. You cannot retrieve any other attributes of the
members without a more complicated command (if at all).

To output all users created since 20070928000000.0Z (Sept. 28, 2007, at
00:00:00 UTC) use:

-r
"(&(objectCategory=person)(objectClass=user)(whenC reated>=20070928000000.0Z))"

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


  Réponse avec citation
Vieux 08/10/2007, 14h24   #2 (permalink)
PK
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Export Group membership using script\CSVDE

Hi Richard,

Yes have amended as your recomendation and it works fine.

csvde -f C:\Get-Group\report.csv -r
"(&(objectCategory=person)(objectClass=user)(whenC reated>=20071008000000.0Z))" -l userPrincipalName,sAMAccountName -s saturn.lcbt.co.uk

However i only need Accounts created in a specific OU how would i configure
this..?
Because when i insert "OU=myOU,DC=MyDomain,dc=co,dc=uk" it all stops working
again...!

Thanks for all you ,
Paul

"Richard Mueller [MVP]" wrote:

> Paul wrote:
>
> >
> > Been working on this a whole and im hitting a dead end and need a little
> > .
> >
> > I need to either export Group Membersip, (including several LDAP
> > attributes
> > as below)
> >
> > CSVDE -f e:\adusers.csv -r objectCategory=person -d
> > "OU=myOU,DC=MyDomain,dc=co,dc=uk" -l
> > "userPrincipalName,sAMAccountName,WhenCreated"
> >
> > This CSVDE script runs through and returns the specified attributes for
> > the
> > entire OU (myOU), i need to output the same information in the same format
> > but by Group.
> >
> > Ideally however id like to output all users within the OU which created in
> > the last 7 days (but i dont know if this is possible).

>
> You can export all groups in the OU and their memberships. That may be the
> same thing as your request. Use "-r (objectCategory=group)" and "-l
> sAMAccountName,member"
>
> This will output sAMAccountName of all groups in the OU, and Distinguished
> Names of all members. You cannot retrieve any other attributes of the
> members without a more complicated command (if at all).
>
> To output all users created since 20070928000000.0Z (Sept. 28, 2007, at
> 00:00:00 UTC) use:
>
> -r
> "(&(objectCategory=person)(objectClass=user)(whenC reated>=20070928000000.0Z))"
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab - http://www.rlmueller.net
> --
>
>
>

  Réponse avec citation
Vieux 08/10/2007, 15h16   #3 (permalink)
Richard Mueller [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Export Group membership using script\CSVDE

Use the -d switch to specify the root or "base" of the search:

-d "ou=MyOU,dc=MyDomain,dc=co,dc=uk"

You can get syntax (with a few examples) at a command line on a DC
with:

csvde -?

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

"PK" <PK@discussions.microsoft.com> wrote in message
news:C5BD4C5F-DB7B-4726-9DFD-1E3A2DDFC39E@microsoft.com...
> Hi Richard,
>
> Yes have amended as your recomendation and it works fine.
>
> csvde -f C:\Get-Group\report.csv -r
> "(&(objectCategory=person)(objectClass=user)(whenC reated>=20071008000000.0Z))"
> -l userPrincipalName,sAMAccountName -s saturn.lcbt.co.uk
>
> However i only need Accounts created in a specific OU how would i
> configure
> this..?
> Because when i insert "OU=myOU,DC=MyDomain,dc=co,dc=uk" it all stops
> working
> again...!
>
> Thanks for all you ,
> Paul
>
> "Richard Mueller [MVP]" wrote:
>
>> Paul wrote:
>>
>> >
>> > Been working on this a whole and im hitting a dead end and need a
>> > little
>> > .
>> >
>> > I need to either export Group Membersip, (including several LDAP
>> > attributes
>> > as below)
>> >
>> > CSVDE -f e:\adusers.csv -r objectCategory=person -d
>> > "OU=myOU,DC=MyDomain,dc=co,dc=uk" -l
>> > "userPrincipalName,sAMAccountName,WhenCreated"
>> >
>> > This CSVDE script runs through and returns the specified attributes for
>> > the
>> > entire OU (myOU), i need to output the same information in the same
>> > format
>> > but by Group.
>> >
>> > Ideally however id like to output all users within the OU which created
>> > in
>> > the last 7 days (but i dont know if this is possible).

>>
>> You can export all groups in the OU and their memberships. That may be
>> the
>> same thing as your request. Use "-r (objectCategory=group)" and "-l
>> sAMAccountName,member"
>>
>> This will output sAMAccountName of all groups in the OU, and
>> Distinguished
>> Names of all members. You cannot retrieve any other attributes of the
>> members without a more complicated command (if at all).
>>
>> To output all users created since 20070928000000.0Z (Sept. 28, 2007, at
>> 00:00:00 UTC) use:
>>
>> -r
>> "(&(objectCategory=person)(objectClass=user)(whenC reated>=20070928000000.0Z))"
>>
>> --
>> Richard Mueller
>> Microsoft MVP Scripting and ADSI
>> Hilltop Lab - http://www.rlmueller.net
>> --
>>
>>
>>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h53.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10247 seconds with 11 queries