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

x
?
Solved

Why is Set-Clutter import CSV erroring out?

Posted on 2016-11-07
3
Medium Priority
?
73 Views
Last Modified: 2016-11-09
PS Import-CSV –Path E:\PowerShellScripts\CSVTemplates\Template-ClutterFalse.csv| ForEach-Object { Set-Clutter -UserPrincipalName $_.UserPrincipalName -Enable $_.Enable }

Cannot process argument transformation on parameter 'Enable'. Cannot convert value "System.String" to type "System.Nullable`1[System.Boolean]". Boolean parameters accept only Boolean values and numbers, such as
$True, $False, 1 or 0.
    + CategoryInfo          : InvalidData: (:) [Set-Clutter], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-Clutter
    + PSComputerName        : outlook.office365.com
0
Comment
Question by:Bart Opiola
[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
  • 2
3 Comments
 

Author Comment

by:Bart Opiola
ID: 41877652
the CSV file has two columns: UserPrincipalName and Enable which are set to "email@domain.com" and "False" to turn clutter off
0
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 41877659
Assuming the other possible value for "Enable" in your csv is "True", try it like this:
Import-CSV –Path E:\PowerShellScripts\CSVTemplates\Template-ClutterFalse.csv |
	ForEach-Object {
		Set-Clutter -UserPrincipalName $_.UserPrincipalName -Enable ($_.Enable -eq 'True')
	}

Open in new window

1
 

Author Closing Comment

by:Bart Opiola
ID: 41877693
This works better - thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

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