Latest developer linksBookmark and Share
 
HomeThis WeekTop MonthTop AlltimeSearchRegisterFAQ
  
 
Submit Your Link
Please login to submit your Link
 

Powershell NavigationCmdletProvider architecture

Posted: Dec/14/2010   By: nikhil   Points:15   Category: .NET  - ASP.Net    Views:147   Vote Up (0)   Vote Down (0)    
Hello everyone, I have a question regarding powershell provider architecture. I have a datastore that is both heirarchical and heterogeneous in nature. I.e. there is no single node or leaf type. I would like to navigate and manipulate this data store contextually while providing appropriate actions for each data type encountered. What is the proper way to approach this? Must I create multiple providers that work in concert with each other? Or is the proper approach to have a single provider that checks each type and alters the behavior of each cmdlet override as necessary. I hope I explained this properly. I also hope I placed this in the correct forum :) Thanks for your input.

View Complete Post


Comments:
Be the first to comment this post.
 
Post Comment
Please login to post your comment
More Related Resources

Opinion on Architecture approach

  

Ijust started a new job as Software Architect. I would really appreciate if somone can share their opinions regarding architecture of the following project that I can implement. I was planning to utilize MVP, DDD, TDD, IOC, Dependency Injection, Repository , StructureMap etc. I am not sure about how to achieve the portal aspect and value added services.

Technology:

  • Client Web Portal
  • ASP.Net /C#/SQL Server

Project Specification:

  • 5 types of customers
  • Template of service
  • Dynamic Content Driven portal
  • Modules can be activated/deactivated through management console
  • Branding and customization
  • Rapid deployment portals of future clients as well
  • Portals will allow for customization
  • Data reporting services
  • Value- Add services to the clients portal
  • Each Clients welcome page can be customized by client as well
  • Mobile Application services
  • Localization

I would really appreciate if someone can point out the following:

  • Best Architecture for this project
  • Patterns to use
  • How the data layer should be layed out?
  • How to achieve portal technology
  • Value add services
  • Any open source existing resources which can be utilized
  • Any books which will put me in the right direction

Architecture Question - When and Where to Build Cache for Site Search Index

  

I have an MVC3 web app that represents about a dozen different entities, but I have built a common search function so that the user can do a single search and get results from the various entities. It works fine, but as I suspected, the performance is slow because the search is occurring live and there's a lot to search. A cache would be fine even if it was a long one (daily even), but I don't know where and when to actually refresh the cache. If a person uses the search when it's been longer than the cache timeout then it will be really slow for them that one time and that's not acceptable. I'm thinking that I have to have a Windows service in place or something that builds the cache, but perhaps there's a better way that I don't know about. I can't do it entirely in the database because some of the entities don't exist in the database (one entity list is composed by searching through some files on the system for instance). Any help is appreciated.


3D architecture drawing

  

 Hi,

Is there any tools out there which I can use to produced diagrams like the following

 

http://www.wisedimensions.com/screenshots/intro1.jpg (I am referring to the 3D appearance).  I tried the tool shown in the diagram 3D Visioner, but this does not provide a clear image which I can use on any document.

 

Thanks

Arjuna.



PowerShell Command to move Log File

  

Can you please show me how to move all the LDF files in my SQL Server instance to a different disk ?

 

I have added a new disk to my server and want to dedicate it to ldf files. I want to write a powershell script to move all the ldfs to this disk.

 

I am able to add a new file using Powershell.... but how to remove the previous one..

 

cls
set-location SQLSERVER:/SQL/MyMachine/DEFAULT/DATABASES
$databases = dir
foreach($database in $databases)
{
  $fileGroups = $database.FileGroups
  foreach($fileGroup in $fileGroups) 
  {
    $newLogFile = New-Object ('Microsoft.SqlServer.Managerment.Smo.DataFile')($fileGroup, ("E:\" + $database.Name + "_Log.ldf"))
    $fileGroup.Files.Add($newLogFile)
  }
}


Example: Scripting Data with SMO and Powershell

  
Here's an example of how to script the INSERT statements for data in a table using SMO and Powershell:

# Script INSERTs for given table
param 
(
  [string] $server,
  [string] $database,
  [string] $schema,
  [string] $table,
  [string] $output_file
)

# Example call
# C:\SQL\Powershell\Examples\script_data.ps1 ".\sql2005" "tempdb" "dbo" "temp"
# or specify output file
# C:\SQL\Powershell\Examples\script_data.ps1 ".\sql2008" "tempdb" "dbo" "temp" "c:\temp\temp.sql"

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null

$srv = New-Object "Microsoft.SqlServer.Management.SMO.Server" $server
$db = New-Object ("Microsoft.SqlServer.Management.SMO.Database")
$tbl = New-Object ("Microsoft.SqlServer.Management.SMO.Table")
$scripter = New-Object ("Microsoft.SqlServer.Management.SMO.Scripter") ($server)

# Get the database and table objects
$db = $srv.Databases[$database]
$tbl = $db.tables | Where-object {$_.schema -eq $schema-and$_.name -eq $table} 

# Set scripter options to ensure only data is scripted
$scripter.Options.ScriptSchema = $false;
$scripter.Options.ScriptData = $true;

#Exclude GOs after every line
$scripter.Options.NoCommandTerminator = $true;

if ($output_file -gt "") 
{
  $scripter.Options.FileName = $output_file
  $scripter.Options.ToFileOnly = $true
}

# Output the script
foreach ($s in $scripter.EnumScript($tbl.Urn)) { write-host $s }


Steps to make it work:
1) Save the above code in a file eg C:\SQL\Powershell\script_data.ps1
2) Start Powershell from SQL Server Management Studio 2008, by right clicking any object in the Object Browser and 'Start Powershell'
3) Call the script from Powershell with parameters: server, database, schema, table, eg
    C:\SQL\Powershell\script_data.ps1 ".\sql2005" "tempdb" "dbo" "temp"

