jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-17T13:46:28Z
Hello,

I'd like to import users into the forum. We are using active directory to identify people. What columns should the file have to import correctly?

I keep getting an error: Input failed, wrong file format. I'm using Excel (2010) to generate the csv file.
These are the columns I'm using:

Name,DisplayName,Email,TimeZone,RankName,Roles,

JS
Sponsor
Zero2Cool
2013-07-17T14:07:06Z
Export your current users (even if only guest) and you'll get the full list of columns needed.
jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-17T14:26:07Z
Did that and left off the UserID - and still the same error message. I'm using Excel 2010 to create the csv file - any issues with that?

Also do I need to submit all the columns?
Zero2Cool
2013-07-17T16:00:20Z
I actually created an app to import all my users, but it only worked with DNN and haven't tried it with YAF stand alone. Unfortunately, I am of no help. I was hoping the export to get all fields would be the bingo for ya.
jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-17T16:07:11Z
Do you have the query for the insert? I can go straight into SQL and update the tables.
Zero2Cool
2013-07-17T16:58:58Z
I want to stress I have NOT tried this, but if I were to desire importing users, I would first evaluate the [dbo].[yaf_user_save] stored procedure.


IF that procedure does the trick, you could easily code something that cycles through a collection of users to import and pass the necessary parameters through the stored proc to meet your goal.
jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-17T19:23:27Z
Thanks I will check it out. Right now there's only a couple of people in there so I could dump it out and start again.
tha_watcha
2013-07-18T04:34:10Z
Originally Posted by: jslist 

Hello,

I'd like to import users into the forum. We are using active directory to identify people. What columns should the file have to import correctly?

I keep getting an error: Input failed, wrong file format. I'm using Excel (2010) to generate the csv file.
These are the columns I'm using:

Name,DisplayName,Email,TimeZone,RankName,Roles,

JS



This error is only thrown when the content type of the file is not an csv file it should be case "text/csv", "text/comma-separated-values", "application/csv", application/vnd.csv". I guess excel 2010 uses a different one.


UserPostedImage
jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-18T14:01:40Z
Here's a copy of the 1 test user I'm trying to import. The file is saved as .csv in notepad. I tried removing UserID but same result.

UserID,BoardID,Name,DisplayName,Email,TimeZone,Avatar,Signature,Suspended,LanguageFile,ThemeFile,UseSingleSignOn,TextEditor,OverrideDefaultThemes,PMNotification,AutoWatchTopics,DailyDigest,NotificationType,IsGuest,IsDST,IsFacebookUser,IsTwitterUser,Culture,CultureUser,RankName,RealName,BlogServiceUrl,Blog,Gender,MSN,Birthday,BlogServiceUsername,BlogServicePassword,AIM,GoogleTalk,Location,Country,Region,City,Interests,Homepage,Skype,ICQ,XMPP,YIM,Occupation,Twitter,TwitterId,Facebook,Roles
7,1,CONAME\RUSD,CONAME\RUSD,DRus@CONAME.org,-360,,,,,,False,,False,True,True,False,30,False,False,False,False,,,Member,,,,0,,1/1/0001 12:00:00 AM,,,,,,,,,,,,,,,,,,,Registered

Still comes up wrong file format. Any ideas?
jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-18T15:00:25Z
Better yet can someone post a sample csv file or xml with 1 or 2 records? That way I'll just copy it and duplicate it here.
Zero2Cool
2013-07-18T15:02:26Z
Originally Posted by: jslist 

Better yet can someone post a sample csv file or xml with 1 or 2 records? That way I'll just copy it and duplicate it here.



Have you tried the stored procedure?


I wonder if the import was updated when certain fields were modified in the changesets after 1.9.6? That could be part of the issue.


Download the source code and check this out ...

/pages/admin/users_import.ascx


Maybe that will help you find the issue?
tha_watcha
2013-07-18T15:54:49Z
Originally Posted by: jslist 

Better yet can someone post a sample csv file or xml with 1 or 2 records? That way I'll just copy it and duplicate it here.



i attched a sample. One note you should add a default password credentials with columns "Password", SecurityQuestion" and "SecurityAnswer". if there are not provided there are randomly generated.
File Attachment(s):
testimport.zip (1kb) downloaded 113 time(s).

UserPostedImage
jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-18T18:35:03Z
Thanks for sending that over so quick. But had the same error come up. "Input failed, wrong file format!" I edited the file with textpad so no excel anywhere near it. One thing - the Name & DisplayName are the full active directory account - "Company\SmithJ" Would the \ be throwing it off? Nope just tested it.

Something else has to be going wrong.
tha_watcha
2013-07-19T10:42:42Z
Originally Posted by: jslist 

Thanks for sending that over so quick. But had the same error come up. "Input failed, wrong file format!" I edited the file with textpad so no excel anywhere near it. One thing - the Name & DisplayName are the full active directory account - "Company\SmithJ" Would the \ be throwing it off? Nope just tested it.

Something else has to be going wrong.



Can you attach the updated file here, so i can take a look?
UserPostedImage
jslist
  •  jslist
  • 52.6% (Neutral)
  • YAF Camper Topic Starter
2013-07-19T16:43:36Z
Ok here's the file

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved