Changing Content Database using Powershell

Hi,
I have a web application created. I have a another content DB, which I want to associate to the existing web application.
I mean, the existing content db should be removed and the new Content db attached.
What are the steps to achieve the same using powershell?
Thanks

Hi,
For your issue, you can
Dismount-SPContentDatabase and Mount-SPContentDatabase.
A typical command to detach a database would be:
Dismount-SPContentDatabase -Identity <contentdb>
A typical command to attach a content database would be:
Mount-SPContentDatabase -Name <contentdb> -DatabaseServer <dbserver> -WebApplication <webappname>
Here is a link about
Managing SharePoint Content Databases with PowerShell, you can use as a reference:
http://www.mssqltips.com/sqlservertip/2608/managing-sharepoint-content-databases-with-powershell/
Best Regards,
Lisa Chen
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected]

Similar Messages

  • Deploying a Reusable Workflow to a List Content Type using PowerShell

    We have a situation where deployment of a reusable workflow for a site content type cannot be completed through the web interface due to the number of libraries where the content type is in use (time-out on deploy and update).
    It was hoped that this could be accomplished with PowerShell but the method of deploying to a list content type appears to be different than it is to a list (all content types).
    The below snippet works fine for a list / all content types:
    function AddWorkflowToLibraries ($SiteCollection, $ctName, $WfName, $WfAssociationName)
    $site = Get-SPSite $SiteCollection
    [Guid]$wfTemplateId = New-Object Guid
    #Step through each web in site collection
    $site | Get-SPWeb -limit all | ForEach-Object {
    $web = $_
    $_.Lists | ForEach-Object{
    if($_.AllowContentTypes -eq $true)
    if($_.ContentTypes.Item("$ctName") -ne $null)
    write-host "Enabling workflow on" $_.Title "in" $_.ParentWebUrl
    $ct = $_.ContentTypes[$ctName]
    $culture = New-Object System.Globalization.CultureInfo("en-US")
    $template = $site.RootWeb.WorkflowTemplates.GetTemplateByName($WfName, $culture)
    if($template -ne $null)
    $tasklist = "Tasks"
    $historylist = "Workflow History"
    if(!$web.Lists[$historylist])
    $web.Lists.Add($historylist, "A system library used to store workflow history information that is created in this site. It is created by the Publishing feature.",
    "WorkflowHistory", "00BFEA71-4EA5-48D4-A4AD-305CF7030140", 140, "100")
    if (!$web.Features["00BFEA71-4EA5-48D4-A4AD-305CF7030140"]) {
    Enable-SPFeature -Identity WorkflowHistoryList -Url $web.Url
    $wfHistory = $web.Lists[$historylist]
    $wfHistory.Hidden = $true
    $wfHistory.Update()
    if(!$web.Lists[$tasklist])
    $web.Lists.Add($tasklist, "This system library was created by the Publishing feature to store workflow tasks that are created in this site.", "WorkflowTasks", "00BFEA71-A83E-497E-9BA0-7A5C597D0107", 107, "100")
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.AddWorkflowAssociation($association)
    $_.Update()
    else
    Write-Error "Workflow Template not found"
    AddWorkflowToLibraries <Site Name> <Content Type Name> <Workflow Template Name> <Association Name>
    However changing the association as follows causes the script to still execute without a problem but the workflow doesn't appear for the content and the associations collection is empty:
    function AddWorkflowToLibraries ($SiteCollection, $ctName, $WfName, $WfAssociationName)
    $site = Get-SPSite $SiteCollection
    [Guid]$wfTemplateId = New-Object Guid
    #Step through each web in site collection
    $site | Get-SPWeb -limit all | ForEach-Object {
    $web = $_
    $_.Lists | ForEach-Object{
    if($_.AllowContentTypes -eq $true)
    if($_.ContentTypes.Item("$ctName") -ne $null)
    write-host "Enabling workflow on" $_.Title "in" $_.ParentWebUrl
    $ct = $_.ContentTypes[$ctName]
    $culture = New-Object System.Globalization.CultureInfo("en-US")
    $template = $site.RootWeb.WorkflowTemplates.GetTemplateByName($WfName, $culture)
    if($template -ne $null)
    $tasklist = "Tasks"
    $historylist = "Workflow History"
    if(!$web.Lists[$historylist])
    $web.Lists.Add($historylist, "A system library used to store workflow history information that is created in this site. It is created by the Publishing feature.",
    "WorkflowHistory", "00BFEA71-4EA5-48D4-A4AD-305CF7030140", 140, "100")
    if (!$web.Features["00BFEA71-4EA5-48D4-A4AD-305CF7030140"]) {
    Enable-SPFeature -Identity WorkflowHistoryList -Url $web.Url
    $wfHistory = $web.Lists[$historylist]
    $wfHistory.Hidden = $true
    $wfHistory.Update()
    if(!$web.Lists[$tasklist])
    $web.Lists.Add($tasklist, "This system library was created by the Publishing feature to store workflow tasks that are created in this site.", "WorkflowTasks", "00BFEA71-A83E-497E-9BA0-7A5C597D0107", 107, "100")
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.ContentTypes[$ctname].AddWorkflowAssociation($association)
    $_.ContentTypes[$ctname].Update()
    else
    Write-Error "Workflow Template not found"
    AddWorkflowToLibraries <Site Name> <Content Type Name> <Workflow Template Name> <Association Name>
    The only change is:
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.ContentTypes[$ctname].AddWorkflowAssociation($association)
    $_.ContentTypes[$ctname].Update()
    But unlike the list version, the association doesn't appear to be saved and no error is generated.
    Is anyone aware of what may cause this or have an example in C# that may explain something my script is missing?

    Hi Garry,
    After you associate the workflow to the content type, you should update the update the content type using
    $ct.UpdateWorkflowAssociationsOnChildren($true,$true,$true,$false)
     method.
    Here is the completed script:
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $site=Get-SPSite "http://serverName"
    $web=$site.OpenWeb()
    $list=$web.Lists["ListC"]
    $taskList=$web.Lists["Tasks"]
    $historyList=$web.Lists["Workflow History"]
    $ct=$list.ContentTypes["Link"]
    $culture=New-Object System.Globalization.CultureInfo("en-US")
    $wfTemplate=$web.WorkflowTemplates.GetTemplateByName("Three-State",$culture)
    $associationWF=[Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($wfTemplate, "myThreeStateWF",$taskList,$historyList)
    $ct.WorkflowAssociations.Add($associationWF)
    $ct.UpdateWorkflowAssociationsOnChildren($true,$true,$true,$false)
    Here is a demo about how to update it using C#
    http://www.thorntontechnical.com/tech/sharepoint/sharepoint-2010-associate-workflow-to-content-type-in-a-feature
    Wayne Fan
    TechNet Community Support

  • From SharePoint Content Database, Using SQL-Server Query how to fetch the 'Document GUID' based on 'Content Type'

    I want to get all the documents based on content type using SQL Server Query. I know that, querying the content database without using API is not advisable, but still i want to perform this action through SQL Server Query. Can someone assist ?

    You're right, it's not advisable, may result in corruption of your databases and might impact performance and stability. But assuming you're happy to do that then it is possible.
    Before you go down that route, have you considered using something more safe like PowerShell? I've seen a script exactly like the one you describe and it would take far less time to do it through PS than it would through SQL.

  • Strange behavior from script when dismounting content databases via PowerShell script

    So, this is my first time posting a question here.  I have taught myself PowerShell and for the most between friends, co-workers, or internet forums, I have been able to pick through most of the issues I have seen.  This one has me stuck. 
    So, a little background, I have a script that goes through each web app in a farm, finds the database that hosts the root site, and detaches all other content databases from the farm.  It also writes a csv file so that a process can come along after the
    fact to re-attach the databases.  I use this for patching so psconfig does not take quite as long as we have more than 50 content databases.  Here is the odd part.  After the first content database is detached, the second one is skipped, but
    the remainder are detached.  So, I have two databases left per web app.  One that holds the root site and whatever the second database is after the first detach.  If I comment out the line that actually does the detach, this does not happen. 
    Now, using ISE and adding break points, what I have found is that when I initially populate the array with the content databases ($var=$webapp.contentdatabase) all databases are in there.  When I start the foreach, all databases are in there.  Right
    up to the point that I detach the first database, all databases are still in the array variable.  As soon as I detach that database, the database that I detached gets removed from the array.  It does this even if I set the variable to read only. 
    It only happens with the first database detached in each web app.  I will try to explain this again with an example.  This test farm has 4 databases.  DB1, DB2, DB3, and DB4.  DB1 holds the root site.  The logic pulls the webapp info. 
    It gets the URL of the webapp.  It takes that info and finds the site collection with that name (the root site).  Finds the database name from there.  It then gets a list of all databases in the webapp and starts to loop through.  So the
    first one in the list is DB1.  It has the root site, so logic says do not delete.  It comes back to the loop with the next database DB2.  At this point, the array still has all 4 databases in the array.  DB2 does not host the root site,
    so the logic gathers information and calls dismount-spcontentdatabase.  As soon as that is called, that database is removed from the array.  So, at this point, we have processes postion 0 and position 1 in the array.  Since the original position
    1 has been removed, DB3 is now at postion 1.  So, the loop continues.  Sine we have now skipped DB3, we find DB4 and dismount.  Now, we have in the array DB1,DB3, and DB4.  My test environment has more and all are still there except for
    the first one removed.  I have banged my head against the desk with this one.  If someone has some insight, I would appreciate it.
    Here is the code that does it.
    get-spwebapplication | foreach-object {
     $webapp=$_
     $waname=$webapp.displayname
     $waurl=$webapp.url
     $cdbs=$webapp.contentdatabases
     $rsite=get-spsite $waurl -erroraction silentlycontinue
     $rsitedb=$rsite.contentdatabase
     $rsitedbn=$rsitedb.name
     foreach ($cdb in $cdbs) {
      $cdbs=$cdbs2
      $cdbname=$cdb.name
      #Write-Host "$cdbname" -foregroundcolor red
      if ($cdbname -ne $rsitedbn) {
       $warn=$cdb.warningsitecount
       $max=$cdb.maximumsitecount
       $current=$cdb.currentsitecount
       $dbserver=$cdb.server
       Write-output "$waname,$cdbname,$dbserver,$warn,$max,$current" >> $outfile
       Write-host "dismounting $cdbname" -foregroundcolor green
       dismount-spcontentdatabase -identity $cdbname -confirm:$false
      else {
       Write-host "$cdbname holds root site. No action." -foregroundcolor yellow

    what about keeping an array of all the non-root collections (may be database name) instead of dismounting them in the foreach loop of all the databases? After we have all the databases that need to be deleted, in a for loop starting with 0 and
    counting to the number of databases, check the name of the database for each index and dismount that database
    pseudo code would be
    $dbstobedismounted = @()
    foreach($cdb in $cdbs)
    $dbstobedismounted + = $cdb.Name  //instead of actually dismounting
    for(int i=0;i<$webapp.ContentDataBases.Count;i++)
    $dabasename = $webapp.ContentDataBases[i].Name
    foreach($dbtobedismounted in $dbstobedismounted)
    if($databasename -eq $dbtobedismounted )
    dismount-spcontentdatabase -dentty $webapp.ContentDataBases[i]
    I'm sure you might have to do some modifications to make it work, but the point I'm making is instead of dismounting in the foreach loop, have a list and dismount in another for loop. Hope it helps.
    rani

  • Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY

    Hi,
    I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = g_repid
          i_callback_pf_status_set = c_pf
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = ist_layout      "I_CALLBACK_TOP_OF_PAGE = C_TOP
          it_fieldcat              = ist_fieldcat
        TABLES
          t_outtab                 = ist_outtab.
    and kept one column editable by setting EDIT = 'X' and INPUT = 'X' for one column in ist_fieldcat.
    Now if user changes contents of a cell in this editable column and clicks on any toolbar button, then changed contetns are not received in USER_COMMAND routine.
    But if user changes the contents of a cell in this editable column and then double-clicks anywhere inside the ALV grid, then changed contents are received in USER_COMMAND routine.
    I dont want to loose the changed contents of ALV grid, can anybody help in this.
    Thanks in advance.
    Regards,
    Dhiraj

    In your USER_COMMAND form check the SY-UCOMM  for button which you have pressed may be you have used '&IC1'  (for double click)
    provide your Form USER_COMMAND code here.
    Kanagaraja L

  • Search content from seperate Content Database using Scope

    Hi there,
    I am asked to move all non-active old sites to a seperate Archive Content Database (ACDB). Management don't want to see any content from ACDB. If required to search content from ACDB, scope should be used anywhere in the webapplication to search only from
    ACDB.
    I am thinking to create a Archive Content DB and move all non-active site collection to it. Create a scope and make it available to all site collections.
    Is it so simple of I am missing some more steps.
    Please advise.
    Thanks
    Mickey

    Hi Mickey,
    Your direction is right.
    One point that you need to note is that you need to create the scope in SharePoint Central Administration, then configure the scope displaying in site collections.
    More information about how to configure scopes in SharePoint 2010, you can refer to:
    http://www.surfray.com/blog/2013/06/17/how-to-configure-scopes-in-sharepoint-2010/
    Best Regards,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to backup more than one database using powershell

    I am Trying to backup more than one database using the following script but no luck. I want user to type on command line the database they want to backup, e.g all databases that have "test" at the front like test.inventory, test.sales so i want
    user to type test.* and it backs up all databases related to test. Here is the script
        #$date = Get-Date -Format yyyyMMddHHmmss
        #$dbname = 'test.inventory'
        $dbToBackup = "test.inventory"
        cls
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | 
        Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") 
        | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-
        Null
        Add-Type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral,   
        PublicKeyToken=89845dcd8080cc91"
        $server = New-Object Microsoft.SqlServer.Management.Smo.Server($env:ComputerName) 
        $server.Properties["BackupDirectory"].Value = "C:\_DBbackups"
        $server.Alter()
        $backupDirectory = $server.Settings.BackupDirectory
        #display default backup directory
        "Default Backup Directory: " + $backupDirectory
        $db = $server.Databases[$dbToBackup]
        $dbName = $db.Name
        $timestamp = Get-Date -format yyyyMMddHHmmss
        $smoBackup = New-Object ("Microsoft.SqlServer.Management.Smo.Backup")
        #BackupActionType specifies the type of backup.
        #Options are Database, Files, Log
        #This belongs in Microsoft.SqlServer.SmoExtended assembly
        $smoBackup.Action = "Database"
        $smoBackup.BackupSetDescription = "Full Backup of " + $dbName
        $smoBackup.BackupSetName = $dbName + " Backup"
        $smoBackup.Database = $dbName
        $smoBackup.MediaDescription = "Disk"
        $smoBackup.Devices.AddDevice($backupDirectory + "\" + $dbName + "_" + $timestamp +   
        ".bak", "File")
        $smoBackup.SqlBackup($server)
        #let's confirm, let's list list all backup files
        $directory = Get-ChildItem $backupDirectory
        $backupFilesList = $directory | where {$_.extension -eq ".bak"}
        $backupFilesList | Format-Table Name, LastWriteTime

    Or i am using this script which backs up everything except tempdb but dont know how to modify this so that it backs up up all test related databases
    Is there a way that i use test.*
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null
    $s = new-object ("Microsoft.SqlServer.Management.Smo.Server") $instance
    $bkdir = "C:\_DBbackups" #We define the folder path as a variable 
    $dbs = $s.Databases
    foreach ($db in $dbs) 
         if($db.Name -ne "tempdb") #We don't want to backup the tempdb database 
         $dbname = $db.Name
         $dt = get-date -format yyyyMMddHHmm #We use this to create a file name based on the timestamp
         $dbBackup = new-object ("Microsoft.SqlServer.Management.Smo.Backup")
         $dbBackup.Action = "Database"
         $dbBackup.Database = $dbname
         $dbBackup.Devices.AddDevice($bkdir + "\" + $dbname + "_db_" + $dt + ".bak", "File")
         $dbBackup.SqlBackup($s)

  • Getting error while backing up SQL database using powershell

    I am trying to backup SQL database but strange thing is taking lpace, few databases i can backup with powershell but few i am getting error
        Exception calling "SqlBackup" with "1" argument(s): "Backup failed for Server 
        'Server1'. "
        At C:\_Scripts\defaultbackup.ps1:40 char:1
        + $smoBackup.SqlBackup($server)
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : FailedOperationException
        $dbToBackup = "test"
        #clear screen
        cls
        #load assemblies
        #note need to load SqlServer.SmoExtended to use SMO backup in SQL Server 2008
        #otherwise may get this error
        #Cannot find type [Microsoft.SqlServer.Management.Smo.Backup]: make sure
        #the assembly containing this type is loaded.
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | 
        Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") 
        | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-  
        Null
        #create a new server object
        $server = New-Object ("Microsoft.SqlServer.Management.Smo.Server") "(local)"
        $backupDirectory = $server.Settings.BackupDirectory
        "Default Backup Directory: " + $backupDirectory
        $db = $server.Databases[$dbToBackup]
         $dbName = $db.Name
         $timestamp = Get-Date -format yyyyMMddHHmmss
        $smoBackup = New-Object ("Microsoft.SqlServer.Management.Smo.Backup")
        #BackupActionType specifies the type of backup.
        #Options are Database, Files, Log
        #This belongs in Microsoft.SqlServer.SmoExtended assembly
        $smoBackup.Action = "Database"
        $smoBackup.BackupSetDescription = "Full Backup of " + $dbName
        $smoBackup.BackupSetName = $dbName + " Backup"
        $smoBackup.Database = $dbName
        $smoBackup.MediaDescription = "Disk"
        $smoBackup.Devices.AddDevice($backupDirectory + "\" + $dbName + "_" + $timestamp +   
        ".bak",   
        "File")
        $smoBackup.SqlBackup($server)
        #let's confirm, let's list list all backup files
        $directory = Get-ChildItem $backupDirectory
       $smoBackup.Devices.AddDevice($backupDirectory + "\" + $dbName + "_" + $timestamp + ".bak", "File")
    $smoBackup.SqlBackup($server)
    #let's confirm, let's list list all backup files
    $directory = Get-ChildItem $backupDirectory
    #list only files that end in .bak, assuming this is your convention for all backup files
        $backupFilesList = $directory | where {$_.extension -eq ".bak"}
        $backupFilesList | Format-Table Name, LastWriteTime
        $backupFilesList = $directory | where {$_.extension -eq ".bak"}
        $backupFilesList | Format-Table Name, LastWriteTime
    I read on internet that by using this in the script this problem can be sorted but i am
    not sure where exactly to put this line in above script set the ConnectionContext.StatementTimeout to 0
                  

    Hi Srk,
    I found the similar issue in this article, which had been sovled by adding the script below:
    $server = New-Object ("Microsoft.SqlServer.Management.Smo.Server") $dbInstance
    $server.ConnectionContext.StatementTimeout = 0
    Refer to:
    Exception calling "SqlBackup" with "1" argument(s)
    Please feel free to let me know if this method can not work.
    Best Regards,
    Anna Wang

  • Trying to un-hide content type using powershell

    I'm using this script below and am writing back the library name and if the content type is hidden after the update.
    Everything points to being correct yet when I go back to the library settings the eDocument Link is still hidden. What am I missing?
    add-pssnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
    $script:WebApps = Get-SPWebApplication "http://xxxx"
    $script:DocLibType = [Microsoft.SharePoint.SPBaseType]::DocumentLibrary
    foreach ($WebApp in $WebApps)
    foreach ($site in $WebApp.Sites)
    if ($site.AllWebs.Count -gt 0)
    foreach ($web in $site.AllWebs)
    foreach ($list in $web.GetListsOfType($DocLibType))
    foreach ($ct in $list.ContentTypes)
    if ($ct.Name.Equals("eDocument Link"))
    $ct.Hidden=$false;
    $ct.Update();
    $List.Update()
    Write-host "$site:: $web:: $List updated"
    Write-host $ct.Hidden
    $web.Dispose()
    $site.Dispose()
    SPSite Url=http://xxxx/team/is:: xxxx:: Active updated
    False
    SPSite Url=http://xxxx/team/is:: xxxx:: Documents updated
    False

    that's what you already checked in your loop 
    if ($ct.Name.Equals("Wibble"))
    the updated is because you already added the new content type at the start of the new item menu so this will make sure that you will add it to the end and ignore the first entry as if you add list contains duplicate content type you will get exception at
    the line 
    $list.RootFolder.UniqueContentTypeOrder=$ct_list
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

  • Change drive mapping using Powershell?

    Is there a way in Powershell to change a drive mapping from one location to another.  Example below:
    Drive M: is mapped to \\Server1\test_drive share
    That share has moved to another server with the same share name and now I want to have the following
    Drive M: now mapped to \\Server2\test_drive share
    As I will not know what drive letter each user is using mapping to what share,  I am basically trying to see if the user has a drive (any drive letter) mapped to Server1 and change that to Server2 (assuming the same share using same share name
    is on Server1 and Server2).
    I cannot wrap my head around this.
    Thanks,
    Dave
    Dave

    I found the following script however it does not seem to be working.  But, I think it will do what I am trying to do.
    $OldServer = "\\EXAMPLE-FS-001\"
     $NewServer = "\\companyname.local\shares\"
     $drives = Get-WmiObject win32_logicaldisk |
        ? {$_.ProviderName -like "$($OldServer)*" } |
                $Name = (($_.DeviceID) -replace ":", "")
                $NewRoot = (($_.ProviderName) -replace $OldServer, $NewServer)
                Get-PSDrive $Name | Remove-PSDrive -Force -whatif
                New-PSDrive $Name -PSProvider FileSystem -Root $NewRoot -WhatIf
    Dave
    Dave

  • Changing default database used by ODBC programmatically

    Hi,
    I have a report that I'm using ODBC to connect with and it can be run against one of two databases.  I am  unable to get it to point to any database other than the default set in the DSN.  I have tried setting the database in the ConnectionInfo object but still points to the default.
    Thanks,
    Steve

    HI,
    Sorry for not providing more information.  II'm using CR2008 and Visual Basic 2008.
    The code i'm  using is similar to what is in the sample code:
    Dim newreport As New frmReportViewer
            Dim DataVariables As DataVariablesType
            DataVariables = DataUtility.GetDataVariables
            Dim crtableLogoninfos As New TableLogOnInfos
            Dim crtableLogoninfo As New TableLogOnInfo
            Dim crConnectionInfo As New ConnectionInfo
            Dim CrTables As Tables
            Dim CrTable As Table
            With crConnectionInfo
                .ServerName = DataUtility.GetDataVariables.dsn
                .DatabaseName = DataUtility.GetDataVariables.Catalog
                .UserID = DataUtility.GetDataVariables.UserId
                .Password = DataUtility.GetDataVariables.Password
            End With
            CrTables = rptDoc.Database.Tables
            For Each CrTable In CrTables
                crtableLogoninfo = CrTable.LogOnInfo
                crtableLogoninfo.ConnectionInfo = crConnectionInfo
                CrTable.ApplyLogOnInfo(crtableLogoninfo)
            Next
            If rptDoc.Subreports.Count > 0 Then
                For count As Integer = 0 To rptDoc.Subreports.Count - 1
                    CrTables = rptDoc.Subreports(count).Database.Tables
                    For Each CrTable In CrTables
                        crtableLogoninfo = CrTable.LogOnInfo
                        crtableLogoninfo.ConnectionInfo = crConnectionInfo
                        CrTable.ApplyLogOnInfo(crtableLogoninfo)
                    Next
                Next
            End If
            newreport.rptViewer.ReportSource = rptDoc
            newreport.Show()
    I have steped through the code and the database name, userid, password , server name are being picked up properly.
    I am sending the name of the DSN for the Server Name and instead of the default database I am passing the name of a test database.  When the report is displayed, the data is being retrieved from the production databse instead o f test.

  • Read each record in an Access Database using PowerShell

    I have a fix database that I need to read each record and compare it to an issue. I'm having some issues just reading each record in the specific table, when i run the below code i just get the first entry over and over again. If somone could point me in
    the correct direction on how to read each record it would really help me out.
    $adOpenStatic = 3
    $adLockOptimistic = 3
    $objConnection = New-Object -com "ADODB.Connection"
    $objRecordSet = New-Object -com "ADODB.Recordset"
    $objConnection.Open("Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C:\temp\Fix.mdb")
    $objRecordset.Open("Select * From Fix_Information", $objConnection, $adOpenStatic, $adLockOptimistic)
    $i = 0
    do {
    $objRecordSet.Fields.Item("FixName").Value
    $objRecordSet.MoveNext | Out-Null
    $i++
    while ($i -le $objRecordSet.RecordCount)
    $objRecordSet.Close()
    $objConnection.Close()

    I haven't tested this, but it looks like you're just missing the parentheses after the MoveNext method name:
    $objRecordSet.MoveNext() | Out-Null

  • Request time out when creating content database

    Hello,
    my problem is, that i cannot create a SharePoint content database via the central administration.
    My Setup is the following:
    SharePoint Server 2013 Enterprise Farm
    1x Applikation Server/WFE (Windows Server 2012 SP 1)
    1x Database Server MSSQL Server 2012 (Windows Server 2012 SP 1)
    1x TFS 2013 (Windows Server 2012 SP 1)
    all of them are hosted in the same Hyper-V Environment. It is not the fasted Hyper-V Environment existing on planet earth.
    The weirdest part of the problem is, i am able to create a content database via powershell.
    I am running in some kind of time out issue related to the IIS and CA of that Applikation Server.
    Here is the ULS Log from the failling content database creation via CA
    12.18.2014 10:26:09.47 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Monitoring b4ly
    High Leaving Monitored Scope (PostAuthenticateRequestHandler). Execution Time=8,5997
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.66 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    General g3qj
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:09.50, Original Level: Verbose] url is in site
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.66 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Asp Runtime aj1kp
    High [Forced due to logging gap, Original Level: Verbose] SPRequestModule.PreSendRequestHeaders
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.73 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ahjqp
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:09.70, Original Level: Verbose] SQL connection time: 14.765 for Data Source=SQLSERVER\DATABASE;Initial Catalog=master;Integrated Security=True;Pooling=False
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.73 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Topology 8xqz
    High [Forced due to logging gap, Original Level: Medium] Updating SPPersistedObject {0}. Version: {1} Ensure: {2}, HashCode: {3}, Id: {4}, Stack: {5}
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.77 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Upgrade aj2jl
    High 12/18/2014 10:26:09.77 w3wp (0x2304) 0x1B40 SharePoint Foundation Upgrade ServerSequence aj2jl DEBUG Search ServerSequence returns TargetBuildVersion '15.0.4675.1000' 4deed69c-2f53-a086-14bb-cbf40b020025
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.77 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Upgrade aj2jk
    High 12/18/2014 10:26:09.77 w3wp (0x2304) 0x1B40 SharePoint Foundation Upgrade ServerSequence aj2jk DEBUG Setting Search ServerSequence version (guid '53d65723-a256-48d7-a477-1d3466089eef') to BuildVersion '15.0.4675.1000'
    4deed69c-2f53-a086-14bb-cbf40b020025 4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.77 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Upgrade aj2jl
    High 12/18/2014 10:26:09.77 w3wp (0x2304) 0x1B40 SharePoint Foundation Upgrade ServerSequence aj2jl DEBUG Search ServerSequence returns TargetBuildVersion '15.0.4675.1000' 4deed69c-2f53-a086-14bb-cbf40b020025
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.83 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database 8acb
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:09.81, Original Level: VerboseEx] Reverting to process identity
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:09.83 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ahjqp
    High [Forced due to logging gap, Original Level: Verbose] SQL connection time: 0.2565 for Data Source=SQLSERVER\DATABASE;Initial Catalog=SharePoint_2013_Prod_Config;Integrated Security=True;Enlist=False;Pooling=True;Min
    Pool Size=0;Max Pool Size=100;Connect Timeout=400
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.16 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ahjqp
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:09.86, Original Level: Verbose] SQL connection time: 0.1719 for Data Source=SQLSERVER\DATABASE;Initial Catalog=SharePoint_2013_Prod_Config;Integrated Security=True;Enlist=False;Pooling=True;Min
    Pool Size=0;Max Pool Size=100;Connect Timeout=400
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.16 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database 8acb
    High [Forced due to logging gap, Original Level: VerboseEx] Reverting to process identity
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.19 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Topology 84y4
    High Granting VIEW SERVER STATE permission for S-1-5-21-3747686279-3738247048-1854932723-1131.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.23 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Topology 84y5
    High VIEW SERVER STATE permission updated successfully.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.23 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Topology 84y4
    High Granting CONTROL SERVER permission for S-1-5-21-3747686279-3738247048-1854932723-1131.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.25 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Topology 84y5
    High CONTROL SERVER permission updated successfully.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.33 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database 8acb
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:12.30, Original Level: VerboseEx] Reverting to process identity
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.33 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ahjqp
    High [Forced due to logging gap, Original Level: Verbose] SQL connection time: 16.4685 for Data Source=SQLSERVER\DATABASE;Initial Catalog=master;Integrated Security=True;Enlist=False;Pooling=False;Min Pool Size=0;Max
    Pool Size=100;Connect Timeout=400 4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.39 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database 8acb
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:12.38, Original Level: VerboseEx] Reverting to process identity
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.39 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ahjqp
    High [Forced due to logging gap, Original Level: Verbose] SQL connection time: 11.6743 for Data Source=SQLSERVER\DATABASE;Initial Catalog=master;Integrated Security=True;Enlist=False;Pooling=False;Min Pool Size=0;Max
    Pool Size=100;Connect Timeout=400 4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:12.42 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database 7t6o
    High The WSS_Content_uitest database does not exist.  It will now be created.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:15.11 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ahjqp
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:12.44, Original Level: Verbose] SQL connection time: 9.9785 for Data Source=SQLSERVER\DATABASE;Initial Catalog=master;Integrated Security=True;Enlist=False;Pooling=False;Min
    Pool Size=0;Max Pool Size=100;Connect Timeout=400
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:15.11 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ab20s
    High [Forced due to logging gap, Original Level: Medium] Setting the {0} option to {1} on the database {2}.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:26:15.14 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Upgrade ajy0d
    High 12/18/2014 10:26:15.14 w3wp (0x2304) 0x1B40 SharePoint Foundation Upgrade SPUtility ajy0d DEBUG File C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template\sql\store.sql, Time out =
    0 sec 4deed69c-2f53-a086-14bb-cbf40b020025
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.46 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database ahjqp
    High [Forced due to logging gap, cached @ 12/18/2014 10:26:15.16, Original Level: Verbose] SQL connection time: 11.4389 for Data Source=SQLSERVER\DATABASE;Initial Catalog=WSS_Content_uitest;Integrated Security=True;Enlist=False;Pooling=False;Min
    Pool Size=0;Max Pool Size=100;Connect Timeout=400
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.46 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database fa45
    High System.Threading.ThreadAbortException: Thread was being aborted.     at SNIReadSyncOverAsync(SNI_ConnWrapper* , SNI_Packet** , Int32 )     at SNINativeMethodWrapper.SNIReadSyncOverAsync(SafeHandle
    pConn, IntPtr& packet, Int32 timeout)     at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()     at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()     at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
        at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
    TdsParserStateObject stateObj, Boolean& dataReady)     at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1
    completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteScript(TextReader textReader, Int32
    commandTimeout) 4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.47 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database fa46
    High at Microsoft.SharePoint.Utilities.SqlSession.ExecuteScript(String path, Int32 commandTimeout)     at Microsoft.SharePoint.Upgrade.SPUtility.ExecuteSqlFile(SqlSession sqlSession, ISqlSession isqlSession,
    SqlFile sqlFileId, Int32 timeOut)     at Microsoft.SharePoint.Administration.SPDatabase.Provision(SPDatabase database, SqlConnectionStringBuilder connectionString, SqlFile sqlFileId, Dictionary`2 options)     at Microsoft.SharePoint.Administration.SPContentDatabase.Provision()
        at Microsoft.SharePoint.Administration.SPContentDatabaseCollection.Add(SPContentDatabase database, Boolean provision, Guid webApplicationLockId, Int32 addFlags)     at Microsoft.SharePoint.Administration.SPContentDatabaseCollection.Add(Guid
    newDatabaseId, String strDatabaseServer, String strDatabaseName, String strDatabaseUsername, String strDatabasePassword, Int32 warningSiteCount, Int32 maximumSiteCount, Int32 status, Boolean provision, Guid lockId, Int32 addFlags)     at Microsoft.SharePoint.ApplicationPages.NewContentDBPage.BtnSubmit_Click(Object
    sender, EventArgs e)     at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest()     at System.Web.UI.Page.ProcessRequest(HttpContext context)     at
    System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception
    error)     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)     at
    System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer,
    IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr
    pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr
    rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.47 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database tzku
    High ConnectionString: 'Data Source=SQLSERVER\DATABASE;Initial Catalog=WSS_Content_uitest;Integrated Security=True;Enlist=False;Pooling=False;Min Pool Size=0;Max Pool Size=100;Connect Timeout=400'    Partition:
    NULL ConnectionState: Closed ConnectionTimeout: 400
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.50 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database tzkv
    High SqlCommand: '--FixO15:3174405 create role SPReadOnly This line should not be changed or removed, otherwise upgrade would fail.  IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'SPReadOnly'
    AND type = 'R')  CREATE ROLE [SPReadOnly]  DECLARE @objname sysname, @objtype NVARCHAR(max), @datatype NVARCHAR(max), @query NVARCHAR(max)  -- Grant SELECT on all SharePoint stored procedures and functions  DECLARE c CURSOR LOCAL FAST_FORWARD
    FOR      SELECT ROUTINE_NAME, ROUTINE_TYPE, DATA_TYPE      FROM INFORMATION_SCHEMA.ROUTINES      WHERE ROUTINE_SCHEMA = 'DBO'  OPEN c  WHILE 1 = 1  BEGIN      FETCH NEXT FROM c INTO
    @objname, @objtype, @datatype      IF @@FETCH_STATUS = -1          BREAK      IF @@FETCH_STATUS = 0      BEGIN          -- Inline table-valued functions    
         IF (@objtype = 'FUNCTION' AND @datatype = 'TABLE')              SET @query = 'GRANT SELECT ON [dbo].' + quotename(@objname) + ' TO [SPReadOnly]'          EXEC sp_executesql
    @query      END  END  CLOSE c  DEALLOCATE c  -- Grant SELECT on all SharePoint tables  DECLARE c CURSOR LOCAL FAST_FORWARD FOR      SELECT TABLE_NAME      FROM INFORMATION_SCHEMA.TABLES
         WHERE TABLE_SCHEMA = 'DBO'  OPEN c  WHILE 1 = 1  BEGIN      FETCH NEXT FROM c INTO @objname      IF @@FETCH_STATUS = -1          BREAK      IF @@FETCH_STATUS
    = 0      BEGIN          SET @query = 'GRANT SELECT ON [dbo].' + quotename(@objname) + ' TO [SPReadOnly]'          EXEC sp_executesql @query      END  END  CLOSE
    c  DEALLOCATE c  -- Grant EXECUTE on User-defined type where schema is dbo  DECLARE c CURSOR LOCAL FAST_FORWARD FOR      SELECT NAME      FROM SYS.TYPES      WHERE IS_USER_DEFINED = 1    
     AND SCHEMA_ID = schema_id(N'dbo')  OPEN c  WHILE 1 = 1  BEGIN      FETCH NEXT FROM c INTO @objname      IF @@FETCH_STATUS = -1          BREAK      IF @@FETCH_STATUS
    = 0      BEGIN          SET @query = 'GRANT EXECUTE ON TYPE::[dbo].' + quotename(@objname) + ' TO [SPReadOnly]'          EXEC sp_executesql @query      END  END  CLOSE
    c  DEALLOCATE c  '     CommandType: Text CommandTimeout: 0
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.50 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database aek90
    High SecurityOnOperationCheck = False
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.50 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Monitoring b4ly
    High Leaving Monitored Scope (Database.Provision (WSS_Content_uitest on SQLSErver\database)). Execution Time=115148.4664
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.50 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Topology 8dyx
    High Deleting the SPPersistedObject, SPContentDatabase Name=WSS_Content_uitest.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.56 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Topology bw4w
    High [Forced due to logging gap, cached @ 12/18/2014 10:28:07.53, Original Level: Medium] {0}
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.56 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Database 8acb
    High [Forced due to logging gap, Original Level: VerboseEx] Reverting to process identity
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.60 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Monitoring b4ly
    High Leaving Monitored Scope (Creating Content Database (WSS_Content_uitest on SQLServer\Database)). Execution Time=115311.5636
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.64 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Runtime tkau
    Unexpected System.Web.HttpException: Request timed out.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.64 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    General ajlz0
    High Getting Error Message for Exception System.Web.HttpException (0x80004005): Request timed out.
    4deed69c-2f53-a086-14bb-cbf40b020025
    12.18.2014 10:28:07.69 w3wp.exe (0x2304)
    0x1B40 SharePoint Foundation
    Micro Trace uls4
    High Micro Trace Tags: 0 b4ly,301 aj2jl,3 aj2jk,0 aj2jl,2423 84y4,35 84y5,4 84y4,11 84y5,181 7t6o,2714 ajy0d,112321 fa45,10 fa46,3 tzku,23 tzkv,0 aek90,0 b4ly,6 8dyx,91 b4ly,38 tkau,13 ajlz0
    4deed69c-2f53-a086-14bb-cbf40b020025
    The working content database creation from powershell looks like this
    12.18.2014 09:45:37.52 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade aj2jl
    High 12/18/2014 09:45:37.52 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade ServerSequence aj2jl DEBUG Search ServerSequence returns TargetBuildVersion '15.0.4675.1000' 43dae8a1-02e3-43f5-8a06-0417221e6385
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:37.52 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade aj2jk
    High 12/18/2014 09:45:37.52 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade ServerSequence aj2jk DEBUG Setting Search ServerSequence version (guid '53d65723-a256-48d7-a477-1d3466089eef') to BuildVersion '15.0.4675.1000'
    43dae8a1-02e3-43f5-8a06-0417221e6385 43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:37.52 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade aj2jl
    High 12/18/2014 09:45:37.52 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade ServerSequence aj2jl DEBUG Search ServerSequence returns TargetBuildVersion '15.0.4675.1000' 43dae8a1-02e3-43f5-8a06-0417221e6385
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:39.98 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Topology 84y4
    High Granting VIEW SERVER STATE permission for S-1-5-21-3747686279-3738247048-1854932723-1131.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:40.02 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Topology 84y5
    High VIEW SERVER STATE permission updated successfully.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:40.02 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Topology 84y4
    High Granting CONTROL SERVER permission for S-1-5-21-3747686279-3738247048-1854932723-1131.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:40.03 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Topology 84y5
    High CONTROL SERVER permission updated successfully.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:40.23 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Database 7t6o
    High The WSS_Content_powershelltest database does not exist.  It will now be created.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:45:43.03 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade ajy0d
    High 12/18/2014 09:45:43.03 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade SPUtility ajy0d DEBUG File C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template\sql\store.sql, Time
    out = 0 sec 43dae8a1-02e3-43f5-8a06-0417221e6385
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:52.70 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Database 944r
    High Adding S-1-5-21-3747686279-3738247048-1854932723-1131 to the role, db_owner, in the database, WSS_Content_powershelltest.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:52.81 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Monitoring b4ly
    High Leaving Monitored Scope (Database.Provision (WSS_Content_powershelltest on SQLSERVER\DATABASE)). Execution Time=192653,1989
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:57.90 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade al2ph
    High 12/18/2014 09:48:57.90 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade SPContentDatabaseSequence al2ph DEBUG Executing SQL DDL Script. 43dae8a1-02e3-43f5-8a06-0417221e6385
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:58.03 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade al2ph
    High 12/18/2014 09:48:58.03 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade SPContentDatabaseSequence al2ph DEBUG Executing SQL DDL Script. 43dae8a1-02e3-43f5-8a06-0417221e6385
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:58.04 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade al2ph
    High 12/18/2014 09:48:58.04 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade SPContentDatabaseSequence2 al2ph DEBUG Executing SQL DDL Script. 43dae8a1-02e3-43f5-8a06-0417221e6385
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:58.15 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Upgrade ajyw6
    High 12/18/2014 09:48:58.15 powershell (0x2058) 0x1E28 SharePoint Foundation Upgrade SPHierarchyManager ajyw6 DEBUG [SPTree Value=SPContentDatabase Name=WSS_Content_powershelltest] added to dependency cache by lookup
    43dae8a1-02e3-43f5-8a06-0417221e6385 43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:58.23 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Database 944r
    High Adding S-1-5-21-3747686279-3738247048-1854932723-1131 to the role, SPDataAccess, in the database, WSS_Content_powershelltest.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:58.59 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Database bx4r
    High All documents with forward links in content database [SPContentDatabase Name=WSS_Content_powershelltest] is being dirtied.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:58.97 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Database 944r
    High Adding S-1-5-21-3747686279-3738247048-1854932723-1131 to the role, SPDataAccess, in the database, WSS_Content_powershelltest.
    43dae8a1-02e3-43f5-8a06-0417221e6385
    12.18.2014 09:48:58.98 PowerShell.exe (0x2058)
    0x1E28 SharePoint Foundation
    Monitoring b4ly
    High Leaving Monitored Scope (Creating Content Database (WSS_Content_powershelltest on SQLSERVER\DATABASE)). Execution Time=198893,1578
    43dae8a1-02e3-43f5-8a06-0417221e6385
    The fact that i am able to create a content database through powershell sorts out permissions problems. I am certain of that because the w3wp.exe and the powershell.exe used for both creations were run under the same user.
    The timeout always happens aroud 120 seconds after i started the creation. The creation via powershell takes about 3,5 minutes.
    Here for the folks that ask me, why i haven't asked google or bing or some other search engine.
    I tried the solutions suggested here
    http://www.sharepointpals.com/post/Error-while-Creating-Web-Application-through-Central-Administration , here
    http://anthonyspiteri.net/sharepoint-2010-web-ui-timeout-creating-web-application-quick-fix/ and here
    http://blogs.ibs.com/Duane.Odum/Lists/Posts/Post.aspx?ID=33
    which i thought pointed me to the right solution.
    But those post unfortunatly didnt worked out.
    I also tried to alter the web.config files (i know that isn't recommended or supported, but it didn't change anything so those are back to normal as well)
    So here are my question:
    Can you guys help me solve this issue?
    Are there any other places where timeouts can be managed or defined?
    P.S.: I am new to using this forum. so pls don't crucify me for doing a mistake.
    P.S.S: My english is very poor also :D
    With best regards
    Simon

    Be careful with settings like these because there may be a much deeper issue at hand. I have had an issue with a customer that manifests itself as a timeout on a site collection. It was very hard to track since it didn't happen frequently. We engaged Microsoft
    Support to find out the root cause but all they could point at is a general network issue that pertains to authentication. After digging deeper, we found out that the network issue was caused by a saturated network connectivity to the domain controller that
    impacts a site collection when the database is making an authentication call. Keep this solution as more of a quick fix but be sure to conduct a deeper investigation of the real root cause
    Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
    Blog |
    Twitter | LinkedIn
    SQL Server High Availability and Disaster Recover Deep Dive Course

  • Project Server 2013 restore site from content database

    My Project server was moved from one domain to other so i had to recreate everything since distributed cache was nt happy. I recreated everything. Now i have contet database from porject server that i need to restore to brand new environment. How to do that? 
    Simply doing rmount content database is not working? How to reprovision it in Project server service application?
    Adit

    You mention that you mounted the content database.    Did you do this with PowerShell?  Have you tried adding the content databases, using the menus under Application management?
    If that fails, I would just rebuild by doing the following. There probably is an easier way to do this, but here is what I would do
    1) Delete the web application used for Project server
    2) Create a new web application and point to the content database. 
    3) Then you can provision project server
    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

  • Detached a mysite content database and then re-attached it, now my sites are all down

    I detached a mysite content database using the
    Dismount-SPcontentdatbase
    then
    MOunt-Spcontentdatabase
    and now none of the mysites will work.   Is there some other step I need to do to bring them back online?
    [email protected]

    OK, I made a big mistake.  
    When I mounted the content database I used the -server option and selected the wrong server. 
    So instead of re-mounting the database, I accidentally created a blank database. 
    So I dismounted that content database and then remounted the database on the correct server and all my mysites began to work correctly. 
    This is definitely a lesson learned on my part.   Hopefully this helps other out if they make the same mistake. 
    [email protected]

Maybe you are looking for