You can also call it with an output file
    C:\SQL\Powershell\script_data.ps1 ".\sql2005" "tempdb" "dbo" "temp", "c:\temp\temp.sql"

Thought I would share!  Feedback welcome.

Need replication architecture assistance (near-real time merge repl across 2 separate companies and networks)

  

I've read several different replication scenarios and technologies native to SQL Server (we are talking about SQL Server 2005) but have some questions.

I have a project to integrate/replicate two network-separated SQL Server 2005 databases.  Each database resides in a physically separate location at different companies.  They will not have a shared network environment and will not allow direct connection between the two databases.

We need to keep each database in sync as far as customer records.  Near real time is preferable.  There is not master.  One could add/delete/modify a customer record in one database and it needs to reflect in the other database. 

 

The closest we could get for connectivity architecture looks like this:

1.  Each database is on the separate internal networks for each company.

2.  Each organization HAS agreed to setup a DMZ on their sides specifically for this exchange.  Each respective DMZ will be able to communicate with their own internal SQL Server and have a fiber connect directly connecting each organization's dmz.

SO.... is there a good way to replicate from InternalSQL_1 - DMZ1 - DMZ2 - InternalSQL_2 near real time?

What would your recommendation be?  Pretty sure I'd setup both internal InternalSQL as Pub/Sub/Dist but I'm soliciting suggestions for transporting across the DMZ's in each direction.

 

Any help would be appreciated


reset all crawled content with stsadm or powershell

  

Hi to all,

Is there a way to rest all crawled content with stsadm or powershell?  Looking to write a script to to run this.

Running MOSS 2007.  Thanks!


How to create Exclusion Filter for Users in user profile using powershell?

  

How to create Exclusion Filter for Users in user profile using powershell?

Could anyone help me out in this...

Thanks in advance.

Thanks

Vijai Anand.R

 

 


Powershell - starting a service

  

I've installed SP 2010 (ver 14.0.5128.5000) on two servers - dev1 and dev2 using my sp2010-setup account (with admin rights on both boxes).

I'm trying to build a install/config script.

I execute the following commands:

$balancers = Get-SPServiceInstance | ? { $_.typename -eq 'Document Conversions Load Balancer Service' }
$balancers.count
2
$balancers[1].status
Disabled
$balancers[1].server.name
dev2
$balancers[1].start()
Exception calling "Start" with "0" argument(s): "Cannot start service DCLoadBalancer14 on computer '.'."
At line:1 char:20
+ $balancers[1].start <<<< ()
  + CategoryInfo     : NotSpecified: (:) [], MethodInvocationException
  + FullyQualifiedErrorId : DotNetMethodException

What am I missing? This is the document conversion load balancer.  I can start/stop if from CA.
GregM

Powershell - add a webpart to a page

  

So I'm trying to use powershell to add a webpart to a page. I copied and pasted the first example from this page:

 

http://www.sharepointdevwiki.com/display/public/How+to+create+Web+Part+instances+on+pages+using+PowerShell+and+SPLimitedWebPartManager?showComments=false

 

I get the following error, which I find unhelpful:

Exception calling "AddWebPart" with "3" argument(s): "This page has encountered a critical error. Contact your system a
dministrator if this problem persists."
At C:\scripts\caa-UpgradeMeetingWorkspace.ps1:85 char:28
+   $webpartmanager.AddWebPart <<<< ($webpart, $webpartzone, $index);
  + CategoryInfo     : NotSpecified: (:) [], MethodInvocationException
  + FullyQualifiedErrorId : DotNetMethodException

Can anyone shed some light on this?

 


 
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
 
 
 
 
 Forgot password
 Contact Us   Terms Of use   Share your knowledge