Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why is Set-Clutter import CSV erroring out?

Posted on 2016-11-07
3
Medium Priority
?
81 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
  • 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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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…
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 anti-spam), the admin…
Loops Section Overview

926 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