Get AD user Properties across the forest

#get all AD users in forest with name like v- and status is enable

$allusers = (get-adforest).domains| %{get-aduser -filter {SamAccountName -like “v-*” -and Enabled -eq $true} -Properties EMployeeNumber -Server $psitem}

# get same account name and employenumber and destinguishname and saved to csv file
$allusers | ?{$PSItem.EmployeeNumber -eq $null} | select SamAccountName,EmployeeNumber,DistinguishedName,@{l=”Domain”;e={($PSItem.DistinguishedName -split “,DC=”)[1..4] -join “.”}} | Export-Csv c:\temp\employnumber.csv -NoTypeInformation

13 Comments

  1. Great – I should definitely pronounce, impressed with your site. I had no trouble navigating through all tabs and related info ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or anything, website theme . a tones way for your customer to communicate. Excellent task..

  2. Excellent post. I was checking constantly this blog and I’m impressed! Very helpful information specifically the last part 🙂 I care for such info much. I was looking for this certain info for a long time. Thank you and good luck.

  3. I carry on listening to the rumor talk about receiving free online grant applications so I have been looking around for the most excellent site to get one. Could you advise me please, where could i find some?

  4. Thanks for another informative site. Where else could I get that type of info written in such a perfect way? I have a project that I’m just now working on, and I’ve been on the look out for such information.

  5. Currently it looks like BlogEngine is the preferred blogging platform out there right now. (from what I’ve read) Is that what you’re using on your blog?

Leave a Reply

Your email address will not be published.