Struggling trying to get all the ad details exported to a csv
hi all,
i'm bit stuck trying export ad details need can give boss list of accounts.
want check details in things phone nos, etc, have 60 different ous (1 per office) , on 150 users in leavers ou need either exclude them, or @ least list ou can filter it.
oh , want run every week, it's not 1 off
have far:
get-aduser -filter * -property * | select-object givenname,sn,title,department,company,homephone,telephonenumber,mobilephone,pager,streetaddress,l,st,postalcode,lastlogondate | export-csv c:\ad\allusers.csv
i cobbled various bits find, looked @ attribute editor find fields called in ad (i wrote exchange 2010 transport rules for signatures but seemed to called different things in ad. l mean, "l" & "st" really? )
all seem unable last ou list in export , think i'll have everything.
any appreciated.
cheers
rob
get-aduser -filter * -property * | select-object givenname,sn,title,department,company,homephone,telephonenumber,mobilephone,pager,streetaddress,l,st,postalcode,lastlogondate, @{label='parent';expression={([adsi]"ldap://$($_.distinguishedname)").parent}} | export-csv c:\ad\allusers.csv
Windows Server > Windows PowerShell
Comments
Post a Comment