Hot answers tagged

3

Add the following to DOCICON.XML (default location is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML) <Mapping Key="csv" Value="icxltx.png" OpenControl=""/> Then in IIS Manager select the server and then select MIME Types, update the entry for csv to 'application/vnd.ms-excel'. This will allow you to click the ...


3

Create SPQuery object and set its Folder property and then call GetItems on List and finally loop through the item collection. $spQuery = New-Object Microsoft.SharePoint.SPQuery $spQuery.Folder = $folder; $items = $list.GetItems($spQuery);


3

PowerShell for SharePoint Online has really limited capabilities at the moment. There is no one liner to automate this task. But you can use CSOM inside your scripts. [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint.Client') | Out-Null $login = 'test@test.onmicrosoft.com' $password = ConvertTo-SecureString 'password' -AsPlainText ...


3

By default SharePoint only support IQY format, In order to export the list into csv you have to use the 3rd party tools or run some kind of script. for 2010 $spSiteUrl = "http://sharepointwebapplication" $listtitle="My Custom List" $spWeb= Get-SPWeb -Identity $spSiteUrl Function ImportDataFromListToCSV { IF($spWeb -ne $null) { $list = ...


3

Just a five minute pseudocode, this should work... add-pssnapin microsoft.sharepoint.powershell $SPWeb = get-spweb http://sharepoint/sites/sitecollection/subsite $owner = "domain\adminuser" $op = New-SPClaimsPrincipal $OwnerName -IdentityType WindowsSamAccountName $owner = $SPWeb | Get-SPUser $op $csvlocation = "c:\csv\users.csv" $values = Import-Csv ...


2

I'm guessing it is because of this section: "Modified By" = $item["Editor"] "Modified Date" = ($item["Modified"] -as [datetime]).DateTime In reality, you should be using $version to get to the version history of the item. You are iterating over each version of the item, yet you are referencing the item properties. Something like: "Modified By" = ...


2

Perhaps consider processing it in batches, instead of trying to process all items: http://msdn.microsoft.com/en-us/library/office/ee557257%28v=office.14%29.aspx


2

You can also setup a basic SSRS report to list all the columns you want, then set a subscription on it to export it as a CSV file (to a doc library or network share) on a scheduled basis. Iterating by loop of any object as per your script will always get slower with the increasing volume of objects.


2

Try to use Owner instead of owneralias, and SecondaryContact instead of secondaryowneralias.


1

simple: Get-SpWebApplication http://www.contoso.com | Get-SPSite -Limit All | Select URL, ID, contentdatabase,Owner, SecondaryOwner | Export-CSV "f:\VLESites.csv" -NoTypeInformation


1

Here is the script. It will get you primary administrators in an excel file for each site collection inside a web application. I am not able to get Secondary Owner Property though. $WebApplicationUrl = "https://peopletest.brookfield.com" $outputFile1 = "C:\TEMP\siteCollectionAdminsPrimary.csv" $outputFile2 = "C:\TEMP\siteCollectionAdminsSecondary.csv" ...


1

Since you are passing values from csv file and all the users are getting updated in a loop. I can think of a below possible way to trace the problem and a possibility to crack a problem. Trace the problem: It might be possible that, for 2 users you are saving same value in CustBusinessUnit. So in first iteration of loop, while you update the user profile, ...


1

After many tests, finally I can reproduce the error "There is already a term with the same default label and parent term" In my custom termset 'CustBusinesUnit', the "IsAvailableforTagging" is unchecked. It means: User profile cannot REUSE the existing terms in the termset User profile can ADD NEW terms in the termset and use it as the profile value ...


1

Try this $FilePath = "http://ServerName/sites/SiteName/MyDocumentLibrary/MyCSVFile.csv" $localPath = "C:\temp\test.csv" #Make sure temp folder exists $wc = New-Object System.Net.Webclient $wc.DownloadFile($FilePath, $localPath) $list = Import-Csv $localPath


1

It would be because of this: $new['Assignedto] = $item.ResponsibleTranslate; The internal name of the Assigned To column would be $new['AssignedTo'] = $item.ResponsibleTranslate;, you are also missing the closing apostrophe.


1

There was a same question on stackexchange and answered.I hope this article helps you out. How to import term sets to Managed Metadata Service using PowerShell and CSV file Also the below TechNet article explains the CSV file format for metadata termset values. https://technet.microsoft.com/en-us/library/ee424396.aspx However if you have the well ...


1

you would have to create a custom solution to perform this, possibly through the Taxonomy Client Service.


1

There is 2 ways of doing this: Either write your own tool, or use a bought one. There is nothing out of the box I am afraid. If you want to write your own tool, then I would look at SPServices on codeplex I believe it has just had a taxonomy update. Or use a webpart in page. The two companies to look at, that provide tools for exactly this are Metavis and ...


1

Personally, I would use PowerShell. But, if you really must use BCS, look at the samples for creating a custom BSC Connector to XML, XLS, or CSV. There are several out there. Scot Hillier wrote the book and there are samples in there: http://www.amazon.com/Professional-Business-Connectivity-Services-SharePoint/dp/047061790X Once you have the BCS connection ...


1

make sure that the values are correct for CSV. In your csv file how is is seperated? like so? hello "," blah "," magic "," sweet as you can see between each text is "," or , now looking at your csv format I can see an issue with: Political Geography,"A sample term set",,True,"One of the 7 continents","Continent","Asia" instead ammend it and try: ...


1

I found my answer by fooling around with some HttpUtility methods. $Value = &lt;b&gt;Dear {0} Team,&lt;/b&gt;&lt;br/&gt;{1} request was completed &lt;a href='{2}'&gt;{3}&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;{2}&lt;br/&gt;&lt;br/&gt;To download the PDF of the form please click &lt;a ...


1

I have done the same some months ago. See the following sample: $destination = "C:\\tools\\Folder" $webUrl = "<Url of the specific site>" $listUrl = "<Url of the specific list. This url is complete Url and NOT relative url>" ############################################################## $web = Get-SPWeb -Identity $webUrl $list = ...


1

Try SPListItem.File.Url to get the the relative url of the file. And SPWeb.Url to get the url of the web and combine them together. In your code use: "Path" = $web.Url + "/" + $_.File.Url The code may look something like this. Note: I have not tested it. But it will give you an idea how to go with your scenario: if((Get-PSSnapin ...


1

I had this same issue some days ago. Following code works for me to escape this problem. protected void Page_Load(object sender, EventArgs e) { string js = @"_spSuppressFormOnSubmitWrapper = true;"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "js", js, true); }


1

Could you use the jQuery SP Services lib to save the values to a CSV file to a library in SharePoint and then direct them to that file? I've never used SP Services but I have heard great things about it.


1

In the lack of more details concerning the possibilities would work for you (e.g. looking at custom development or a no-code solution), i would the easiest is to use the BDC via SharePoint Designer to load from external source according to your schema. The major point here is what possibilities you have: could you bulk-export to some data store accessible by ...


1

Just to understand correctly, do you want to use the CSV file to provide metadata for the files that will be imported from the file share? If so, the approach depicted in the article (SPJeff) will not work. This sample uses a SP list as destination (as opposed to a SP library which is needed to support files). Look at this article in Code Project ...


1

If you only need the checked-out files, then I believe you should not loop over the list items in your code i.e. remove foreach($item in $items) which is present inside foreach($file in $files). Moreover, if you want to get the SPListItem associated with the SPFile, you can use SPListItem.File property for that.


1

Thanks Eric Alexander as I have figured it out with some direction from you. I have found also that by changing this line: "Item Name" = $item.File.Name To: "Item Name" = $item.Name That it returns both list names and file names from Doc Libraries as well. I tried what you posted but some Item Names returned blank. Not sure of what the reason was.


1

It looks like you're using $item["Modified"] to get the modified date of the version - I think you need to use $version["Modified"] or else it will just continue to use the modified date of the current, latest version. Same for the rest of the fields. Hope this helps!



Only top voted, non community-wiki answers of a minimum length are eligible