Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exchange 2010--Powershell Question

Posted on 2013-01-10
8
Medium Priority
?
1,270 Views
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:
Name
joe.smith@domain.com
Sue.smith@domain.com
Jane.doe@domain.com

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

Expert Comment

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

- Tancy
0
 

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 $i.name
 Set-distributiongroup My_DG -managedby $newuser -bypasssecuritygroupmanagercheck }
 

any thougths?
0
 
LVL 52

Expert Comment

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

- Rancy
0
Introducing the WatchGuard 420 Access Point

WatchGuard's newest access point includes an 802.11ac Wave 2 chipset, providing the fastest speeds for VoIP, video and music streaming, and large data file transfers. Additionally, enjoy the benefits of strong security as the 3rd radio delivers dedicated WIPS protection!

 

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
0
 
LVL 40

Accepted Solution

by:
Subsun earned 1500 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 $i.name
	$Newmanage = $manage+$Newuser
 Set-distributiongroup $Grp.identity -managedby $Newmanage -bypasssecuritygroupmanagercheck 
}

Open in new window

0
 
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
0
 

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...

Thanks!
0
 
LVL 40

Expert Comment

by:Subsun
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..
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

688 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