.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server



View Complete Post

More Related Resource Links

Test Run: Request/Response Testing with Windows PowerShell


Did you know you can use Windows PowerShell to perform lightweight request/response testing for an ASP.NET Web app? Here's how.

Dr. James McCaffrey

MSDN Magazine May 2008

Test Run: Web UI Automation with Windows PowerShell


Here we show you how to use Windows PowerShell to create quick and easy UI test automation for ASP.NET and classic ASP Web applications.

Dr. James McCaffrey

MSDN Magazine March 2008

Cmdlets: Extend Windows PowerShell With Custom Commands


Jim Truher presents an introduction to writing and registering your own custom cmdlets to be used in Windows PowerShell.

Jim Truher

MSDN Magazine December 2007

Test Run: UI Automation with Windows PowerShell


This installment of Test Run is a guide to using Windows PowerShell to perform ultra lightweight UI automation.

Dr. James McCaffrey

MSDN Magazine December 2007

Video: SharePoint 2010 Integration with PowerShell

Learn about the new PowerShell integration in SharePoint 2010, which brings SharePoint administration in line with other server products such as Exchange. Understanding PowerShell is a must-have skill for SharePoint 2010 developers. (Length: 19:52)

SQL Server Powershell script error!

Hi, I get the following error while trying to execute a powershell script. New-Object : Cannot find type [Microsoft.SQlServer.Management.Sdk.Sfc.SqlStoreConnection]: make sure the assembly containing this type is loaded. I'm trying to implement policies across different sql server instances from a primary instance. The script can be found @ http://blogs.msdn.com/sqlpbm/archive/2008/06/14/running-against-sql-server-2005-and-sql-server-2000.aspx Thanks for your help.

powershell with sql server - wheres the reference info?

Hello, Not sure if this is the right group for this. I need to automate some sql server managements tasks with powershell. Where can I get documentation on how to use objects and methods exposed by the sql server powershell provider? like .script() for example? The type and format of info I'm looking for is like what you would find when hitting the F1 key in visual studio.. easily finding a class of interest, getting a list of all it's members, clicking a particular member and seeing all it's overloads (if the member is a method), and then clicking a particular method overload for a description of what it does, input param descriptions, return value etc... plus sample usage. I need this for powershell in general, and specifically for the methods in the sql server powershell provider at the moment. does this exist? 

Powershell script that uses Microsoft.SqlServer.Management.Smo.Server need to use Sql Server Autheni

I have written a powershell script that uses Microsoft.SqlServer.Management.Smo.Server.  I have a couple of instances that are on different domains that I must use Sql Server authenication.  I am going to create a report user "sssmorpt".  What is the least a can grant this user to allow me to use Microsoft.SqlServer.Management.Smo.Server to get "$dbsize = $db.size - ($db.logfiles|measure-object -property size -sum).sum / 1024" for all databases in an instances?

PowerShell script to add/edit ContentEditor webpart on SharePoint 2010

Hi all, I'm new to PowerShell scripting with SharePoint. Following are the requirements that were given to me. Can any one direct me in the right direction interms of writing the script and how to save and execute the script? I am aware of Cmdlets. 1. Cycle through all sites in site collection 2. For each site, retrieve all document libraries 3. Look for specific CMV document library name (ie value communication, key business drivers, etc)          o add content editor web part if doesn't exist          o add/update appropriate description based on the document library name Thanks in advance...

Problem with Scripter class in powershell

tweaked my wits on this one. can't figure it out!i'm trying to follow the steps at the bottom of this page http://www.mssqltips.com/tip.asp?tip=1842  [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO')| out-null # Create an SMO connection to the instance$s = new-object ('Microsoft.SqlServer.Management.Smo.Server') "LOCALHOST\SQL2005_1" $dbs = $s.Databases$dbs["Northwind"].Script() | Out-File D:\PSScripts\NWind.SQL $scrp = new-object ('Microsoft.SqlServer.Management.Smo.Scripter') ($s) $scrp.Options.AppendToFile = $True$scrp.Options.ClusteredIndexes = $True$scrp.Options.DriAll = $True$scrp.Options.ScriptDrops = $True$scrp.Options.IncludeIfNotExists = $True$scrp.Options.IncludeHeaders = $True$scrp.Options.ToFileOnly = $True$scrp.Options.Indexes = $True$scrp.Options.WithDependencies = $True $scrp.Options.FileName = "D:\PSScripts\NWind.SQL"$scrp.Script($dbs["Northwind"].Tables) I changed the instance, database, and file paths[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null $s = new-object ('Microsoft.SqlServer.Management.Smo.Server') "LOCALHOST"  $dbs=$s.Databases #$dbs["AdventureWorks"].Script()  $dbs["AdventureWorks"].Script() | Out-File C:\temp\myscript.SQL   $scrp = new-object ('Microsoft.SqlServer.Manag

