Create SPGroups with PowerShell

You can create via PowerShell SharePoint Groups for a specific SiteCollection.

$siteURL = “http://intramania.com/sites/mysitecollection
$web = Get-SPWeb $siteURL
$groups = $web.SiteGroups
$groups.Add(“My-Group-Name-01”, $web.CurrentUser, $null, “SharePoint Group Name 01”)
$groups.Add(“My-Group-Name-02”, $web.CurrentUser, $null, “SharePoint Group Name 02”)
$groups.Add(“My-Group-Name-03”, $web.CurrentUser, $null, “SharePoint Group Name 03”)
$groups.Add(“My-Group-Name-04”, $web.CurrentUser, $null, “SharePoint Group Name 04”)
$groups.Add(“My-Group-Name-05”, $web.CurrentUser, $null, “SharePoint Group Name 05”)

PowerShell: Get creation date of all Site Collection in farm

Get creation date of all site collections in all Web-applications:

$Sites=@();
Get-SPSite -limit ALL|%{
$RootWeb = $_.RootWeb;
$Created = $RootWeb.Created;
$Sites += New-Object PSObject -Property @{SiteUrl=$RootWeb.Url; Created=$Created}
write-host $Sites
$RootWeb.Dispose();
$_.Dispose();
}
$Sites|Export-CSV “C:\SiteCollectionCreated.csv” -NoTypeInformation;

Set Date with EventReceiver

properties.AfterProperties[“ApprovedTimeStamp”] = DateTime.Now.ToString(“yyyy-MM-ddTHH:mm:ssZ”); // Works Fine

properties.AfterProperties[“ApprovedTimeStamp”] = Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Now); // Works Fine

Level of compliance in percentage and color

Display level of compliance in color and percentage.

=”<div style=’background-color:#a41515;text-align:left’>

<div style=’background-color:#20763a;width:”&ROUND([Phase 5]*100;0)&”%;’>

<div style=’text-align:center;width:100%;color:#fff;padding-left:2px;padding-right:2px;white-space:nowrap !important;word-wrap:normal !important’>”&ROUND([Phase 5]*100;0)&”%</div>

</div>”&”</div>”

ModalDialog in SharePoint 2013

<input id=”RadioID” type=radio name=”filterStatus” text=”” value=”” onclick=”openBasicDialog(‘~/prjMass/NewForm.aspx?Source=http://xxx.com/SitePages/MyLPagee.aspx&RootFolder=’,’New Item’);“/>
<script type=”text/javascript”>
//******** Basic Dialog Starts Here ***********/
function openBasicDialog(tUrl, tTitle) {
var options = {
url: tUrl,
title: tTitle
};
SP.SOD.execute(‘sp.ui.dialog.js’, ‘SP.UI.ModalDialog.showModalDialog’, options);

}
//******** Basic Dialog Ends Here ***********/
</script>