Posts

HTML Image Map

Image
In this POST, we are going to talk about setting up multiple links within one piece of image. Above shown images only single peace of images. But when we click on skype, ebay... it should navigate to respective hyper link. Your html code should contain below format. <html> <head> <title>Image Map</title> </head> <body> <img src="images/weblogo.jpg" alt="" usemap="#logos" /> <map name="logos"> <area shape="circle" coords="68,56,33" href="http://www.stumbleupon.com/" title="StumbleUpon" alt="StumbleUpon" /> <area shape="rect" coords="220,19,306,54" href="http://www.youtube.com/" title="Youtube" alt="Youtube" /> <area shape="rect" coords="367,32,516,84" href="http://www.google.com/" title="Google" alt="Goo...

PowerShell Script for Export to MS SQL Database - data and file upload

This post explains how to upload data from PowerShell script to MS SQL Database table. Also  it will uploads “Test.xml” data to the database table in binary format along with table data. Function ExportToDB { #Get the file [Byte[]]$file = get-content -Encoding Byte "E:\data\test.xml" #Connect to DB $ConnectionString ="Server=XX-XXXX\XXX,10000; Database=TESTDB;Integrated Security=true" $conn = new-object System.Data.SqlClient.SqlConnection($ConnectionString) Try { $conn.Open() #Build the command and parameters $sqlInsert = "INSERT INTO [SITSCD].[dbo].[ContentClassificationReports] (DateCreated,UserCreated,DateModified,UserModified,BinaryContent,Enviroment) VALUES (@DC,@UC,@DM,@UM,@File,@Env)" $cmd = new-object System.Data.SqlClient.SqlCommand($sqlInsert,$conn) $cmd.CommandType = [System.Data.CommandType]'Text' $cmd.Parameters.Add(“@File”, [System.Data.SqlDbType]'VarBinary') $cmd.Parameters.Add(“@D...

Sending email using Powershell script

Image
 Below is a script that can be used to send email using Powershell. If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )   { Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell } $currentDate = Get-Date -Format g $HeaderOne $HeaderTwo $HeaderThree $HeaderFour $Outputreport = "<HTML><TITLE> Test E-Mail notification </TITLE> <head> <style>body {font-family: Calibri;font-size: 14px;}table {border-collapse: collapse;}table, th, td {border: 1px solid black;font-family: Calibri,Verdana;font-size: 14px;}th {background-color: #4CAF50;color:white;}</style></head>                      <BODY>                                           <H2> Test E-Mail notification on $($currentDate) CET </H2>  ...

Convert Time Zone from UTC to Local time using SharePoint 2010 Power Shell script

Function Get-LocalTime($UTCTime) { $UTCTime = [datetime]::ParseExact($UTCTime,"MM/dd/yyyy HH:mm:ss", [System.Globalization.CultureInfo]::CurrentCulture) $LocalTime = $UTCTime.ToLocalTime().ToString("MM/dd/yyyy HH:mm:ss") Return $LocalTime } $UTCtime="04/03/2016 12:17:09" $localTime = Get-LocalTime $UTCtime Write-Host "UTC Time: $($DateString); Local Time: $($localTime)"

Power Shell script beginner in SharePoint 2010

PowerShell in Sharepoint 2010 – Basics Part 1 5.00 / 5  5 1 / 5 2 / 5 3 / 5 4 / 5 5 / 5 2  votes,  5.00  avg. rating ( 97 % score) Introduction In PowerShell basic series part 1, we can learn how to work with  variables ,  arrays  and  hashtables . The basic series is very important to understand the complex codes of powershell. This series will be worth reference guide as most of powershell developers are not aware of the syntax and usage. Usage Variables Following is the simplest way of creating variables and assign value 1 2 $firstName = "Adi" $empId = 999 Other commands to create, retrieve and set variables New-Variable  cmdlet is used to create variables with additional features like description and options like setting as readonly variable Following code creates new readonly variable ‘SiteName’ and assigns value to it. It also provides description what the variable is 1 New-Variable -Na...