Exchange Posershell Get-user -OrganizationalUnit Path

Posted on 2013-09-27
Medium Priority
Last Modified: 2013-10-02
I am trying to get the correct syntax for a cmdlet to pull a list of users from an OU within and OU that currently do NOT have mailboxes.
Get-User -OrganizationalUnit place.globla/USA/Miami/Users and variation thereof all give "A positional paramater cannot be found that accepts agrgument place.globla/USA/Miami/Users.
This is so simple but yet is killing me. Any help is appreciated.
Exchange 2010 SP3

Thanks in advance
Question by:kryanC
  • 3
  • 2
LVL 22

Accepted Solution

Nick Rhode earned 1500 total points
ID: 39527892
You would use the ou switch

Get-User -OrganizationalUnit "ou=Users, dc=local"

Author Comment

ID: 39527962
Get-User -OrganizationalUnit "ou=users, ou=miami, dc=contsco, dc=global"
Still get the same error. I am on the same network, same AD, and not sure what is up.

Assisted Solution

kryanC earned 0 total points
ID: 39528075
Got it. Though I added the pssnapin for AD to the Exchange Shell it didn't work. But when I added the pssnapin for Exchange to the AD shell it worked.

Thanks all.
LVL 22

Expert Comment

by:Nick Rhode
ID: 39528101
take out the spaces in the ""  Should be something like this

Get-User -OrganizationalUnit "ou=users,ou=Department,ou=Domain Users,dc=domain,dc=local" -RecipientType user

Author Closing Comment

ID: 39539233
Figured it out and as a snappin issue on my part.

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Just after setting up Cloud PBX connectivity and migrated Skype users to SFBO, we noticed inbound calls not working but outbound calls would work.
Organisation is organized in a pattern to flow the day to day business, every application and system is interdepended on each other and when very important “Exchange Server downtime” happened.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

597 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