adding a SharePoint content source using powershell

Hi I'm trying to create a content source using powershell and (I'm not a programmer) I've got this far -   [System.Reflection.Assembly]::Load("Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.Sharepoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.Office.Server, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c") $site = new-object Microsoft.SharePoint.SPSite("http://breakfast/ssp/admin") $searchContext = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($site)  $content = new-object Microsoft.Office.Server.Search.Administration.Content($searchContext) $Content.ContentSources; --> and now I'm stuck! I think I can use the Create method with type and name parameters but I can't work out how to translate this into powershell This is the code I'm looking at: ContentSource contentSource_com = content.ContentSources.Create(typeof(WebContentSource), "www.someurl.com"); WebContentSource webContentSource_com = (WebContentSource)contentSource_com; webContentSource_com.StartAddresses.Add(new Uri("http://www.someurl.com/index.html)); webContentSource_com.Update(); and $contentsource = $content.ContentSources.

Managing the SO-Aware Repository with PowerShell

As Jesus mentioned in this post, SO-Aware provides three interfaces for managing the service repository. An OData API in case you want to integrate third applications with the repository. OData is a pure http API that can be easily consumed in any platform using a simple http client library. The management portal, which is an ASP.NET MVC user interface layered on top of the OData API and probably the one most people will use. And finally, a PowerShell provider that also mounts on top of the OData API to allow administrators to automate management tasks over the repository with scripting.  The SO-Aware PowerShell provider, in that sense offers around 40 commands that enables simple management scenarios like registering bindings or services or more complex scenarios that involves testing services or sending alerts when a service is not properly working.   This provider can be registered as an snapin in an existing script using the following command, $snapin = get-pssnapin | select-string "SOAwareSnapIn"if ($snapin -eq $null){ Add-PSSnapin "SOAwareSnapIn"} Once you have registered the snapin, you can start using most of the commands for managing the repository. The first and more important command is "Set-SWEndpoint", which allows you to connect to an existing SO-Aware instance. This command receives the OData service location as first argument, and it looks a

Powershell script to copy a list attachment to a file

I have a script that builds a list of items.  I'd like to add the ability to download the list items' attachments to a local directory.  IS this possible?  There are lots of examples of how to add attachments but nothing that can download the attachments.  Any help would be appreciated.

How to debug feature activation by PowerShell

Hello, I got a bunch of wsp files with double the number features from my visual studio 2010 solution. So now I'm using PowerShell to add and install the wsp files to my server and to activate the features for the target site. In Visual Studio 2010 rightlicking and hitting "deploy" works perfectly fine while the PowerShellscript fails with a NullReferenceException. Is there a way to locate the error? I've tried to debug the PowerShell process but when VS2010 opens up to debug the process I get an empty window without any code. I'm using a Windows Server 2008 R2, SharePoint 2010 RTM and Visual Studio 2010 RTM.

Where are the built-in powershell activities?

Hi, searching the web I found many blog posts  about early versions of Workflow 4.0 and I found references to some built-in powershell activities, but I couldn't find them in VS2010 Beta 2 nor RC. Where are them? Thank you

Cannot install Sharepoint 2010 from powershell

I have been given the task of installing Sharepoint 2010 onto a Windows Server 2008 fresh OS. I am attempting to do this using Powershell as we will likely have to rebuild this machine later so i want the rebuild to be as quick as possible. I have setup the SPModules in powershell and add the path to to the PSModule variable. When i run the following command: PS C:\Windows\system32> Install-SharePoint -SetupExePath "location of software\setup.exe" -ConfigXML "location of software\Files\SetupFarm\config.xml" -PIDKey "my key" i get the error: Property 'Value' cannot be found on this object; make sure it exists and is settable. At D:\SPModule\spmodule.setup\Install-SharePoint.ps1:373 char:52 +             $CurrentConfigXml.Configuration.PIDKEY. <<<< Value = $PIDKey     + CategoryInfo          : InvalidOperation: (Value:String) [], ParentContainsErrorRecordException     + FullyQualifiedErrorId : PropertyNotFound even though the key is an argument. I then added the key to a copy of the config file and ran following: PS C:\Windows\system32> Install-SharePoint -SetupExePath "location of software\setup.exe" -ConfigXML "location of software\Files\SetupFarm\configpidkey.xml"
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend