Solved

Help with Powershell Script

Posted on 2012-12-21
4
434 Views
Last Modified: 2012-12-21
I need help with the following:

Import-csv d:\displayname4.csv |foreach {$_.Name |select-object prohibitsendquota, issuewarningquota, prohibitsendreceivequota} |export-csv D:\QuotaLimit.csv

the csv is:
Name
Tom Smith
Sue Smith
Bob Smith

My Problem is two-fold
1-I'm missing a variable somewhere such $mail = Import-csv. Not sure where to place the variable.
2-If I place quotes around the user i.e. "Tom Smith"-when I open the csv in Notepad, it shows triple quotes """Tom Smith"""--causing issues with the script

Any thoughts?
Thanks!
0
Comment
Question by:K Anthony O365
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Akhater earned 250 total points
ID: 38713862
you don't need quotes in the csv even if the name has spaces

$a = Import-csv d:\displayname4.csv

$a|foreach {get-mailbox $_.Name} |select-object name, prohibitsendquota, issuewarningquota, prohibitsendreceivequota |export-csv D:\QuotaLimit.csv
0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 250 total points
ID: 38713940
Get-mailbox is missing inside the foreach loop.. also the csv doesn't require quotes as mentioned by  Akhater. When you run the Import-csv command it should show result as shown in screenshot.
Import-csv d:\displayname4.csv |foreach {Get-mailbox $_.Name |select-object prohibitsendquota, issuewarningquota, prohibitsendreceivequota} |export-csv D:\QuotaLimit.csv

Open in new window

Import-csv
0
 

Author Comment

by:K Anthony O365
ID: 38714537
Excellent! This is what I was missing.
0
 

Author Closing Comment

by:K Anthony O365
ID: 38714541
Excellent! This is what I was missing. Excellent service
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
To show how to create a transport rule 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 >> Rules tab.:  To cr…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

803 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