Showing posts with label email. Show all posts
Showing posts with label email. Show all posts

Sunday, 16 October 2016

Automated Windows Server monitoring, maintance on daily alert email using powershell, check low space

Hey, Hello Dear reader, we have another blog, that is useful for Windows Admin, Server Admin or SharePoint Admins also,

We have number of servers for productions, UAT and Integration so going to each server (DB, WFE, Application and DMZ servers) etc and checking for frees pace or Server should have all running services running etc that's really hectic and time consuming, people already started making thier task automated to monitor 10 of or even 100s of server..

In short, yeah we can MAKE WORK Short as blog link says, we can do it in simpler way.

we need to create a task scheduler and run PowerShell script that can check for free space, running services and process etc... and send an email for all these details.

Here I am sharing sample script to check timely Server space daily and sends an alert email using powershell.





Any time above sample can be downloaded on clicking Download here link.

--
Comments & Feedback are welcome, and yeah don't forget to share this make short link.



Sunday, 7 August 2016

SharePoint send email jQuery, without server code

You have a requirement or and this is one of the very common scenario to send email from SharePoint using jQuery or client side code...

No problem! we have simple solution, No need to create workflows or server code for emails, just use this simple function:

function UtilitySendEmail(fromEmails, toEmails, emailBody, subject) {

var siteurl = _spPageContextInfo.webServerRelativeUrl;

/* Yes, you can user SPUtility as service that has SendEmail Menthod.*/

var urlTmplt = siteurl + "/_api/SP.Utilities.Utility.SendEmail";
$.ajax({
   contentType: 'application/json',
   url: urlTmplt,
   type: "POST",
   data: JSON.stringify({
       'properties': {
           '__metadata': { 'type': 'SP.Utilities.EmailProperties' },
           'From': fromEmails,
           'To': { 'results': [toEmails] },
           'Body': emailBody,
           'Subject': subject
       }
   }
 ),
   headers: {
       "Accept": "application/json;odata=verbose",
       "content-type": "application/json;odata=verbose",
       "X-RequestDigest": $("#__REQUESTDIGEST").val()
   },
   success: function (data) {
      alert("Email has been sent");
   },
   error: function (err) {
       alert(err.responseText);
   }
});
}

You can call this Method to email in SharePoint Online, and SharePoint 2013+ versions.