http://www.dd-wrt.com
About Me
- Vaddi Venkat
- SharePoint Architect with over 17 years of IT Experience in various roles as SharePoint Architect, Administrator, Technical Architect, IT Analyst, Application Developer, CRM Consultant, BI Developer, Microsoft Solution Architect in Client/Server, Web and Enterprise CRM Applications in E-Commerce, Financial, Healthcare, Insurance, Telecom, Outsourcing and Technology Services.
MCITP (Pro): Microsoft Certified IT Professional: SharePoint 2010 Administrator.
MCTS: Microsoft Certified Technology Specialist, SharePoint 2010 Configuration.
Sunday, February 10, 2013
Tuesday, January 29, 2013
Scripting Tips
Count of rows in Text File
$totalrows = Import-Csv C:\urls.csv | Measure-Object | Select-Object -expand count
Open/Read text File
AccountNames.csv
AccountName
Domain\Name1
Domain\Name2
$AcctFile="C:\AccountNames.csv"
ipcsv $AcctFile | foreach {
$AName =$_.AccountName
}
Write-host
Write-host "Feature: " $AName -foregroundcolor yellow
Clear-Host
TimeStamp
$strTimestamp = [string](Get-Date -format "yyyy-MM-dd_hh-mm-ss")
$strLogFile = ($strFilePath + "FileName_" + $strTimestamp + ".log")
Log to File
$AName +",Blog-NotFound" | Out-File ($strLogFile) -append
Write-Output "$Class deleted on $CommunityList" | Out-File -Append $strLogFile
"Count :"+$UrlsCount | Out-File -Append $DeletedReport
Log File Creation Prompt:
if ((Test-Path -path $FilePath) -ne $True) {
$NewPathPrompt = "$FilePath does not exist! Would you like to create it?"
$NewPathMessage = ""
$NewPathYes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
"Creates new directory at $FilePath"
$NewPathNo = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
"Do not create new directory and exit"
$NewPathOptions = [System.Management.Automation.Host.ChoiceDescription[]]($NewPathYes, $NewPathNo)
$NewPathResult = $host.ui.PromptForChoice($NewPathPrompt, $NewPathMessage, $NewPathOptions, 0)
switch ($NewPathResult)
{
0 {New-Item $FilePath -type directory}
1 {Write-Host "Cannot continue without valid directory to save output file, exiting..."
Exit
}
}
}
Blog Sites
- Baris's SharePoint Blog. http://blogbaris.blogspot.com
- SharePoint Administration & Development Tools and Guidance
http://blogs.technet.com/b/meamcs/archive/2013/01/02/sharepoint-administration-amp-development-tools-and-guidance.aspx
-
-
- DAN http://sharepointpromag.com/blogger/dan-holme
- SharePoint Security
http://www.sharepointsecurity.com/syndicated-content/first-steps-in-implementing-isa-server-with-sharepoint/
- http://blog.sharepointsite.co.uk/
Remote restart and auto-logon and PowerShell Script execution on remote server.
http://blogs.technet.com/b/meamcs/archive/2013/01/02/sharepoint-administration-amp-development-tools-and-guidance.aspx
http://www.sharepointsecurity.com/syndicated-content/first-steps-in-implementing-isa-server-with-sharepoint/
Remote restart and auto-logon and PowerShell Script execution on remote server.
Thursday, October 18, 2012
Enumerate Crawl Properties using Powershell
1. Save the following script file as Get-EnumCrawlProp.ps1
2. Create an input file for Content Sources (just one content source name in one line)
3. Run the script as PS>Get-EnumCrawlProp.ps1 ProdContentSources.txt
param(
[String]$InputFile = ""
)
If ($InputFile)
{
$ContentSrc = Get-Content $InputFile
$searchapp = Get-SPEnterpriseSearchServiceApplication |where {$_.name -eq "ProdSearchSA1"};
ForEach ($c in $ContentSrc)
{
$csource = Get-SPEnterpriseSearchCrawlContentSource $c -sea $searchapp;
#Write-Host "Crawl State for $c " $csource.CrawlState
$csource.IncrementalCrawlSchedule | select DaysOfWeek, DaysInterval, StartHour, StartMinute, RepeatInterval, RepeatDuration
}
"Process complete."
}
2. Create an input file for Content Sources (just one content source name in one line)
3. Run the script as PS>Get-EnumCrawlProp.ps1 ProdContentSources.txt
param(
[String]$InputFile = ""
)
If ($InputFile)
{
$ContentSrc = Get-Content $InputFile
$searchapp = Get-SPEnterpriseSearchServiceApplication |where {$_.name -eq "ProdSearchSA1"};
ForEach ($c in $ContentSrc)
{
$csource = Get-SPEnterpriseSearchCrawlContentSource $c -sea $searchapp;
#Write-Host "Crawl State for $c " $csource.CrawlState
$csource.IncrementalCrawlSchedule | select DaysOfWeek, DaysInterval, StartHour, StartMinute, RepeatInterval, RepeatDuration
}
"Process complete."
}
Set Crawl Incremental/Full Properties using PowerShell
$ssaName="Search Service Application"
$context=[Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($ssaName)
$daily=New-Object Microsoft.Office.Server.Search.Administration.DailySchedule($context)
$daily.BeginDay="25"
$daily.BeginMonth = "1"
$daily.BeginYear = "2010"
$daily.StartHour = "2"
$daily.StartMinute = "30"
$daily.DaysInterval = "1"
$weekly=New-Object Microsoft.Office.Server.Search.Administration.WeeklySchedule($context)
$weekly.BeginDay="25"
$weekly.BeginMonth = "1"
$weekly.BeginYear = "2010"
$weekly.StartHour = "23"
$weekly.StartMinute = "15"
$weekly.WeeksInterval = "1"
$contentsource.IncrementalCrawlSchedule=$daily
$contentsource.FullCrawlSchedule=$weekly
$contentsource.Update()
Wednesday, October 17, 2012
Who logged into remote server?
qwinsta /server:SERVERNAME
it results details as below.
SESSIONNAME USERNAME ID STATE TYPE DEVICE
it results details as below.
SESSIONNAME USERNAME ID STATE TYPE DEVICE
Subscribe to:
Posts (Atom)