Send email from powershell

    # Send email 

# SMTP Server
    $smtpServer "smtp.domain.local"
    # Net Mail Object
    $msg New-Object Net.Mail.MailMessage
    # SMTP Server Object
    $smtp New-Object Net.Mail.SmtpClient($smtpServer)
    # Email
    $msg.From = "%name%@domain.local"
    $msg.ReplyTo = "%name%@domain.local"
    $msg.To.Add("%recipient%@domain.local")
    $msg.To.Add("%recipient2%@domain.local")
    $msg.CC.Add("%recipientCC%@domain.local")
    $msg.BCC.Add("%recipientBCC%@domain.local")
    $msg.Subject = "%subject"
    $msg.Body =
"%body%`n"
    # Send Message
$smtp.Send($msg)
Send email from powershell

CAML.More CAML

1. Null:
<Where><IsNull><FieldRef Name=”CustomField” /></IsNull></Where>
2. Not Null:
<Where><IsNotNull><FieldRef Name=”CustomField” /></IsNotNull></Where>
3. Equal:
<Where><Eq><FieldRef Name=”CustomField” /><Value Type=”Text”>MatchValue</Value></Eq></Where>
4. Not Equal:
<Where><Neq><FieldRef Name=”CustomField” /><Value Type=”Text”>MatchValue</Value></Neq></Where>
5. Greater Than:
<Where><Gt><FieldRef Name=”CustomField” /><Value Type=”Text”>1</Value></Gt></Where>
6. Greater Than And Equal:
<Where><Geq><FieldRef Name=”CustomField” /><Value Type=”Text”>1</Value></Geq></Where>
7. Lower Than:
<Where><Lt><FieldRef Name=”CustomField” /><Value Type=”Text”>1</Value></Lt></Where>
8. Lower Than And Equal:
<Where><Leq><FieldRef Name=”CustomField” /><Value Type=”Text”>1</Value></Leq></Where>
9 Begin With:
<Where><BeginsWith><FieldRef Name=”CustomField” /><Value Type=”Text”>StartString</Value></BeginsWith></Where>
10: Contains:
<Where><Contains><FieldRef Name=”CustomField” /><Value Type=”Text”>ContainString</Value></Contains></Where>

CAML.More CAML

Определение версии и выпуска системы SQL Server

Select @@version

Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

10.50.2500.0 SP1 Enterprise Edition (64-bit)
Выпуск Версия продукта
Пакет обновления 2 для SQL Server 2008 R2 10.50.4000.0
Пакет обновления 1 для SQL Server 2008 R2 10.50.2500.0
SQL Server 2008 R2 RTM 10.50.1600.1

 

Выпуск Версия продукта
Пакет обновления 1 для SQL Server 2012 11.00.3000.00
SQL Server 2012 RTM 11.00.2100.60

 

Выпуск Версия продукта
Пакет обновления 3 для SQL Server 2008 10.00.5500.00
Пакет обновления 2 для SQL Server 2008 10.00.4000.00
Пакет обновления 1 для SQL Server 2008 10.00.2531.00
SQL Server 2008 RTM 10.00.1600.22
Определение версии и выпуска системы SQL Server

Play with folders in SharePoint 2010

 
$web = Get-SPWeb http://len-shareappt
$subFolderName = “D” #Create first subfolder in doc library “C” named “D”
$numberFoldersToCreate = 2;
$list = $web.Lists.TryGetList(‘C’) #Create first doc library named “C”

# Get handle on the subfolder
$subFolder = $list.RootFolder.SubFolders.Item($subFolderName);

#Create folders within an existing folder in a document library

# Create desired number of subfolders
for($i=1; $i -le $numberFoldersToCreate; $i++)
{
$folder = $list.AddItem($subFolder.ServerRelativeUrl, [Microsoft.SharePoint.SPFileSystemObjectType]::Folder, “$folderNamePrefix$i”)
$folder.Update()
write-host $i
}

#Create folders in the root of a document library

# Create desired number of subfolders
for($i=1; $i -le $numberFoldersToCreate; $i++)
{
$folder = $list.AddItem(“”, [Microsoft.SharePoint.SPFileSystemObjectType]::Folder, “$folderNamePrefix$i”)
$folder.Update()
write-host $i
}

Play with folders in SharePoint 2010

Database maintenance SharePoint 2010

Reorganizing and Rebuilding Indexes

http://technet.microsoft.com/en-us/library/ms189858(v=sql.105).aspx

Microsoft SQL Server 2000 Index Defragmentation Best Practices

http://technet.microsoft.com/library/Cc966523

Example: Index fragmentation with insert/updates, measuring it and fixing it

http://blogs.msdn.com/b/sqlserverstorageengine/archive/2008/03/01/example-data-fragmentation-with-insert-updates-measuring-it-and-fixing-it.aspx

Databases used by SharePoint have fragmented indices (SharePoint Foundation 2010)

http://technet.microsoft.com/en-us/library/ff805067(v=office.14).aspx

Database maintenance for SharePoint 2010 Products

http://technet.microsoft.com/en-us/library/cc262731.aspx#DBMaintenanceForSPS2010_MeasureAndReduceIndexFrag

Database maintenance SharePoint 2010