Skip to main content

Posts

To Find installed RAM Serial Number and bank using Power shell

To Find installed RAM Serial Number and bank. Get-WmiObject win32_physicalmemory | select Caption,SerialNumber,BankLabel,Capacity,DeviceLocator,PartNumber,Speed

How to find the Laptop/Desktop System Serial number,Version,Vendor using Powershell

Run the below command in Power shell Command tool. Get-WmiObject win32_ComputerSystemProduct | select vendor,Version,Name,IdentifyingNumber,UUID result will be like this,

Applying Master Pages and CSS for SharePoint Sites using Powershell

Applying Master Pages and CSS. $Webapp = Get-SPWebApplication "http://site url" $Sites = Get-SPSite -ContentDatabase SPPRD_PORTAL_CONTENT1 foreach ($site in $sites) { $web = Get-SPWeb $site.url if ($site.url -eq " "http://site url/demo" )  {  $web.MasterUrl = "/_catalogs/masterpage/v4.master"; $web.CustomMasterUrl = "/_catalogs/masterpage/v4.master";  }  else { $cssurl = $web.Url + "/Style%20Library/custom.css"; $web.MasterUrl = "/_catalogs/masterpage/ custom .master"; $web.CustomMasterUrl = "/_catalogs/masterpage/ custom .master "; $web.AlternateCssUrl = $cssurl } Write-Host $cssurl $web.Update() Write-Host "Master Page and CSS updated at:" $ Sites .Url -foregroundcolor Red Applying CSS $Webapp = Get-SPWebApplication "http://sute url/" $Sites = $Webapp.sites.url foreach ($site in $sites) { $web = Get-SPWeb $site $cssurl = $web.url + "/Shared%20Documents/cu...

To Reset the SharePoint 2010 themes using Power shell

In this following example, to resetting the theme(s) for an entire Site Collection. If one any child Sites within the Site Collection have a custom theme then they’ll be updated, not just the root (inheritance will not be changed): PS C:\> Reset-SPTheme -Site http://siteurl/ In this next example ,to  resetting all child Sites to inherit whatever theme has been specified for the root Site and I’m updating the root Site’s theme with changes to the source files: PS C:\> Reset-SPTheme -Site http://siteurl/ -SetSubWebsToInherit For this last example, to resetting the theme of a specific sub-Site: PS C:\> Reset-SPTheme -Web http://siteurl/ As you can see, this is pretty easy to use and, if you’re deploying your branding via Features and you have theme support then a cmdlet like this can be quite critical when you need to push out updates to that brand. More information click here :

How to Set a theme for SharePoint site using Power shell

Set a theme in SharePoint using Power shell command line.. $SiteUrl = "http://yh2482dt:9999" $NewTheme = "Summer" # Loading Microsoft.SharePoint.PowerShell  $snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'} if ($snapin -eq $null) { Write-Host "Loading SharePoint Powershell Snapin" Add-PSSnapin "Microsoft.SharePoint.Powershell" } # Setting site themes on sites and sub sites $SPSite = Get-SPSite | Where-Object {$_.Url -eq $SiteUrl} if($SPSite -ne $null)  { $themes = [Microsoft.SharePoint.Utilities.ThmxTheme]::GetManagedThemes($SiteUrl); foreach ($theme in $themes)  {  if ($theme.Name -eq $NewTheme)  {  break;  }  }  foreach ($SPWeb in $SPSite.AllWebs) { $theme.ApplyTo($SPWeb, $true);  Write-Host "Set" $NewTheme "at :" $SPWeb.Title "(" $SPWeb.Url ")" } } Write-Host "Themes updated at:" $SPSite.Url -foregroundcolor Red Result w...

Change the SharePoint Master Pages for Publishing Site and Non-Publishing Sites?

 My default master (V4.master)page in SharePoint 2010 V4.master Nowchanging from V4 master page to custom master page using below command in power shell. $site = Get-SPSite http://Site URL/ foreach ($web in $site.AllWebs) { $web; $web.CustomMasterUrl = "/_catalogs/masterpage/custom.master";  $web.Update(); $web.CustomMasterUrl; $web.Dispose() } foreach ($web in $site.AllWebs) { $web; $web.MasterUrl = "/_catalogs/masterpage/custom.master";  $web.Update(); $web.MasterUrl; $web.Dispose() } $site.Dispose() write-host "Complete! Custom.master is now applied"; After execute this command,the result will be like this... custom.master Happy scripting...

SharePoint 2010 Install Step by step

SharePoint 2010_Step by Step Install NOTE : This is an older version of the install. If you want RTM steps, go here From fresh hardware to full SharePoint 2010 dev install, everything you need is right here! No Login required like some other sites! Keep in mind these steps are NOT for production (you wouldn't run your site on beta software would you, even if you did, I hope you paid for it). These steps will change at RTM. Some things to note: 1) Install is using admin account (several of us just couldn't get ALL the features to work with separate service account in Beta) 2) we don't need loopback fix as all the sites are using specific ports instead of host headers. Also, if you don't want to do a domain controller install, you could consider this route (http://bit.ly/ 4oAhpm), but steps here may not work if you do. 1. Start Hyper-V Manager on a 64bit server 2. Click “ Action->New->Virtual Machine ” 3. For Name, type “ sharepoint2010 ” ...

How to determine SharePoint database size? using Powershell

Using PowerShell to determine SharePoint database size? Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name, @{Label ="Size in MB"; Expression = {$_.disksizerequired/1024/1024}} Or Get-SPDatabase | ForEach-Object {$db=0} {$db +=$_.disksizerequired; $_.name + " - " + $_.disksizerequired/1024/1024} {Write-Host "`nTotal Storage (in MB) =" ("{0:n0}" -f ($db/1024/1024))}