I'm in desperate need of your help on creating a powershell script to add text to a SP2013 sites that we're migrating content from. I'd essentially like to add a banner that says 'site is now locked and no longer in use' to site homepages.
I found this article but it's dated as it uses snappin which I understand is no longer supported and superseded by PnP. Any help on how to convert this to a PnP or other supported powershell?
https://www.c-sharpcorner.com/blogs/add-content-editor-web-part-on-the-sharepoint-2013-sites-using-powershell
I will be getting site URls from a csv list which I can script but it's cadding text content webpage on homepages if what I can't seem to do?
Related
A little more context, I'm trying to use PowerShell to search through SharePoint for any files which have a particular Author.
We have an issue where if someone tries to delete a file that is authored by an ex-employee it alerts a different person that they did not have permission for the file to go to recycle bin for some reason and makes them permanently delete it instead. Below is a link of what they get:
Microsoft won't support it as they say they won't supply custom scripts so I was wondering if anyone here had any ideas?
I have a SharePoint Online 2010 site, I have migrated all the content from SP 2010 to SPO. Now I want to only recreate the views from the source site (SP 2010). Because there are so many views, doing it manually is going to take a lot of time. So, is there any chance that I can recreate the views same as the one's in the source using Powershell or any other language?
When it comes to "logs"/"reports" in SharePoint online, it is not so easy to get them, but still I have managed to found a couple of ways. Check this article that I have wrote about how to get user's activities in SPO: https://www.alight.ro/Articles/Efficient-Ways-to-monitor-Site-Collection/
It contains both manually and programmatically ways.
If you prefer to do it programmatically, the best way is by using Exchange Online module . By using a simple command "Search-UnifiedAuditLog" you can get all kind of activities users have performed on a file: download, view, edit etc. And all you have to do is to write a script. See sample code:
[enter image description here][1]
In the article you will find what represents each line of code.
is it possible to render/save a SSRS report as a PDF and upload the PDF-file on the server in a second step? I would prefer Powershell webservices?
Thank you in advance.
You are not showing your code, or what you've even searched for. Folks here don't like it when you don't show any effort, and will quickly downvote your post or vote to close and point you here: https://stackoverflow.com/help/how-to-ask. Closing by telling you that StackOverflow is not a free script writing service.
However, since you are very new here, I'll provide you this, this time.
I am not sure what this is... 'Powershell webservices', but maybe you meant PowerShell Web Access, and if so, that is not what it is for. Saving output to PDF using PowerShell is a real common thing, and well documented all over the web and that just requires a simple search for that content/samples:
See the PowerShell cmdlet
Out-Printer
Just choose a PDF printer installed on the target.
Sending PowerShell Results to PDF (Part 1 - 3)
https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-1
https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-2
https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-3
The author provides samples in each post listed...
Snippet from part 3:
function Out-PDFFile
{
param
(
$Path = "$env:temp\results.pdf",
[Switch]
$Open
)
...
}
Creating PDF files using PowerShell
Sometimes, you may want your scripts to produce output for management
in a format other than plain text or Excel files (CSV). Thanks to
various .NET PDF creation libraries, it is relatively simple to create
PDF reports using PowerShell.
Directly from Microsoft Docs site.
Automate SSRS Report Generation using PowerShell
This blog post is tested on SQL Server 2014 and PowerShell V5.
...
In this blog post I will focus on generating PDF reports via scripting. Let's tackle this piece by piece first, and we'll put
everything in a nice little script at the end of the post.
...
As far as uploading files, that is what the PowerShell web cmdlets are for.
Invoke-WebRequest
Invoke-RestMethod
or the native .Net namespace
WebClient.UploadFile Method
... so as for this... 'Powershell webservices', I am going to assume this is what you meant.
I'm currently trying to work on a method of downloading files from a website using PowerShell v2. So far I can navigate to the appropriate page and click the link to download, however, when I do this the download banner appears at the bottom of the page asking me whether I'd like to open or save the file.
Does anyone know how to reference this banner in PowerShell (or even if it's possible), or failing that perhaps a method of turning off the alerts and saving as default?
Here's an example of a download banner from IE11 that I mention above.
Thanks,
The issue: we have a Document Library which is used for storing emails.
They are frequently viewed and constant download/open with Outlook takes a lot of extra time. We want to make them openable in browser or at least to be available for preview (like Word, Excel, PDF).
In SharePoint Server/Foundation this can achieved by altering Web Application Setting (Browser File Handling) but SharePoint Online lacks such configuration.
Do you know about any OOTB solution or JavaScript library that can help with that?
As far as I know there are no OOTB solutions or JavaScript libraries to help out.
There is a 3rd party tool that offers this capability. SLIM Companion is a browser-based tool that mimics SharePoint as Windows Explorer. It uses the standard functionality from Outlook to create msg files; when users upload msg files it automatically extracts email metadata and populates the corresponding SharePoint columns. Users can drag emails from Outlook to the desktop and then to SharePoint and the metadata is extracted. SLIM Companion previews msg files in SharePoint without opening Outlook, displaying it in the browser. Attachments can be opened directly without first downloading the msg file in Outlook. SLIM Companion consists of a single 200 kB html file and does not require any software installs on SharePoint or the user's computer. See https://www.linkedin.com/pulse/outlook-sharepoint-integration-using-browser-paul-h-k-de-jong or www.slimapplications.com for further details.
Paul de Jong | SLIM Applications