Solved

get-mailbox attributes

Posted on 2013-01-17
4
1,096 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
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:Subsun
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Changed Firstname to givenname, lastname to sn
Worked perfect :-) thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hi all.   The other day I had to change the passwords for a bunch of users on the fly. Because they were so many, I decided to do it in an automated way and I would like to share it with you all.   If you are not doing it directly in a Domain Co…
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now