Month: May 2013

How to kill a session on Windows Server(Log off other user from server)

This post is continution to my previous post

http://gadekarsatish.blogspot.in/2013/02/log-off-other-user-from-server.html

In alernative to above approach we can also use below approach

1.       Run command prompt with admin privileges

2.       Run the query “query session”

3.       Note the ID to kill

4.       Run the query “rwinsta ID /v”

Advertisements

Warm Up Script for SharePoint

You can use this warm up script after deployment in SharePoint it will bring back your site faster thna browser.

Write below line in text file and save as BAT file

####################################################################
powershell -command “& ‘D:\Satish\WarmUp\Satish\WarmUp.ps1′”
####################################################################

Write Below lines in text file and save as ps1 file

####################################################################
    $ver = $host | select version
    if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = “ReuseThread”} 
    if ((Get-PSSnapin “Microsoft.SharePoint.PowerShell” -ErrorAction SilentlyContinue) -eq $null) {
        Add-PSSnapin “Microsoft.SharePoint.PowerShell”
    }
    
   function Get-WebPage([string]$url)
   {
       $wc = new-object net.webclient;
       $wc.credentials = [System.Net.CredentialCache]::DefaultCredentials;
      $pageContents = $wc.DownloadString($url);
      $wc.Dispose();
     return $pageContents;
   }
   

write-host “http://igtehydzbnv02:2210/sites/AppCentralSatish/“;
$html = Get-WebPage -url “http://igtehydzbnv02:2210/sites/AppCentralSatish/“;
write-host “Done”;
read-host;
#######################################################################