?
Solved

get-mailbox attributes

Posted on 2013-01-17
4
Medium Priority
?
1,940 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
A brief introduction to what I consider to be the best editor for PowerShell.
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

770 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