Solved

get-mailbox attributes

Posted on 2013-01-17
4
1,679 Views
Last Modified: 2013-01-17
Hi,

This script works - but the data from the attribute "EmployeeType" are not included in the file.csv anyone knows why?

get-mailbox -ResultSize Unlimited -organizationalunit "OU=myoy,DC=mydc,DC=com" | Get-User | Select-Object sAMAccountName,FirstName,LastName,WindowsEmailAddress,Department,company,employeeType | Export-Csv "C:\file.csv" -Encoding "Unicode"

Regards Carsten
0
Comment
Question by:pacch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:Subsun
ID: 38787932
Get-User doesn't include the employeeType attribute. You may use Get-QadUser (Quest AD cmdlets) or If you have  Windows 2008 then use Get-ADUser.
0
 

Author Comment

by:pacch
ID: 38788369
Thanks for the reply

Tried changing to get-aduser in the script running ADpowershell it wil not recognize get-aduser as a cmdlet- is the syntax differenet then with get-user

get-aduser -ResultSize Unlimited -organizationalunit "OU=myoy,DC=mydc,DC=com" | Get-User | Select-Object sAMAccountName,FirstName,LastName,WindowsEmailAddress,Department,company,employeeType | Export-Csv "C:\file.csv" -Encoding "Unicode"

Regards
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38788428
Try..
Import-Module Activedirectory
Get-ADUser -Filter * -SearchBase "OU=myoy,DC=mydc,DC=com" -Properties * | 
Select-Object sAMAccountName,FirstName,LastName,WindowsEmailAddress,Department,company,employeeType | 
Export-Csv "C:\file.csv" -Encoding "Unicode"

Open in new window

0
 

Author Closing Comment

by:pacch
ID: 38789919
Changed Firstname to givenname, lastname to sn
Worked perfect :-) thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question