Exchange 2010--Powershell Question

Posted on 2013-01-10
Last Modified: 2013-01-10
In setting up the following PS Script:

$List = import-csv D:\user.csv
Get-mailbox $List.Name

I get an output of mailbox information of my entire Exchange organization when I simply want the information of these few users.

My csv is:

What might be the issue?
Question by:Anthony K O365
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
  • 3
  • 3
  • 2
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38764416
What do you want exactly ?

- Tancy

Author Comment

by:Anthony K O365
ID: 38764457
I want to import a csv file and add these users to the ManagedBy permission in this DG, using following PS:

$list=import-csv D:\User.csv
Foreach ($i in $list) {
 $newuser=get-mailbox $
 Set-distributiongroup My_DG -managedby $newuser -bypasssecuritygroupmanagercheck }

any thougths?
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38764470
Get-Content D:\User.csv |  Set-distributiongroup My_DG -managedby "UserName" -bypasssecuritygroupmanagercheck

- Rancy
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.


Author Comment

by:Anthony K O365
ID: 38764508
Here is the error I get when

PS] D:\>./manageby.ps1
Cannot process argument transformation on parameter 'Identity'. Cannot convert value "" to type "Microsoft.Exchange.Configuration.Tasks.UserIdParameter". Error: "Parameter values of type Microsoft.Exchange.Configuration.Tasks.UserIdParameter can't be empty. Specify a value, and try again.
Parameter name: identity"
    + CategoryInfo          : InvalidData: (:) [Get-User], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-User

All groups must have at least one owner who manages membership, message approval, and other settings for the group. Make sure you assign an owner for this group.
    + CategoryInfo          : NotSpecified: (:) [], RecipientTaskException
    + FullyQualifiedErrorId : A34ABEE7
LVL 40

Accepted Solution

Subsun earned 500 total points
ID: 38764529
Try this
$list=import-csv D:\User.csv
Foreach ($i in $list) {
 $Grp= get-distributiongroup My_DG
	$manage = $Grp.managedby
	$Newuser = Get-User $
	$Newmanage = $manage+$Newuser
 Set-distributiongroup $Grp.identity -managedby $Newmanage -bypasssecuritygroupmanagercheck 

Open in new window

LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38764532
What is the command you ran did you provide the username and remove quotes ?

- Rancy

Author Closing Comment

by:Anthony K O365
ID: 38764586
Your last suggestion worked!  However, it still produced the error message "cannot convert the value "" to type...

My csv did not have any quotes. Go figure...

LVL 40

Expert Comment

ID: 38764606
You have lot of trouble with CSV files.. :-).. I didn't see any issue with script.. Can you post the csv file which you used? probably it has some blank lines..

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…
Suggested Courses

630 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