Link to home
Start Free TrialLog in
Avatar of Simon Allaway
Simon AllawayFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Powershell Script has suddenly stopped working

Import-CSV  C:\distlistcontacts.csv | ForEach-Object {New-MailContact -Name $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -OrganizationalUnit $_.OrganizationalUnit}

When running the script instead of processing just goes to the next line as shown in the picture.User generated imagedistlistcontacts.csv
Avatar of Sunil Chauhan
Sunil Chauhan
Flag of India image

i guess the csv is empty.

plz validate if the data is there when you import the CSV,

you can just run the below cmd it will return the data there in the CSV.

Import-CSV  C:\distlistcontacts.csv
Avatar of Simon Allaway

ASKER

here is the resultUser generated image
ASKER CERTIFIED SOLUTION
Avatar of Sunil Chauhan
Sunil Chauhan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi many thanks that script worked the same way.
Many thanks great response
The  alternate script worked fine as a alternative solution
But it doesn't do anything to solve your issue, it just adds some debugging messages. If it works, your original script works too.