Solved

get-mailbox attributes

Posted on 2013-01-17
4
1,238 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
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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