From 28385b7543d7f78f6f7137c88e8bfe4a4bf4044a Mon Sep 17 00:00:00 2001 From: MikeShepard Date: Sun, 31 Jul 2016 22:04:44 -0500 Subject: [PATCH 1/3] Moved Everything but modules to the Deprecated folder Renamed SQLServer module to SQLPSXServer Added "conditional aliases" to functions that collide with new SQLServer module shipped with SQL2016 July update. --- .../dbo.DatabasePermission.Table.sql | Bin .../Database}/dbo.DatabaseRole.Table.sql | Bin .../Database}/dbo.Login.Table.sql | Bin .../Database}/dbo.ObjectPermission.Table.sql | Bin .../Database}/dbo.ServerPermission.Table.sql | Bin .../Database}/dbo.ServerRole.Table.sql | Bin .../dbo.SqlLinkedServerLogin.Table.sql | Bin .../Database}/dbo.SqlServer.Table.sql | Bin .../Database}/dbo.SqlUser.Table.sql | Bin .../dbo.ufn_GetMember.UserDefinedFunction.sql | Bin ....ufn_GetObjectName.UserDefinedFunction.sql | Bin ....ufn_GetObjectType.UserDefinedFunction.sql | Bin ...ngedDatabasePermission.StoredProcedure.sql | Bin ...sp_ChangedDatabaseRole.StoredProcedure.sql | Bin .../dbo.usp_ChangedLogin.StoredProcedure.sql | Bin ...hangedObjectPermission.StoredProcedure.sql | Bin ...hangedServerPermission.StoredProcedure.sql | Bin ....usp_ChangedServerRole.StoredProcedure.sql | Bin ...dbo.usp_ChangedSqlUser.StoredProcedure.sql | Bin ...ngedSqlUserOwnedObject.StoredProcedure.sql | Bin ...usp_DatabasePermission.StoredProcedure.sql | Bin .../dbo.usp_DatabaseRole.StoredProcedure.sql | Bin ....usp_LinkedServerLogin.StoredProcedure.sql | Bin .../dbo.usp_Login.StoredProcedure.sql | Bin ...o.usp_ObjectPermission.StoredProcedure.sql | Bin ...o.usp_ServerPermission.StoredProcedure.sql | Bin .../dbo.usp_ServerRole.StoredProcedure.sql | Bin .../dbo.usp_SqlUser.StoredProcedure.sql | Bin ...usp_SqlUserOwnedObject.StoredProcedure.sql | Bin ...del_DatabasePermission.StoredProcedure.sql | Bin ...o.usp_del_DatabaseRole.StoredProcedure.sql | Bin ..._del_LinkedServerLogin.StoredProcedure.sql | Bin .../dbo.usp_del_Login.StoredProcedure.sql | Bin ...p_del_ObjectPermission.StoredProcedure.sql | Bin ...p_del_ServerPermission.StoredProcedure.sql | Bin ...dbo.usp_del_ServerRole.StoredProcedure.sql | Bin .../dbo.usp_del_SqlUser.StoredProcedure.sql | Bin .../dbo.vw_DatabasePermissionMember.View.sql | Bin .../dbo.vw_DatabaseRoleMember.View.sql | Bin .../Database}/dbo.vw_LoginMember.View.sql | Bin .../dbo.vw_ObjectPermissionMember.View.sql | Bin .../dbo.vw_ServerPermissionMember.View.sql | Bin .../dbo.vw_ServerRoleMember.View.sql | Bin ...bo.vw_SqlUserDistinctServerdbname.View.sql | Bin .../Database}/dbo.vw_SqlUserMember.View.sql | Bin .../dbo.vw_SqlUserOwnedObject.View.sql | Bin .../Documentation}/app.yaml | 24 +- .../Documentation}/index.yaml | 22 +- .../Documentation}/static/Add-SqlDataFile.htm | Bin .../Documentation}/static/Add-SqlDatabase.htm | Bin .../static/Add-SqlDatabaseRole.htm | Bin .../static/Add-SqlDatabaseRoleMember.htm | Bin .../static/Add-SqlFileGroup.htm | Bin .../Documentation}/static/Add-SqlLogFile.htm | Bin .../Documentation}/static/Add-SqlLogin.htm | Bin .../static/Add-SqlServerRoleMember.htm | Bin .../Documentation}/static/Add-SqlUser.htm | Bin .../static/Copy-ISItemFileToSQL.htm | Bin .../static/Copy-ISItemSQLToFile.htm | Bin .../static/Copy-ISItemSQLToSQL.htm | Bin .../Documentation}/static/Get-AgentAlert.htm | Bin .../static/Get-AgentAlertCategory.htm | Bin .../Documentation}/static/Get-AgentJob.htm | Bin .../static/Get-AgentJobHistory.htm | Bin .../static/Get-AgentJobSchedule.htm | Bin .../static/Get-AgentJobServer.htm | Bin .../static/Get-AgentJobStep.htm | Bin .../static/Get-AgentOperator.htm | Bin .../static/Get-AgentOperatorCategory.htm | Bin .../static/Get-AgentProxyAccount.htm | Bin .../static/Get-AgentSchedule.htm | Bin .../static/Get-AgentTargetServer.htm | Bin .../static/Get-AgentTargetServerGroup.htm | Bin .../Documentation}/static/Get-GroupUser.htm | Bin .../Documentation}/static/Get-ISData.htm | Bin .../Documentation}/static/Get-ISItem.htm | Bin .../Documentation}/static/Get-ISPackage.htm | Bin .../static/Get-ISRunningPackage.htm | Bin .../static/Get-ISSqlConfigurationItem.htm | Bin .../Documentation}/static/Get-ReplArticle.htm | Bin .../static/Get-ReplEnumLogReaderAgent.htm | Bin .../static/Get-ReplEnumPublications.htm | Bin .../static/Get-ReplEnumPublications2.htm | Bin .../static/Get-ReplEnumSnapshotAgent.htm | Bin .../static/Get-ReplEnumSubscriptions.htm | Bin .../static/Get-ReplEnumSubscriptions2.htm | Bin .../static/Get-ReplLightPublication.htm | Bin .../Documentation}/static/Get-ReplMonitor.htm | Bin .../static/Get-ReplPublication.htm | Bin .../static/Get-ReplPublicationMonitor.htm | Bin .../static/Get-ReplPublisherMonitor.htm | Bin .../Documentation}/static/Get-ReplScript.htm | Bin .../Documentation}/static/Get-ReplServer.htm | Bin .../static/Get-ReplSubscriberSubscription.htm | Bin .../static/Get-ReplSubscription.htm | Bin .../Get-ReplTransPendingCommandInfo.htm | Bin .../Documentation}/static/Get-ShowMbrs.htm | Bin .../Documentation}/static/Get-Sql.htm | Bin .../Documentation}/static/Get-SqlCheck.htm | Bin .../Documentation}/static/Get-SqlColumn.htm | Bin .../static/Get-SqlConnection.htm | Bin .../Documentation}/static/Get-SqlData.htm | Bin .../Documentation}/static/Get-SqlDataFile.htm | Bin .../Documentation}/static/Get-SqlDatabase.htm | Bin .../static/Get-SqlDatabasePermission.htm | Bin .../static/Get-SqlDatabaseRole.htm | Bin .../static/Get-SqlDefaultDir.htm | Bin .../Documentation}/static/Get-SqlEdition.htm | Bin .../Documentation}/static/Get-SqlErrorLog.htm | Bin .../static/Get-SqlForeignKey.htm | Bin .../Documentation}/static/Get-SqlIndex.htm | Bin .../static/Get-SqlIndexFragmentation.htm | Bin .../Get-SqlInformation_Schema.Columns.htm | Bin .../Get-SqlInformation_Schema.Routines.htm | Bin .../Get-SqlInformation_Schema.Tables.htm | Bin .../Get-SqlInformation_Schema.Views.htm | Bin .../static/Get-SqlLinkedServerLogin.htm | Bin .../Documentation}/static/Get-SqlLogFile.htm | Bin .../Documentation}/static/Get-SqlLogin.htm | Bin .../static/Get-SqlObjectPermission.htm | Bin .../Documentation}/static/Get-SqlPort.htm | Bin .../Documentation}/static/Get-SqlProcess.htm | Bin .../Documentation}/static/Get-SqlSchema.htm | Bin .../Documentation}/static/Get-SqlScripter.htm | Bin .../Documentation}/static/Get-SqlServer.htm | Bin .../static/Get-SqlServerPermission.htm | Bin .../static/Get-SqlServerRole.htm | Bin .../Documentation}/static/Get-SqlShowMbrs.htm | Bin .../static/Get-SqlStatistic.htm | Bin .../static/Get-SqlStoredProcedure.htm | Bin .../Documentation}/static/Get-SqlSynonym.htm | Bin .../static/Get-SqlSysDatabases.htm | Bin .../Documentation}/static/Get-SqlTable.htm | Bin .../static/Get-SqlTransaction.htm | Bin .../Documentation}/static/Get-SqlTrigger.htm | Bin .../Documentation}/static/Get-SqlUser.htm | Bin .../static/Get-SqlUserDefinedDataType.htm | Bin .../static/Get-SqlUserDefinedFunction.htm | Bin .../Documentation}/static/Get-SqlVersion.htm | Bin .../Documentation}/static/Get-SqlView.htm | Bin .../static/Invoke-SqlBackup.htm | Bin .../static/Invoke-SqlDatabaseCheck.htm | Bin .../static/Invoke-SqlIndexDefrag.htm | Bin .../static/Invoke-SqlIndexRebuild.htm | Bin .../static/Invoke-SqlRestore.htm | Bin .../static/New-ISApplication.htm | Bin .../Documentation}/static/New-ISItem.htm | Bin .../static/New-ReplMergePublication.htm | Bin .../static/New-ReplScriptOptions.htm | Bin .../static/New-ReplTransPublication.htm | Bin .../Documentation}/static/New-ShowMbrs.htm | Bin .../static/New-SqlScriptingOptions.htm | Bin .../Documentation}/static/Out-SqlScript.htm | Bin .../Documentation}/static/Remove-ISItem.htm | Bin .../static/Remove-SqlDatabase.htm | Bin .../static/Remove-SqlDatabaseRole.htm | Bin .../static/Remove-SqlDatabaseRoleMember.htm | Bin .../Documentation}/static/Remove-SqlLogin.htm | Bin .../static/Remove-SqlServerRoleMember.htm | Bin .../Documentation}/static/Remove-SqlUser.htm | Bin .../Documentation}/static/Rename-ISItem.htm | Bin .../static/Set-AgentJobHistoryFilter.htm | Bin .../static/Set-ISConnectionString.htm | Bin .../Documentation}/static/Set-ISPackage.htm | Bin .../Documentation}/static/Set-ShowMbrs.htm | Bin .../Documentation}/static/Set-SqlData.htm | Bin .../static/Set-SqlDatabasePermission.htm | Bin .../static/Set-SqlObjectPermission.htm | Bin .../static/Set-SqlServerPermission.htm | Bin .../Documentation}/static/Test-ISPath.htm | Bin .../Documentation}/static/Test-SqlScript.htm | Bin .../static/Update-SqlStatistic.htm | Bin .../Documentation}/static/default.htm | Bin .../Documentation}/static/index.htm | Bin .../ISECreamBasic/Add-IseMenu.ps1 | Bin .../ISECreamBasic/ISECreamBasic.psm1 | Bin .../ISECreamBasic/Remove-IseMenu.ps1 | Bin .../ISECreamBasic/license.txt | 60 +- .../ISECreamBasic/readme.txt | 4 +- .../Library}/LibraryAgent.ps1 | 750 +- .../Library}/LibraryRmo.ps1 | 996 +- .../Library}/LibrarySSIS.ps1 | 1248 +- .../Library}/LibraryShowMbrs.ps1 | 192 +- .../Library}/LibrarySmo.ps1 | 5882 +- .../OracleClient/OracleBulkcopy.ps1 | 244 +- .../OracleClient/OracleClient.psm1 | 56 +- .../OracleClient/get-commandresults.ps1 | Bin .../OracleClient/invoke-query.ps1 | Bin .../OracleClient/new-connection.ps1 | Bin .../OracleIse}/ConvertFrom-Xml.ps1 | 20 +- .../OracleIse}/ConvertTo-StringData.ps1 | 66 +- .../OracleIse/Expand-String.ps1 | 26 +- .../OracleIse/Get-ConnectionInfo.ps1 | Bin .../OracleIse/Library-UserStore.ps1 | 266 +- .../OracleIse/OracleIse.psm1 | Bin {Modules => Deprecated}/OracleIse/SQLPSX.PNG | Bin .../OracleIse/Set-Options.ps1 | Bin .../OracleIse/Switch-CommentOrText.ps1 | Bin .../Switch-SelectedCommentOrText.ps1 | Bin .../OracleIse/defaultopts.ps1 | 82 +- .../Reports}/PBM/FailedPolicyReport.rdl | 918 +- .../Reports}/PBM/PBM.rptproj | 104 +- {Reports => Deprecated/Reports}/PBM/PBM.sln | 52 +- .../Reports}/PBM/PBMDashBoard.rdl | 3208 +- .../Reports}/PBM/PolicyDataDS.rds | 16 +- .../Reports}/SQLPSX/SQLPSX.sln | 50 +- .../Reports/SQLPSX/SQLPSX}/SQLPSX.rds | 18 +- .../Reports}/SQLPSX/SQLPSX/SQLPSX.rptproj | 228 +- .../SQLPSXChangedDatabasePermission.rdl | 1948 +- .../SQLPSX}/SQLPSXChangedDatabaseRole.rdl | 1624 +- .../SQLPSX/SQLPSX/SQLPSXChangedLogin.rdl | 1462 +- .../SQLPSX/SQLPSXChangedObjectPermission.rdl | 2430 +- .../SQLPSX/SQLPSXChangedServerPermission.rdl | 1782 +- .../SQLPSX}/SQLPSXChangedServerRole.rdl | 1456 +- .../SQLPSX/SQLPSX/SQLPSXChangedSqlUser.rdl | 1620 +- .../SQLPSXChangedSqlUserOwnedObject.rdl | 1620 +- .../SQLPSX}/SQLPSXDatabasePermission.rdl | 1836 +- .../SQLPSX/SQLPSX/SQLPSXDatabaseRole.rdl | 1656 +- .../SQLPSX/SQLPSX/SQLPSXLinkedServerLogin.rdl | 1730 +- .../Reports}/SQLPSX/SQLPSX/SQLPSXLogin.rdl | 1426 +- .../SQLPSX/SQLPSX/SQLPSXLoginGrouped.rdl | 1294 +- .../SQLPSX/SQLPSX/SQLPSXObjectPermission.rdl | 2550 +- .../SQLPSX/SQLPSX/SQLPSXServerPermission.rdl | 1568 +- .../SQLPSX/SQLPSX}/SQLPSXServerRole.rdl | 1244 +- .../Reports}/SQLPSX/SQLPSX/SQLPSXSqlUser.rdl | 1654 +- .../SQLPSX/SQLPSX}/SQLPSXSqlUserGrouped.rdl | 1380 +- .../SQLPSX/SQLPSXSqlUserOwnedObject.rdl | 1816 +- .../SQLIse}/ConvertFrom-Xml.ps1 | 20 +- .../SQLIse}/ConvertTo-StringData.ps1 | 66 +- .../SQLIse/Expand-String.ps1 | 26 +- .../SQLIse/Get-ConnectionInfo.ps1 | Bin .../SQLIse/Get-DbObjectList.ps1 | 400 +- .../SQLIse/Get-TabObjectList.ps1 | 136 +- .../SQLIse/Get-TableAlias.ps1 | 82 +- .../SQLIse/Invoke-Coalesce.ps1 | 22 +- .../SQLIse/Library-StringCrypto.ps1 | 42 +- .../SQLIse/Library-UserStore.ps1 | 282 +- {Modules => Deprecated}/SQLIse/SQLIse.psm1 | Bin {Modules => Deprecated}/SQLIse/SQLPSX.PNG | Bin .../SQLIse/Set-Options.ps1 | Bin .../SQLIse/Show-ConnectionManager.ps1 | Bin .../SQLIse/Show-DbObjectList.ps1 | 184 +- .../SQLIse/Show-TableBrowser.ps1 | Bin .../SQLIse/Switch-CommentOrText.ps1 | Bin .../SQLIse/Switch-SelectedCommentOrText.ps1 | Bin .../SQLIse/TabExpansion.ps1 | Bin .../SQLIse/defaultopts.ps1 | 82 +- {Modules => Deprecated}/SQLPSX/SQLPSX.psm1 | 88 +- .../SQLPSXInstaller}/Agent.wxs | 38 +- .../SQLPSXInstaller}/Config.wxi | 52 +- .../SQLPSXInstaller}/ISECreamBasic.wxs | 64 +- .../SQLPSXInstaller}/License.rtf | Bin .../SQLPSXInstaller}/OracleClient.wxs | 62 +- .../SQLPSXInstaller}/OracleIse.wxs | 110 +- .../SQLPSXInstaller}/PBM.wxs | 180 +- .../SQLPSXInstaller}/PerfCounters.wxs | 32 +- .../SQLPSXInstaller}/Repl.wxs | 46 +- .../SQLPSXInstaller}/SQLIse.wxs | 184 +- .../SQLPSXInstaller}/SQLMaint.wxs | 38 +- .../SQLPSXInstaller}/SQLPSX.msi | Bin .../SQLPSXInstaller}/SQLPSX.wxs | 30 +- .../SQLPSXInstaller}/SQLParser.wxs | 66 +- .../SQLPSXInstaller}/SQLProfiler.wxs | 32 +- .../SQLPSXInstaller}/SQLServer.wxs | 270 +- .../SQLPSXInstaller}/SSIS.wxs | 46 +- .../SQLPSXInstaller}/ShowMbrs.wxs | 38 +- .../SQLPSXInstaller}/WPK.wxs | 652 +- .../SQLPSXInstaller}/adolib.wxs | 30 +- .../SQLPSXInstaller}/mySQLLib.wxs | 30 +- .../SQLPSXInstaller}/sqlpsxAll.wxs | 190 +- .../SQLPSXInstaller}/sqlpsxinstaller.ps1 | 70 +- .../SQLParser}/SQLParser.sln | 40 +- .../Microsoft.Data.Schema.ScriptDom.Sql.xml | 39008 ++-- .../Microsoft.Data.Schema.ScriptDom.xml | 194 +- .../SQLParser}/SQLParser/OutSqlScript.cs | 896 +- .../SQLParser}/SQLParser/PSSnapin.cs | 66 +- .../SQLParser/Properties/AssemblyInfo.cs | 70 +- .../SQLParser}/SQLParser/SQLParser.cs | 238 +- .../SQLParser}/SQLParser/SQLParser.csproj | 234 +- .../SQLParser/SQLParser.dll-help.xml | 1434 +- .../SQLParser}/SQLParser/SQLScripter.cs | 152 +- .../SQLParser}/SQLParser/TestSqlScript.cs | 184 +- {Scripts => Deprecated/Scripts}/formatsql.bat | 2 +- .../Test Scripts}/Test.Agent.Help.ps1 | Bin .../Test Scripts}/Test.Agent.ps1 | Bin .../Test Scripts}/Test.Repl.Help.ps1 | Bin .../Test Scripts}/Test.Repl.ps1 | Bin .../Test Scripts}/Test.SQLServer.ps1 | Bin .../Test Scripts}/Test.SSIS.TearDown.ps1 | 10 +- .../Test Scripts}/Test.SSIS.ps1 | Bin .../Test Scripts}/testadolib.ps1 | 162 +- .../WPK/Add-ChildControl.ps1 | Bin .../WPK/Add-CodeGenerationRule.ps1 | Bin .../WPK/Add-EventHandler.ps1 | Bin .../WPK/Add-GridColumn.ps1 | Bin {Modules => Deprecated}/WPK/Add-GridRow.ps1 | Bin {Modules => Deprecated}/WPK/Close-Control.ps1 | Bin .../WPK/ConvertFrom-TypeToScriptCmdlet.ps1 | Bin .../WPK/ConvertTo-DataTemplate.ps1 | Bin .../WPK/ConvertTo-GridLength.ps1 | Bin .../WPK/ConvertTo-ParameterMetaData.ps1 | Bin .../WPK/ConvertTo-Xaml.ps1 | Bin .../WPK/Copy-DependencyProperty.ps1 | Bin .../WPK/Enable-Multitouch.ps1 | Bin .../WPK/Examples/AddGridRowExample.ps1 | Bin .../WPK/Examples/AnimatedLinesFromCenter.ps1 | Bin .../WPK/Examples/CanvasFromDesign.ps1 | Bin .../WPK/Examples/CmdletExample.ps1 | Bin .../WPK/Examples/DataTemplate.ps1 | Bin .../WPK/Examples/DigitalClock.ps1 | Bin .../WPK/Examples/EllipseAnimation.ps1 | Bin .../WPK/Examples/FlowDocument.ps1 | Bin .../WPK/Examples/Gradient.ps1 | Bin .../WPK/Examples/ImportWinForms.ps1 | Bin .../WPK/Examples/ListBoxSamples.ps1 | Bin .../WPK/Examples/ListView.ps1 | Bin .../WPK/Examples/MixingArgumentFormats.ps1 | Bin .../WPK/Examples/MoveControlExamples.ps1 | Bin .../WPK/Examples/MutlitouchDraw.ps1 | Bin .../WPK/Examples/MutlitouchImage.ps1 | Bin .../WPK/Examples/PowerShellDataSources.ps1 | Bin .../WPK/Examples/RichTextBoxAndCommands.ps1 | Bin .../WPK/Examples/RunCommand.ps1 | Bin .../WPK/Examples/Show-Module.ps1 | Bin .../WPK/Examples/SimpleDialog.ps1 | Bin .../WPK/Examples/SkewAnimation.ps1 | Bin .../WPK/Examples/Stopwatch.ps1 | Bin .../WPK/Examples/canvasfromblend.ps1 | Bin .../WPK/Examples/flyin.ps1 | Bin .../WPK/Export-Application.ps1 | Bin .../GeneratedControls/PresentationCore.ps1 | 51350 ++--- .../PresentationFramework.ps1 | 167576 +++++++-------- .../WPK/GeneratedControls/WindowsBase.ps1 | 3464 +- .../WindowsFormsIntegration.ps1 | 2168 +- .../WPK/GeneratedControls/Winforms.ps1 | 35012 +-- .../WPK/Get-ChildControl.ps1 | Bin .../WPK/Get-CommandPlugin.ps1 | Bin .../WPK/Get-CommonParentControl.ps1 | Bin .../WPK/Get-DependencyProperty.ps1 | Bin .../WPK/Get-HashtableAsObject.ps1 | Bin .../WPK/Get-PowerShellDataSource.ps1 | Bin .../WPK/Get-ReferencedCommand.ps1 | Bin {Modules => Deprecated}/WPK/Get-Resource.ps1 | Bin .../WPK/Get-UIElementPosition.ps1 | Bin .../WPK/Hide-UIElement.ps1 | Bin .../WPK/Join-PowerShellCommandOutput.ps1 | Bin {Modules => Deprecated}/WPK/Move-Control.ps1 | Bin .../WPK/Register-PowerShellCommand.ps1 | Bin .../WPK/Remove-ChildControl.ps1 | Bin .../WPK/Rules/WPFCodeGenerationRules.ps1 | Bin .../WPK/Set-DependencyProperty.ps1 | Bin {Modules => Deprecated}/WPK/Set-Property.ps1 | Bin {Modules => Deprecated}/WPK/Set-Resource.ps1 | Bin .../WPK/Show-UIElement.ps1 | Bin {Modules => Deprecated}/WPK/Show-Window.ps1 | Bin .../WPK/Start-Animation.ps1 | Bin .../WPK/Start-PowerShellCommand.ps1 | Bin {Modules => Deprecated}/WPK/Start-WPFJob.ps1 | Bin .../WPK/Stop-PowerShellCommand.ps1 | Bin {Modules => Deprecated}/WPK/Test-Ancestor.ps1 | Bin .../WPK/Test-Descendent.ps1 | Bin .../WPK/Unregister-PowerShellCommand.ps1 | Bin {Modules => Deprecated}/WPK/Update-WPFJob.ps1 | Bin {Modules => Deprecated}/WPK/WPF.ps1xml | Bin {Modules => Deprecated}/WPK/WPK.psd1 | Bin {Modules => Deprecated}/WPK/WPK.psm1 | Bin {Modules => Deprecated}/WPK/license.txt | 254 +- {Modules => Deprecated}/WPK/readme.txt | 4 +- .../mySQLLib/mySQLLib.psm1 | 1196 +- .../Database/SQLPSX.AllObject.sql | Bin .../Database/SQLPSX.Job.sql | 256 +- .../Get-InvalidLogins.ps1 | 156 +- .../Get-SessionTimeStamp.ps1 | 38 +- .../SQLPSXServer/Report}/SQLPSX.rds | 18 +- .../SQLPSXChangedDatabasePermission.rdl | 1948 +- .../Report}/SQLPSXChangedDatabaseRole.rdl | 1624 +- .../Report/SQLPSXChangedLogin.rdl | 1462 +- .../Report/SQLPSXChangedObjectPermission.rdl | 2430 +- .../Report/SQLPSXChangedServerPermission.rdl | 1782 +- .../Report}/SQLPSXChangedServerRole.rdl | 1456 +- .../Report/SQLPSXChangedSqlUser.rdl | 1620 +- .../SQLPSXChangedSqlUserOwnedObject.rdl | 1620 +- .../Report}/SQLPSXDatabasePermission.rdl | 1836 +- .../Report/SQLPSXDatabaseRole.rdl | 1656 +- .../Report/SQLPSXLinkedServerLogin.rdl | 1730 +- .../Report/SQLPSXLogin.rdl | 1426 +- .../Report/SQLPSXLoginGrouped.rdl | 1294 +- .../Report/SQLPSXObjectPermission.rdl | 2550 +- .../Report/SQLPSXServerPermission.rdl | 1568 +- .../SQLPSXServer/Report}/SQLPSXServerRole.rdl | 1244 +- .../Report/SQLPSXSqlUser.rdl | 1654 +- .../Report}/SQLPSXSqlUserGrouped.rdl | 1380 +- .../Report/SQLPSXSqlUserOwnedObject.rdl | 1816 +- .../Run-SmoToCsvFile.ps1 | 190 +- .../SQLPSXServer.psd1} | Bin 5236 -> 5248 bytes .../SQLPSXServer.psm1} | 9198 +- .../Test-SqlConn.ps1 | 46 +- .../Write-SmoCsvToDb.ps1 | 200 +- .../Write-SmoToCsvFile.ps1 | 260 +- Reports/PBM/PBM.rptproj.user | Bin 1539 -> 0 bytes .../Microsoft.Data.Schema.ScriptDom.Sql.dll | Bin 1801128 -> 0 bytes .../Microsoft.Data.Schema.ScriptDom.dll | Bin 13736 -> 0 bytes 402 files changed, 198248 insertions(+), 198242 deletions(-) rename {Database => Deprecated/Database}/dbo.DatabasePermission.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.DatabaseRole.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.Login.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.ObjectPermission.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.ServerPermission.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.ServerRole.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.SqlLinkedServerLogin.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.SqlServer.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.SqlUser.Table.sql (100%) rename {Database => Deprecated/Database}/dbo.ufn_GetMember.UserDefinedFunction.sql (100%) rename {Database => Deprecated/Database}/dbo.ufn_GetObjectName.UserDefinedFunction.sql (100%) rename {Database => Deprecated/Database}/dbo.ufn_GetObjectType.UserDefinedFunction.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedDatabasePermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedDatabaseRole.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedLogin.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedObjectPermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedServerPermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedServerRole.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedSqlUser.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ChangedSqlUserOwnedObject.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_DatabasePermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_DatabaseRole.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_LinkedServerLogin.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_Login.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ObjectPermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ServerPermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_ServerRole.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_SqlUser.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_SqlUserOwnedObject.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_DatabasePermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_DatabaseRole.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_LinkedServerLogin.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_Login.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_ObjectPermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_ServerPermission.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_ServerRole.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.usp_del_SqlUser.StoredProcedure.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_DatabasePermissionMember.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_DatabaseRoleMember.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_LoginMember.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_ObjectPermissionMember.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_ServerPermissionMember.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_ServerRoleMember.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_SqlUserDistinctServerdbname.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_SqlUserMember.View.sql (100%) rename {Database => Deprecated/Database}/dbo.vw_SqlUserOwnedObject.View.sql (100%) rename {Documentation => Deprecated/Documentation}/app.yaml (93%) rename {Documentation => Deprecated/Documentation}/index.yaml (97%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlDataFile.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlDatabase.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlDatabaseRole.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlDatabaseRoleMember.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlFileGroup.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlLogFile.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlLogin.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlServerRoleMember.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Add-SqlUser.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Copy-ISItemFileToSQL.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Copy-ISItemSQLToFile.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Copy-ISItemSQLToSQL.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentAlert.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentAlertCategory.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentJob.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentJobHistory.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentJobSchedule.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentJobServer.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentJobStep.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentOperator.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentOperatorCategory.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentProxyAccount.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentSchedule.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentTargetServer.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-AgentTargetServerGroup.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-GroupUser.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ISData.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ISItem.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ISPackage.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ISRunningPackage.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ISSqlConfigurationItem.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplArticle.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplEnumLogReaderAgent.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplEnumPublications.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplEnumPublications2.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplEnumSnapshotAgent.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplEnumSubscriptions.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplEnumSubscriptions2.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplLightPublication.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplMonitor.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplPublication.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplPublicationMonitor.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplPublisherMonitor.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplScript.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplServer.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplSubscriberSubscription.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplSubscription.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ReplTransPendingCommandInfo.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-ShowMbrs.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-Sql.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlCheck.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlColumn.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlConnection.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlData.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlDataFile.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlDatabase.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlDatabasePermission.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlDatabaseRole.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlDefaultDir.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlEdition.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlErrorLog.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlForeignKey.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlIndex.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlIndexFragmentation.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlInformation_Schema.Columns.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlInformation_Schema.Routines.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlInformation_Schema.Tables.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlInformation_Schema.Views.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlLinkedServerLogin.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlLogFile.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlLogin.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlObjectPermission.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlPort.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlProcess.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlSchema.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlScripter.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlServer.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlServerPermission.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlServerRole.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlShowMbrs.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlStatistic.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlStoredProcedure.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlSynonym.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlSysDatabases.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlTable.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlTransaction.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlTrigger.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlUser.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlUserDefinedDataType.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlUserDefinedFunction.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlVersion.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Get-SqlView.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Invoke-SqlBackup.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Invoke-SqlDatabaseCheck.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Invoke-SqlIndexDefrag.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Invoke-SqlIndexRebuild.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Invoke-SqlRestore.htm (100%) rename {Documentation => Deprecated/Documentation}/static/New-ISApplication.htm (100%) rename {Documentation => Deprecated/Documentation}/static/New-ISItem.htm (100%) rename {Documentation => Deprecated/Documentation}/static/New-ReplMergePublication.htm (100%) rename {Documentation => Deprecated/Documentation}/static/New-ReplScriptOptions.htm (100%) rename {Documentation => Deprecated/Documentation}/static/New-ReplTransPublication.htm (100%) rename {Documentation => Deprecated/Documentation}/static/New-ShowMbrs.htm (100%) rename {Documentation => Deprecated/Documentation}/static/New-SqlScriptingOptions.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Out-SqlScript.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Remove-ISItem.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Remove-SqlDatabase.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Remove-SqlDatabaseRole.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Remove-SqlDatabaseRoleMember.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Remove-SqlLogin.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Remove-SqlServerRoleMember.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Remove-SqlUser.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Rename-ISItem.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-AgentJobHistoryFilter.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-ISConnectionString.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-ISPackage.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-ShowMbrs.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-SqlData.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-SqlDatabasePermission.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-SqlObjectPermission.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Set-SqlServerPermission.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Test-ISPath.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Test-SqlScript.htm (100%) rename {Documentation => Deprecated/Documentation}/static/Update-SqlStatistic.htm (100%) rename {Documentation => Deprecated/Documentation}/static/default.htm (100%) rename {Documentation => Deprecated/Documentation}/static/index.htm (100%) rename {Modules => Deprecated}/ISECreamBasic/Add-IseMenu.ps1 (100%) rename {Modules => Deprecated}/ISECreamBasic/ISECreamBasic.psm1 (100%) rename {Modules => Deprecated}/ISECreamBasic/Remove-IseMenu.ps1 (100%) rename {Modules => Deprecated}/ISECreamBasic/license.txt (98%) rename {Modules => Deprecated}/ISECreamBasic/readme.txt (98%) rename {Library => Deprecated/Library}/LibraryAgent.ps1 (96%) rename {Library => Deprecated/Library}/LibraryRmo.ps1 (96%) rename {Library => Deprecated/Library}/LibrarySSIS.ps1 (97%) rename {Library => Deprecated/Library}/LibraryShowMbrs.ps1 (96%) rename {Library => Deprecated/Library}/LibrarySmo.ps1 (97%) rename {Modules => Deprecated}/OracleClient/OracleBulkcopy.ps1 (97%) rename {Modules => Deprecated}/OracleClient/OracleClient.psm1 (97%) rename {Modules => Deprecated}/OracleClient/get-commandresults.ps1 (100%) rename {Modules => Deprecated}/OracleClient/invoke-query.ps1 (100%) rename {Modules => Deprecated}/OracleClient/new-connection.ps1 (100%) rename {Modules/SQLIse => Deprecated/OracleIse}/ConvertFrom-Xml.ps1 (96%) rename {Modules/SQLIse => Deprecated/OracleIse}/ConvertTo-StringData.ps1 (95%) rename {Modules => Deprecated}/OracleIse/Expand-String.ps1 (97%) rename {Modules => Deprecated}/OracleIse/Get-ConnectionInfo.ps1 (100%) rename {Modules => Deprecated}/OracleIse/Library-UserStore.ps1 (96%) rename {Modules => Deprecated}/OracleIse/OracleIse.psm1 (100%) rename {Modules => Deprecated}/OracleIse/SQLPSX.PNG (100%) rename {Modules => Deprecated}/OracleIse/Set-Options.ps1 (100%) rename {Modules => Deprecated}/OracleIse/Switch-CommentOrText.ps1 (100%) rename {Modules => Deprecated}/OracleIse/Switch-SelectedCommentOrText.ps1 (100%) rename {Modules => Deprecated}/OracleIse/defaultopts.ps1 (97%) rename {Reports => Deprecated/Reports}/PBM/FailedPolicyReport.rdl (97%) rename {Reports => Deprecated/Reports}/PBM/PBM.rptproj (98%) rename {Reports => Deprecated/Reports}/PBM/PBM.sln (98%) rename {Reports => Deprecated/Reports}/PBM/PBMDashBoard.rdl (97%) rename {Reports => Deprecated/Reports}/PBM/PolicyDataDS.rds (98%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX.sln (98%) rename {Modules/SQLServer/Report => Deprecated/Reports/SQLPSX/SQLPSX}/SQLPSX.rds (98%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSX.rptproj (97%) rename {Modules/SQLServer/Report => Deprecated/Reports/SQLPSX/SQLPSX}/SQLPSXChangedDatabasePermission.rdl (97%) rename {Modules/SQLServer/Report => Deprecated/Reports/SQLPSX/SQLPSX}/SQLPSXChangedDatabaseRole.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXChangedLogin.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXChangedObjectPermission.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXChangedServerPermission.rdl (97%) rename {Modules/SQLServer/Report => Deprecated/Reports/SQLPSX/SQLPSX}/SQLPSXChangedServerRole.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXChangedSqlUser.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXChangedSqlUserOwnedObject.rdl (97%) rename {Modules/SQLServer/Report => Deprecated/Reports/SQLPSX/SQLPSX}/SQLPSXDatabasePermission.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXDatabaseRole.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXLinkedServerLogin.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXLogin.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXLoginGrouped.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXObjectPermission.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXServerPermission.rdl (97%) rename {Modules/SQLServer/Report => Deprecated/Reports/SQLPSX/SQLPSX}/SQLPSXServerRole.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXSqlUser.rdl (97%) rename {Modules/SQLServer/Report => Deprecated/Reports/SQLPSX/SQLPSX}/SQLPSXSqlUserGrouped.rdl (97%) rename {Reports => Deprecated/Reports}/SQLPSX/SQLPSX/SQLPSXSqlUserOwnedObject.rdl (97%) rename {Modules/OracleIse => Deprecated/SQLIse}/ConvertFrom-Xml.ps1 (96%) rename {Modules/OracleIse => Deprecated/SQLIse}/ConvertTo-StringData.ps1 (95%) rename {Modules => Deprecated}/SQLIse/Expand-String.ps1 (97%) rename {Modules => Deprecated}/SQLIse/Get-ConnectionInfo.ps1 (100%) rename {Modules => Deprecated}/SQLIse/Get-DbObjectList.ps1 (97%) rename {Modules => Deprecated}/SQLIse/Get-TabObjectList.ps1 (96%) rename {Modules => Deprecated}/SQLIse/Get-TableAlias.ps1 (96%) rename {Modules => Deprecated}/SQLIse/Invoke-Coalesce.ps1 (94%) rename {Modules => Deprecated}/SQLIse/Library-StringCrypto.ps1 (96%) rename {Modules => Deprecated}/SQLIse/Library-UserStore.ps1 (96%) rename {Modules => Deprecated}/SQLIse/SQLIse.psm1 (100%) rename {Modules => Deprecated}/SQLIse/SQLPSX.PNG (100%) rename {Modules => Deprecated}/SQLIse/Set-Options.ps1 (100%) rename {Modules => Deprecated}/SQLIse/Show-ConnectionManager.ps1 (100%) rename {Modules => Deprecated}/SQLIse/Show-DbObjectList.ps1 (97%) rename {Modules => Deprecated}/SQLIse/Show-TableBrowser.ps1 (100%) rename {Modules => Deprecated}/SQLIse/Switch-CommentOrText.ps1 (100%) rename {Modules => Deprecated}/SQLIse/Switch-SelectedCommentOrText.ps1 (100%) rename {Modules => Deprecated}/SQLIse/TabExpansion.ps1 (100%) rename {Modules => Deprecated}/SQLIse/defaultopts.ps1 (97%) rename {Modules => Deprecated}/SQLPSX/SQLPSX.psm1 (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/Agent.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/Config.wxi (96%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/ISECreamBasic.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/License.rtf (100%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/OracleClient.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/OracleIse.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/PBM.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/PerfCounters.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/Repl.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SQLIse.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SQLMaint.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SQLPSX.msi (100%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SQLPSX.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SQLParser.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SQLProfiler.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SQLServer.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/SSIS.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/ShowMbrs.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/WPK.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/adolib.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/mySQLLib.wxs (97%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/sqlpsxAll.wxs (98%) rename {SQLPSXInstaller => Deprecated/SQLPSXInstaller}/sqlpsxinstaller.ps1 (99%) rename {SQLParser => Deprecated/SQLParser}/SQLParser.sln (97%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/Microsoft.Data.Schema.ScriptDom.Sql.xml (97%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/Microsoft.Data.Schema.ScriptDom.xml (97%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/OutSqlScript.cs (96%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/PSSnapin.cs (96%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/Properties/AssemblyInfo.cs (97%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/SQLParser.cs (96%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/SQLParser.csproj (97%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/SQLParser.dll-help.xml (97%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/SQLScripter.cs (97%) rename {SQLParser => Deprecated/SQLParser}/SQLParser/TestSqlScript.cs (96%) rename {Scripts => Deprecated/Scripts}/formatsql.bat (99%) rename {Test Scripts => Deprecated/Test Scripts}/Test.Agent.Help.ps1 (100%) rename {Test Scripts => Deprecated/Test Scripts}/Test.Agent.ps1 (100%) rename {Test Scripts => Deprecated/Test Scripts}/Test.Repl.Help.ps1 (100%) rename {Test Scripts => Deprecated/Test Scripts}/Test.Repl.ps1 (100%) rename {Test Scripts => Deprecated/Test Scripts}/Test.SQLServer.ps1 (100%) rename {Test Scripts => Deprecated/Test Scripts}/Test.SSIS.TearDown.ps1 (98%) rename {Test Scripts => Deprecated/Test Scripts}/Test.SSIS.ps1 (100%) rename {Test Scripts => Deprecated/Test Scripts}/testadolib.ps1 (98%) rename {Modules => Deprecated}/WPK/Add-ChildControl.ps1 (100%) rename {Modules => Deprecated}/WPK/Add-CodeGenerationRule.ps1 (100%) rename {Modules => Deprecated}/WPK/Add-EventHandler.ps1 (100%) rename {Modules => Deprecated}/WPK/Add-GridColumn.ps1 (100%) rename {Modules => Deprecated}/WPK/Add-GridRow.ps1 (100%) rename {Modules => Deprecated}/WPK/Close-Control.ps1 (100%) rename {Modules => Deprecated}/WPK/ConvertFrom-TypeToScriptCmdlet.ps1 (100%) rename {Modules => Deprecated}/WPK/ConvertTo-DataTemplate.ps1 (100%) rename {Modules => Deprecated}/WPK/ConvertTo-GridLength.ps1 (100%) rename {Modules => Deprecated}/WPK/ConvertTo-ParameterMetaData.ps1 (100%) rename {Modules => Deprecated}/WPK/ConvertTo-Xaml.ps1 (100%) rename {Modules => Deprecated}/WPK/Copy-DependencyProperty.ps1 (100%) rename {Modules => Deprecated}/WPK/Enable-Multitouch.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/AddGridRowExample.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/AnimatedLinesFromCenter.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/CanvasFromDesign.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/CmdletExample.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/DataTemplate.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/DigitalClock.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/EllipseAnimation.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/FlowDocument.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/Gradient.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/ImportWinForms.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/ListBoxSamples.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/ListView.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/MixingArgumentFormats.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/MoveControlExamples.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/MutlitouchDraw.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/MutlitouchImage.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/PowerShellDataSources.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/RichTextBoxAndCommands.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/RunCommand.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/Show-Module.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/SimpleDialog.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/SkewAnimation.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/Stopwatch.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/canvasfromblend.ps1 (100%) rename {Modules => Deprecated}/WPK/Examples/flyin.ps1 (100%) rename {Modules => Deprecated}/WPK/Export-Application.ps1 (100%) rename {Modules => Deprecated}/WPK/GeneratedControls/PresentationCore.ps1 (96%) rename {Modules => Deprecated}/WPK/GeneratedControls/PresentationFramework.ps1 (96%) rename {Modules => Deprecated}/WPK/GeneratedControls/WindowsBase.ps1 (95%) rename {Modules => Deprecated}/WPK/GeneratedControls/WindowsFormsIntegration.ps1 (95%) rename {Modules => Deprecated}/WPK/GeneratedControls/Winforms.ps1 (95%) rename {Modules => Deprecated}/WPK/Get-ChildControl.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-CommandPlugin.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-CommonParentControl.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-DependencyProperty.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-HashtableAsObject.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-PowerShellDataSource.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-ReferencedCommand.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-Resource.ps1 (100%) rename {Modules => Deprecated}/WPK/Get-UIElementPosition.ps1 (100%) rename {Modules => Deprecated}/WPK/Hide-UIElement.ps1 (100%) rename {Modules => Deprecated}/WPK/Join-PowerShellCommandOutput.ps1 (100%) rename {Modules => Deprecated}/WPK/Move-Control.ps1 (100%) rename {Modules => Deprecated}/WPK/Register-PowerShellCommand.ps1 (100%) rename {Modules => Deprecated}/WPK/Remove-ChildControl.ps1 (100%) rename {Modules => Deprecated}/WPK/Rules/WPFCodeGenerationRules.ps1 (100%) rename {Modules => Deprecated}/WPK/Set-DependencyProperty.ps1 (100%) rename {Modules => Deprecated}/WPK/Set-Property.ps1 (100%) rename {Modules => Deprecated}/WPK/Set-Resource.ps1 (100%) rename {Modules => Deprecated}/WPK/Show-UIElement.ps1 (100%) rename {Modules => Deprecated}/WPK/Show-Window.ps1 (100%) rename {Modules => Deprecated}/WPK/Start-Animation.ps1 (100%) rename {Modules => Deprecated}/WPK/Start-PowerShellCommand.ps1 (100%) rename {Modules => Deprecated}/WPK/Start-WPFJob.ps1 (100%) rename {Modules => Deprecated}/WPK/Stop-PowerShellCommand.ps1 (100%) rename {Modules => Deprecated}/WPK/Test-Ancestor.ps1 (100%) rename {Modules => Deprecated}/WPK/Test-Descendent.ps1 (100%) rename {Modules => Deprecated}/WPK/Unregister-PowerShellCommand.ps1 (100%) rename {Modules => Deprecated}/WPK/Update-WPFJob.ps1 (100%) rename {Modules => Deprecated}/WPK/WPF.ps1xml (100%) rename {Modules => Deprecated}/WPK/WPK.psd1 (100%) rename {Modules => Deprecated}/WPK/WPK.psm1 (100%) rename {Modules => Deprecated}/WPK/license.txt (99%) rename {Modules => Deprecated}/WPK/readme.txt (98%) rename {Modules => Deprecated}/mySQLLib/mySQLLib.psm1 (97%) rename Modules/{SQLServer => SQLPSXServer}/Database/SQLPSX.AllObject.sql (100%) rename Modules/{SQLServer => SQLPSXServer}/Database/SQLPSX.Job.sql (97%) rename Modules/{SQLServer => SQLPSXServer}/Get-InvalidLogins.ps1 (97%) rename Modules/{SQLServer => SQLPSXServer}/Get-SessionTimeStamp.ps1 (96%) rename {Reports/SQLPSX/SQLPSX => Modules/SQLPSXServer/Report}/SQLPSX.rds (98%) rename {Reports/SQLPSX/SQLPSX => Modules/SQLPSXServer/Report}/SQLPSXChangedDatabasePermission.rdl (97%) rename {Reports/SQLPSX/SQLPSX => Modules/SQLPSXServer/Report}/SQLPSXChangedDatabaseRole.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXChangedLogin.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXChangedObjectPermission.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXChangedServerPermission.rdl (97%) rename {Reports/SQLPSX/SQLPSX => Modules/SQLPSXServer/Report}/SQLPSXChangedServerRole.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXChangedSqlUser.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXChangedSqlUserOwnedObject.rdl (97%) rename {Reports/SQLPSX/SQLPSX => Modules/SQLPSXServer/Report}/SQLPSXDatabasePermission.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXDatabaseRole.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXLinkedServerLogin.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXLogin.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXLoginGrouped.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXObjectPermission.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXServerPermission.rdl (97%) rename {Reports/SQLPSX/SQLPSX => Modules/SQLPSXServer/Report}/SQLPSXServerRole.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXSqlUser.rdl (97%) rename {Reports/SQLPSX/SQLPSX => Modules/SQLPSXServer/Report}/SQLPSXSqlUserGrouped.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Report/SQLPSXSqlUserOwnedObject.rdl (97%) rename Modules/{SQLServer => SQLPSXServer}/Run-SmoToCsvFile.ps1 (96%) rename Modules/{SQLServer/SQLServer.psd1 => SQLPSXServer/SQLPSXServer.psd1} (94%) rename Modules/{SQLServer/SQLServer.psm1 => SQLPSXServer/SQLPSXServer.psm1} (96%) rename Modules/{SQLServer => SQLPSXServer}/Test-SqlConn.ps1 (97%) rename Modules/{SQLServer => SQLPSXServer}/Write-SmoCsvToDb.ps1 (97%) rename Modules/{SQLServer => SQLPSXServer}/Write-SmoToCsvFile.ps1 (97%) delete mode 100644 Reports/PBM/PBM.rptproj.user delete mode 100644 SQLParser/SQLParser/Microsoft.Data.Schema.ScriptDom.Sql.dll delete mode 100644 SQLParser/SQLParser/Microsoft.Data.Schema.ScriptDom.dll diff --git a/Database/dbo.DatabasePermission.Table.sql b/Deprecated/Database/dbo.DatabasePermission.Table.sql similarity index 100% rename from Database/dbo.DatabasePermission.Table.sql rename to Deprecated/Database/dbo.DatabasePermission.Table.sql diff --git a/Database/dbo.DatabaseRole.Table.sql b/Deprecated/Database/dbo.DatabaseRole.Table.sql similarity index 100% rename from Database/dbo.DatabaseRole.Table.sql rename to Deprecated/Database/dbo.DatabaseRole.Table.sql diff --git a/Database/dbo.Login.Table.sql b/Deprecated/Database/dbo.Login.Table.sql similarity index 100% rename from Database/dbo.Login.Table.sql rename to Deprecated/Database/dbo.Login.Table.sql diff --git a/Database/dbo.ObjectPermission.Table.sql b/Deprecated/Database/dbo.ObjectPermission.Table.sql similarity index 100% rename from Database/dbo.ObjectPermission.Table.sql rename to Deprecated/Database/dbo.ObjectPermission.Table.sql diff --git a/Database/dbo.ServerPermission.Table.sql b/Deprecated/Database/dbo.ServerPermission.Table.sql similarity index 100% rename from Database/dbo.ServerPermission.Table.sql rename to Deprecated/Database/dbo.ServerPermission.Table.sql diff --git a/Database/dbo.ServerRole.Table.sql b/Deprecated/Database/dbo.ServerRole.Table.sql similarity index 100% rename from Database/dbo.ServerRole.Table.sql rename to Deprecated/Database/dbo.ServerRole.Table.sql diff --git a/Database/dbo.SqlLinkedServerLogin.Table.sql b/Deprecated/Database/dbo.SqlLinkedServerLogin.Table.sql similarity index 100% rename from Database/dbo.SqlLinkedServerLogin.Table.sql rename to Deprecated/Database/dbo.SqlLinkedServerLogin.Table.sql diff --git a/Database/dbo.SqlServer.Table.sql b/Deprecated/Database/dbo.SqlServer.Table.sql similarity index 100% rename from Database/dbo.SqlServer.Table.sql rename to Deprecated/Database/dbo.SqlServer.Table.sql diff --git a/Database/dbo.SqlUser.Table.sql b/Deprecated/Database/dbo.SqlUser.Table.sql similarity index 100% rename from Database/dbo.SqlUser.Table.sql rename to Deprecated/Database/dbo.SqlUser.Table.sql diff --git a/Database/dbo.ufn_GetMember.UserDefinedFunction.sql b/Deprecated/Database/dbo.ufn_GetMember.UserDefinedFunction.sql similarity index 100% rename from Database/dbo.ufn_GetMember.UserDefinedFunction.sql rename to Deprecated/Database/dbo.ufn_GetMember.UserDefinedFunction.sql diff --git a/Database/dbo.ufn_GetObjectName.UserDefinedFunction.sql b/Deprecated/Database/dbo.ufn_GetObjectName.UserDefinedFunction.sql similarity index 100% rename from Database/dbo.ufn_GetObjectName.UserDefinedFunction.sql rename to Deprecated/Database/dbo.ufn_GetObjectName.UserDefinedFunction.sql diff --git a/Database/dbo.ufn_GetObjectType.UserDefinedFunction.sql b/Deprecated/Database/dbo.ufn_GetObjectType.UserDefinedFunction.sql similarity index 100% rename from Database/dbo.ufn_GetObjectType.UserDefinedFunction.sql rename to Deprecated/Database/dbo.ufn_GetObjectType.UserDefinedFunction.sql diff --git a/Database/dbo.usp_ChangedDatabasePermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedDatabasePermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedDatabasePermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedDatabasePermission.StoredProcedure.sql diff --git a/Database/dbo.usp_ChangedDatabaseRole.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedDatabaseRole.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedDatabaseRole.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedDatabaseRole.StoredProcedure.sql diff --git a/Database/dbo.usp_ChangedLogin.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedLogin.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedLogin.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedLogin.StoredProcedure.sql diff --git a/Database/dbo.usp_ChangedObjectPermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedObjectPermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedObjectPermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedObjectPermission.StoredProcedure.sql diff --git a/Database/dbo.usp_ChangedServerPermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedServerPermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedServerPermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedServerPermission.StoredProcedure.sql diff --git a/Database/dbo.usp_ChangedServerRole.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedServerRole.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedServerRole.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedServerRole.StoredProcedure.sql diff --git a/Database/dbo.usp_ChangedSqlUser.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedSqlUser.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedSqlUser.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedSqlUser.StoredProcedure.sql diff --git a/Database/dbo.usp_ChangedSqlUserOwnedObject.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ChangedSqlUserOwnedObject.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ChangedSqlUserOwnedObject.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ChangedSqlUserOwnedObject.StoredProcedure.sql diff --git a/Database/dbo.usp_DatabasePermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_DatabasePermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_DatabasePermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_DatabasePermission.StoredProcedure.sql diff --git a/Database/dbo.usp_DatabaseRole.StoredProcedure.sql b/Deprecated/Database/dbo.usp_DatabaseRole.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_DatabaseRole.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_DatabaseRole.StoredProcedure.sql diff --git a/Database/dbo.usp_LinkedServerLogin.StoredProcedure.sql b/Deprecated/Database/dbo.usp_LinkedServerLogin.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_LinkedServerLogin.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_LinkedServerLogin.StoredProcedure.sql diff --git a/Database/dbo.usp_Login.StoredProcedure.sql b/Deprecated/Database/dbo.usp_Login.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_Login.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_Login.StoredProcedure.sql diff --git a/Database/dbo.usp_ObjectPermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ObjectPermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ObjectPermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ObjectPermission.StoredProcedure.sql diff --git a/Database/dbo.usp_ServerPermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ServerPermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ServerPermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ServerPermission.StoredProcedure.sql diff --git a/Database/dbo.usp_ServerRole.StoredProcedure.sql b/Deprecated/Database/dbo.usp_ServerRole.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_ServerRole.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_ServerRole.StoredProcedure.sql diff --git a/Database/dbo.usp_SqlUser.StoredProcedure.sql b/Deprecated/Database/dbo.usp_SqlUser.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_SqlUser.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_SqlUser.StoredProcedure.sql diff --git a/Database/dbo.usp_SqlUserOwnedObject.StoredProcedure.sql b/Deprecated/Database/dbo.usp_SqlUserOwnedObject.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_SqlUserOwnedObject.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_SqlUserOwnedObject.StoredProcedure.sql diff --git a/Database/dbo.usp_del_DatabasePermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_DatabasePermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_DatabasePermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_DatabasePermission.StoredProcedure.sql diff --git a/Database/dbo.usp_del_DatabaseRole.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_DatabaseRole.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_DatabaseRole.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_DatabaseRole.StoredProcedure.sql diff --git a/Database/dbo.usp_del_LinkedServerLogin.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_LinkedServerLogin.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_LinkedServerLogin.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_LinkedServerLogin.StoredProcedure.sql diff --git a/Database/dbo.usp_del_Login.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_Login.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_Login.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_Login.StoredProcedure.sql diff --git a/Database/dbo.usp_del_ObjectPermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_ObjectPermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_ObjectPermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_ObjectPermission.StoredProcedure.sql diff --git a/Database/dbo.usp_del_ServerPermission.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_ServerPermission.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_ServerPermission.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_ServerPermission.StoredProcedure.sql diff --git a/Database/dbo.usp_del_ServerRole.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_ServerRole.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_ServerRole.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_ServerRole.StoredProcedure.sql diff --git a/Database/dbo.usp_del_SqlUser.StoredProcedure.sql b/Deprecated/Database/dbo.usp_del_SqlUser.StoredProcedure.sql similarity index 100% rename from Database/dbo.usp_del_SqlUser.StoredProcedure.sql rename to Deprecated/Database/dbo.usp_del_SqlUser.StoredProcedure.sql diff --git a/Database/dbo.vw_DatabasePermissionMember.View.sql b/Deprecated/Database/dbo.vw_DatabasePermissionMember.View.sql similarity index 100% rename from Database/dbo.vw_DatabasePermissionMember.View.sql rename to Deprecated/Database/dbo.vw_DatabasePermissionMember.View.sql diff --git a/Database/dbo.vw_DatabaseRoleMember.View.sql b/Deprecated/Database/dbo.vw_DatabaseRoleMember.View.sql similarity index 100% rename from Database/dbo.vw_DatabaseRoleMember.View.sql rename to Deprecated/Database/dbo.vw_DatabaseRoleMember.View.sql diff --git a/Database/dbo.vw_LoginMember.View.sql b/Deprecated/Database/dbo.vw_LoginMember.View.sql similarity index 100% rename from Database/dbo.vw_LoginMember.View.sql rename to Deprecated/Database/dbo.vw_LoginMember.View.sql diff --git a/Database/dbo.vw_ObjectPermissionMember.View.sql b/Deprecated/Database/dbo.vw_ObjectPermissionMember.View.sql similarity index 100% rename from Database/dbo.vw_ObjectPermissionMember.View.sql rename to Deprecated/Database/dbo.vw_ObjectPermissionMember.View.sql diff --git a/Database/dbo.vw_ServerPermissionMember.View.sql b/Deprecated/Database/dbo.vw_ServerPermissionMember.View.sql similarity index 100% rename from Database/dbo.vw_ServerPermissionMember.View.sql rename to Deprecated/Database/dbo.vw_ServerPermissionMember.View.sql diff --git a/Database/dbo.vw_ServerRoleMember.View.sql b/Deprecated/Database/dbo.vw_ServerRoleMember.View.sql similarity index 100% rename from Database/dbo.vw_ServerRoleMember.View.sql rename to Deprecated/Database/dbo.vw_ServerRoleMember.View.sql diff --git a/Database/dbo.vw_SqlUserDistinctServerdbname.View.sql b/Deprecated/Database/dbo.vw_SqlUserDistinctServerdbname.View.sql similarity index 100% rename from Database/dbo.vw_SqlUserDistinctServerdbname.View.sql rename to Deprecated/Database/dbo.vw_SqlUserDistinctServerdbname.View.sql diff --git a/Database/dbo.vw_SqlUserMember.View.sql b/Deprecated/Database/dbo.vw_SqlUserMember.View.sql similarity index 100% rename from Database/dbo.vw_SqlUserMember.View.sql rename to Deprecated/Database/dbo.vw_SqlUserMember.View.sql diff --git a/Database/dbo.vw_SqlUserOwnedObject.View.sql b/Deprecated/Database/dbo.vw_SqlUserOwnedObject.View.sql similarity index 100% rename from Database/dbo.vw_SqlUserOwnedObject.View.sql rename to Deprecated/Database/dbo.vw_SqlUserOwnedObject.View.sql diff --git a/Documentation/app.yaml b/Deprecated/Documentation/app.yaml similarity index 93% rename from Documentation/app.yaml rename to Deprecated/Documentation/app.yaml index 4c831aa..8980ed9 100644 --- a/Documentation/app.yaml +++ b/Deprecated/Documentation/app.yaml @@ -1,12 +1,12 @@ -application: sqlpsx -version: 1 -runtime: python -api_version: 1 - -handlers: -- url: (.*)/ - static_files: static\1/index.htm - upload: static/index.htm - -- url: / - static_dir: static +application: sqlpsx +version: 1 +runtime: python +api_version: 1 + +handlers: +- url: (.*)/ + static_files: static\1/index.htm + upload: static/index.htm + +- url: / + static_dir: static diff --git a/Documentation/index.yaml b/Deprecated/Documentation/index.yaml similarity index 97% rename from Documentation/index.yaml rename to Deprecated/Documentation/index.yaml index 3ec808c..a3b9e05 100644 --- a/Documentation/index.yaml +++ b/Deprecated/Documentation/index.yaml @@ -1,11 +1,11 @@ -indexes: - -# AUTOGENERATED - -# This index.yaml is automatically updated whenever the dev_appserver -# detects that a new type of query is run. If you want to manage the -# index.yaml file manually, remove the above marker line (the line -# saying "# AUTOGENERATED"). If you want to manage some indexes -# manually, move them above the marker line. The index.yaml file is -# automatically uploaded to the admin console when you next deploy -# your application using appcfg.py. +indexes: + +# AUTOGENERATED + +# This index.yaml is automatically updated whenever the dev_appserver +# detects that a new type of query is run. If you want to manage the +# index.yaml file manually, remove the above marker line (the line +# saying "# AUTOGENERATED"). If you want to manage some indexes +# manually, move them above the marker line. The index.yaml file is +# automatically uploaded to the admin console when you next deploy +# your application using appcfg.py. diff --git a/Documentation/static/Add-SqlDataFile.htm b/Deprecated/Documentation/static/Add-SqlDataFile.htm similarity index 100% rename from Documentation/static/Add-SqlDataFile.htm rename to Deprecated/Documentation/static/Add-SqlDataFile.htm diff --git a/Documentation/static/Add-SqlDatabase.htm b/Deprecated/Documentation/static/Add-SqlDatabase.htm similarity index 100% rename from Documentation/static/Add-SqlDatabase.htm rename to Deprecated/Documentation/static/Add-SqlDatabase.htm diff --git a/Documentation/static/Add-SqlDatabaseRole.htm b/Deprecated/Documentation/static/Add-SqlDatabaseRole.htm similarity index 100% rename from Documentation/static/Add-SqlDatabaseRole.htm rename to Deprecated/Documentation/static/Add-SqlDatabaseRole.htm diff --git a/Documentation/static/Add-SqlDatabaseRoleMember.htm b/Deprecated/Documentation/static/Add-SqlDatabaseRoleMember.htm similarity index 100% rename from Documentation/static/Add-SqlDatabaseRoleMember.htm rename to Deprecated/Documentation/static/Add-SqlDatabaseRoleMember.htm diff --git a/Documentation/static/Add-SqlFileGroup.htm b/Deprecated/Documentation/static/Add-SqlFileGroup.htm similarity index 100% rename from Documentation/static/Add-SqlFileGroup.htm rename to Deprecated/Documentation/static/Add-SqlFileGroup.htm diff --git a/Documentation/static/Add-SqlLogFile.htm b/Deprecated/Documentation/static/Add-SqlLogFile.htm similarity index 100% rename from Documentation/static/Add-SqlLogFile.htm rename to Deprecated/Documentation/static/Add-SqlLogFile.htm diff --git a/Documentation/static/Add-SqlLogin.htm b/Deprecated/Documentation/static/Add-SqlLogin.htm similarity index 100% rename from Documentation/static/Add-SqlLogin.htm rename to Deprecated/Documentation/static/Add-SqlLogin.htm diff --git a/Documentation/static/Add-SqlServerRoleMember.htm b/Deprecated/Documentation/static/Add-SqlServerRoleMember.htm similarity index 100% rename from Documentation/static/Add-SqlServerRoleMember.htm rename to Deprecated/Documentation/static/Add-SqlServerRoleMember.htm diff --git a/Documentation/static/Add-SqlUser.htm b/Deprecated/Documentation/static/Add-SqlUser.htm similarity index 100% rename from Documentation/static/Add-SqlUser.htm rename to Deprecated/Documentation/static/Add-SqlUser.htm diff --git a/Documentation/static/Copy-ISItemFileToSQL.htm b/Deprecated/Documentation/static/Copy-ISItemFileToSQL.htm similarity index 100% rename from Documentation/static/Copy-ISItemFileToSQL.htm rename to Deprecated/Documentation/static/Copy-ISItemFileToSQL.htm diff --git a/Documentation/static/Copy-ISItemSQLToFile.htm b/Deprecated/Documentation/static/Copy-ISItemSQLToFile.htm similarity index 100% rename from Documentation/static/Copy-ISItemSQLToFile.htm rename to Deprecated/Documentation/static/Copy-ISItemSQLToFile.htm diff --git a/Documentation/static/Copy-ISItemSQLToSQL.htm b/Deprecated/Documentation/static/Copy-ISItemSQLToSQL.htm similarity index 100% rename from Documentation/static/Copy-ISItemSQLToSQL.htm rename to Deprecated/Documentation/static/Copy-ISItemSQLToSQL.htm diff --git a/Documentation/static/Get-AgentAlert.htm b/Deprecated/Documentation/static/Get-AgentAlert.htm similarity index 100% rename from Documentation/static/Get-AgentAlert.htm rename to Deprecated/Documentation/static/Get-AgentAlert.htm diff --git a/Documentation/static/Get-AgentAlertCategory.htm b/Deprecated/Documentation/static/Get-AgentAlertCategory.htm similarity index 100% rename from Documentation/static/Get-AgentAlertCategory.htm rename to Deprecated/Documentation/static/Get-AgentAlertCategory.htm diff --git a/Documentation/static/Get-AgentJob.htm b/Deprecated/Documentation/static/Get-AgentJob.htm similarity index 100% rename from Documentation/static/Get-AgentJob.htm rename to Deprecated/Documentation/static/Get-AgentJob.htm diff --git a/Documentation/static/Get-AgentJobHistory.htm b/Deprecated/Documentation/static/Get-AgentJobHistory.htm similarity index 100% rename from Documentation/static/Get-AgentJobHistory.htm rename to Deprecated/Documentation/static/Get-AgentJobHistory.htm diff --git a/Documentation/static/Get-AgentJobSchedule.htm b/Deprecated/Documentation/static/Get-AgentJobSchedule.htm similarity index 100% rename from Documentation/static/Get-AgentJobSchedule.htm rename to Deprecated/Documentation/static/Get-AgentJobSchedule.htm diff --git a/Documentation/static/Get-AgentJobServer.htm b/Deprecated/Documentation/static/Get-AgentJobServer.htm similarity index 100% rename from Documentation/static/Get-AgentJobServer.htm rename to Deprecated/Documentation/static/Get-AgentJobServer.htm diff --git a/Documentation/static/Get-AgentJobStep.htm b/Deprecated/Documentation/static/Get-AgentJobStep.htm similarity index 100% rename from Documentation/static/Get-AgentJobStep.htm rename to Deprecated/Documentation/static/Get-AgentJobStep.htm diff --git a/Documentation/static/Get-AgentOperator.htm b/Deprecated/Documentation/static/Get-AgentOperator.htm similarity index 100% rename from Documentation/static/Get-AgentOperator.htm rename to Deprecated/Documentation/static/Get-AgentOperator.htm diff --git a/Documentation/static/Get-AgentOperatorCategory.htm b/Deprecated/Documentation/static/Get-AgentOperatorCategory.htm similarity index 100% rename from Documentation/static/Get-AgentOperatorCategory.htm rename to Deprecated/Documentation/static/Get-AgentOperatorCategory.htm diff --git a/Documentation/static/Get-AgentProxyAccount.htm b/Deprecated/Documentation/static/Get-AgentProxyAccount.htm similarity index 100% rename from Documentation/static/Get-AgentProxyAccount.htm rename to Deprecated/Documentation/static/Get-AgentProxyAccount.htm diff --git a/Documentation/static/Get-AgentSchedule.htm b/Deprecated/Documentation/static/Get-AgentSchedule.htm similarity index 100% rename from Documentation/static/Get-AgentSchedule.htm rename to Deprecated/Documentation/static/Get-AgentSchedule.htm diff --git a/Documentation/static/Get-AgentTargetServer.htm b/Deprecated/Documentation/static/Get-AgentTargetServer.htm similarity index 100% rename from Documentation/static/Get-AgentTargetServer.htm rename to Deprecated/Documentation/static/Get-AgentTargetServer.htm diff --git a/Documentation/static/Get-AgentTargetServerGroup.htm b/Deprecated/Documentation/static/Get-AgentTargetServerGroup.htm similarity index 100% rename from Documentation/static/Get-AgentTargetServerGroup.htm rename to Deprecated/Documentation/static/Get-AgentTargetServerGroup.htm diff --git a/Documentation/static/Get-GroupUser.htm b/Deprecated/Documentation/static/Get-GroupUser.htm similarity index 100% rename from Documentation/static/Get-GroupUser.htm rename to Deprecated/Documentation/static/Get-GroupUser.htm diff --git a/Documentation/static/Get-ISData.htm b/Deprecated/Documentation/static/Get-ISData.htm similarity index 100% rename from Documentation/static/Get-ISData.htm rename to Deprecated/Documentation/static/Get-ISData.htm diff --git a/Documentation/static/Get-ISItem.htm b/Deprecated/Documentation/static/Get-ISItem.htm similarity index 100% rename from Documentation/static/Get-ISItem.htm rename to Deprecated/Documentation/static/Get-ISItem.htm diff --git a/Documentation/static/Get-ISPackage.htm b/Deprecated/Documentation/static/Get-ISPackage.htm similarity index 100% rename from Documentation/static/Get-ISPackage.htm rename to Deprecated/Documentation/static/Get-ISPackage.htm diff --git a/Documentation/static/Get-ISRunningPackage.htm b/Deprecated/Documentation/static/Get-ISRunningPackage.htm similarity index 100% rename from Documentation/static/Get-ISRunningPackage.htm rename to Deprecated/Documentation/static/Get-ISRunningPackage.htm diff --git a/Documentation/static/Get-ISSqlConfigurationItem.htm b/Deprecated/Documentation/static/Get-ISSqlConfigurationItem.htm similarity index 100% rename from Documentation/static/Get-ISSqlConfigurationItem.htm rename to Deprecated/Documentation/static/Get-ISSqlConfigurationItem.htm diff --git a/Documentation/static/Get-ReplArticle.htm b/Deprecated/Documentation/static/Get-ReplArticle.htm similarity index 100% rename from Documentation/static/Get-ReplArticle.htm rename to Deprecated/Documentation/static/Get-ReplArticle.htm diff --git a/Documentation/static/Get-ReplEnumLogReaderAgent.htm b/Deprecated/Documentation/static/Get-ReplEnumLogReaderAgent.htm similarity index 100% rename from Documentation/static/Get-ReplEnumLogReaderAgent.htm rename to Deprecated/Documentation/static/Get-ReplEnumLogReaderAgent.htm diff --git a/Documentation/static/Get-ReplEnumPublications.htm b/Deprecated/Documentation/static/Get-ReplEnumPublications.htm similarity index 100% rename from Documentation/static/Get-ReplEnumPublications.htm rename to Deprecated/Documentation/static/Get-ReplEnumPublications.htm diff --git a/Documentation/static/Get-ReplEnumPublications2.htm b/Deprecated/Documentation/static/Get-ReplEnumPublications2.htm similarity index 100% rename from Documentation/static/Get-ReplEnumPublications2.htm rename to Deprecated/Documentation/static/Get-ReplEnumPublications2.htm diff --git a/Documentation/static/Get-ReplEnumSnapshotAgent.htm b/Deprecated/Documentation/static/Get-ReplEnumSnapshotAgent.htm similarity index 100% rename from Documentation/static/Get-ReplEnumSnapshotAgent.htm rename to Deprecated/Documentation/static/Get-ReplEnumSnapshotAgent.htm diff --git a/Documentation/static/Get-ReplEnumSubscriptions.htm b/Deprecated/Documentation/static/Get-ReplEnumSubscriptions.htm similarity index 100% rename from Documentation/static/Get-ReplEnumSubscriptions.htm rename to Deprecated/Documentation/static/Get-ReplEnumSubscriptions.htm diff --git a/Documentation/static/Get-ReplEnumSubscriptions2.htm b/Deprecated/Documentation/static/Get-ReplEnumSubscriptions2.htm similarity index 100% rename from Documentation/static/Get-ReplEnumSubscriptions2.htm rename to Deprecated/Documentation/static/Get-ReplEnumSubscriptions2.htm diff --git a/Documentation/static/Get-ReplLightPublication.htm b/Deprecated/Documentation/static/Get-ReplLightPublication.htm similarity index 100% rename from Documentation/static/Get-ReplLightPublication.htm rename to Deprecated/Documentation/static/Get-ReplLightPublication.htm diff --git a/Documentation/static/Get-ReplMonitor.htm b/Deprecated/Documentation/static/Get-ReplMonitor.htm similarity index 100% rename from Documentation/static/Get-ReplMonitor.htm rename to Deprecated/Documentation/static/Get-ReplMonitor.htm diff --git a/Documentation/static/Get-ReplPublication.htm b/Deprecated/Documentation/static/Get-ReplPublication.htm similarity index 100% rename from Documentation/static/Get-ReplPublication.htm rename to Deprecated/Documentation/static/Get-ReplPublication.htm diff --git a/Documentation/static/Get-ReplPublicationMonitor.htm b/Deprecated/Documentation/static/Get-ReplPublicationMonitor.htm similarity index 100% rename from Documentation/static/Get-ReplPublicationMonitor.htm rename to Deprecated/Documentation/static/Get-ReplPublicationMonitor.htm diff --git a/Documentation/static/Get-ReplPublisherMonitor.htm b/Deprecated/Documentation/static/Get-ReplPublisherMonitor.htm similarity index 100% rename from Documentation/static/Get-ReplPublisherMonitor.htm rename to Deprecated/Documentation/static/Get-ReplPublisherMonitor.htm diff --git a/Documentation/static/Get-ReplScript.htm b/Deprecated/Documentation/static/Get-ReplScript.htm similarity index 100% rename from Documentation/static/Get-ReplScript.htm rename to Deprecated/Documentation/static/Get-ReplScript.htm diff --git a/Documentation/static/Get-ReplServer.htm b/Deprecated/Documentation/static/Get-ReplServer.htm similarity index 100% rename from Documentation/static/Get-ReplServer.htm rename to Deprecated/Documentation/static/Get-ReplServer.htm diff --git a/Documentation/static/Get-ReplSubscriberSubscription.htm b/Deprecated/Documentation/static/Get-ReplSubscriberSubscription.htm similarity index 100% rename from Documentation/static/Get-ReplSubscriberSubscription.htm rename to Deprecated/Documentation/static/Get-ReplSubscriberSubscription.htm diff --git a/Documentation/static/Get-ReplSubscription.htm b/Deprecated/Documentation/static/Get-ReplSubscription.htm similarity index 100% rename from Documentation/static/Get-ReplSubscription.htm rename to Deprecated/Documentation/static/Get-ReplSubscription.htm diff --git a/Documentation/static/Get-ReplTransPendingCommandInfo.htm b/Deprecated/Documentation/static/Get-ReplTransPendingCommandInfo.htm similarity index 100% rename from Documentation/static/Get-ReplTransPendingCommandInfo.htm rename to Deprecated/Documentation/static/Get-ReplTransPendingCommandInfo.htm diff --git a/Documentation/static/Get-ShowMbrs.htm b/Deprecated/Documentation/static/Get-ShowMbrs.htm similarity index 100% rename from Documentation/static/Get-ShowMbrs.htm rename to Deprecated/Documentation/static/Get-ShowMbrs.htm diff --git a/Documentation/static/Get-Sql.htm b/Deprecated/Documentation/static/Get-Sql.htm similarity index 100% rename from Documentation/static/Get-Sql.htm rename to Deprecated/Documentation/static/Get-Sql.htm diff --git a/Documentation/static/Get-SqlCheck.htm b/Deprecated/Documentation/static/Get-SqlCheck.htm similarity index 100% rename from Documentation/static/Get-SqlCheck.htm rename to Deprecated/Documentation/static/Get-SqlCheck.htm diff --git a/Documentation/static/Get-SqlColumn.htm b/Deprecated/Documentation/static/Get-SqlColumn.htm similarity index 100% rename from Documentation/static/Get-SqlColumn.htm rename to Deprecated/Documentation/static/Get-SqlColumn.htm diff --git a/Documentation/static/Get-SqlConnection.htm b/Deprecated/Documentation/static/Get-SqlConnection.htm similarity index 100% rename from Documentation/static/Get-SqlConnection.htm rename to Deprecated/Documentation/static/Get-SqlConnection.htm diff --git a/Documentation/static/Get-SqlData.htm b/Deprecated/Documentation/static/Get-SqlData.htm similarity index 100% rename from Documentation/static/Get-SqlData.htm rename to Deprecated/Documentation/static/Get-SqlData.htm diff --git a/Documentation/static/Get-SqlDataFile.htm b/Deprecated/Documentation/static/Get-SqlDataFile.htm similarity index 100% rename from Documentation/static/Get-SqlDataFile.htm rename to Deprecated/Documentation/static/Get-SqlDataFile.htm diff --git a/Documentation/static/Get-SqlDatabase.htm b/Deprecated/Documentation/static/Get-SqlDatabase.htm similarity index 100% rename from Documentation/static/Get-SqlDatabase.htm rename to Deprecated/Documentation/static/Get-SqlDatabase.htm diff --git a/Documentation/static/Get-SqlDatabasePermission.htm b/Deprecated/Documentation/static/Get-SqlDatabasePermission.htm similarity index 100% rename from Documentation/static/Get-SqlDatabasePermission.htm rename to Deprecated/Documentation/static/Get-SqlDatabasePermission.htm diff --git a/Documentation/static/Get-SqlDatabaseRole.htm b/Deprecated/Documentation/static/Get-SqlDatabaseRole.htm similarity index 100% rename from Documentation/static/Get-SqlDatabaseRole.htm rename to Deprecated/Documentation/static/Get-SqlDatabaseRole.htm diff --git a/Documentation/static/Get-SqlDefaultDir.htm b/Deprecated/Documentation/static/Get-SqlDefaultDir.htm similarity index 100% rename from Documentation/static/Get-SqlDefaultDir.htm rename to Deprecated/Documentation/static/Get-SqlDefaultDir.htm diff --git a/Documentation/static/Get-SqlEdition.htm b/Deprecated/Documentation/static/Get-SqlEdition.htm similarity index 100% rename from Documentation/static/Get-SqlEdition.htm rename to Deprecated/Documentation/static/Get-SqlEdition.htm diff --git a/Documentation/static/Get-SqlErrorLog.htm b/Deprecated/Documentation/static/Get-SqlErrorLog.htm similarity index 100% rename from Documentation/static/Get-SqlErrorLog.htm rename to Deprecated/Documentation/static/Get-SqlErrorLog.htm diff --git a/Documentation/static/Get-SqlForeignKey.htm b/Deprecated/Documentation/static/Get-SqlForeignKey.htm similarity index 100% rename from Documentation/static/Get-SqlForeignKey.htm rename to Deprecated/Documentation/static/Get-SqlForeignKey.htm diff --git a/Documentation/static/Get-SqlIndex.htm b/Deprecated/Documentation/static/Get-SqlIndex.htm similarity index 100% rename from Documentation/static/Get-SqlIndex.htm rename to Deprecated/Documentation/static/Get-SqlIndex.htm diff --git a/Documentation/static/Get-SqlIndexFragmentation.htm b/Deprecated/Documentation/static/Get-SqlIndexFragmentation.htm similarity index 100% rename from Documentation/static/Get-SqlIndexFragmentation.htm rename to Deprecated/Documentation/static/Get-SqlIndexFragmentation.htm diff --git a/Documentation/static/Get-SqlInformation_Schema.Columns.htm b/Deprecated/Documentation/static/Get-SqlInformation_Schema.Columns.htm similarity index 100% rename from Documentation/static/Get-SqlInformation_Schema.Columns.htm rename to Deprecated/Documentation/static/Get-SqlInformation_Schema.Columns.htm diff --git a/Documentation/static/Get-SqlInformation_Schema.Routines.htm b/Deprecated/Documentation/static/Get-SqlInformation_Schema.Routines.htm similarity index 100% rename from Documentation/static/Get-SqlInformation_Schema.Routines.htm rename to Deprecated/Documentation/static/Get-SqlInformation_Schema.Routines.htm diff --git a/Documentation/static/Get-SqlInformation_Schema.Tables.htm b/Deprecated/Documentation/static/Get-SqlInformation_Schema.Tables.htm similarity index 100% rename from Documentation/static/Get-SqlInformation_Schema.Tables.htm rename to Deprecated/Documentation/static/Get-SqlInformation_Schema.Tables.htm diff --git a/Documentation/static/Get-SqlInformation_Schema.Views.htm b/Deprecated/Documentation/static/Get-SqlInformation_Schema.Views.htm similarity index 100% rename from Documentation/static/Get-SqlInformation_Schema.Views.htm rename to Deprecated/Documentation/static/Get-SqlInformation_Schema.Views.htm diff --git a/Documentation/static/Get-SqlLinkedServerLogin.htm b/Deprecated/Documentation/static/Get-SqlLinkedServerLogin.htm similarity index 100% rename from Documentation/static/Get-SqlLinkedServerLogin.htm rename to Deprecated/Documentation/static/Get-SqlLinkedServerLogin.htm diff --git a/Documentation/static/Get-SqlLogFile.htm b/Deprecated/Documentation/static/Get-SqlLogFile.htm similarity index 100% rename from Documentation/static/Get-SqlLogFile.htm rename to Deprecated/Documentation/static/Get-SqlLogFile.htm diff --git a/Documentation/static/Get-SqlLogin.htm b/Deprecated/Documentation/static/Get-SqlLogin.htm similarity index 100% rename from Documentation/static/Get-SqlLogin.htm rename to Deprecated/Documentation/static/Get-SqlLogin.htm diff --git a/Documentation/static/Get-SqlObjectPermission.htm b/Deprecated/Documentation/static/Get-SqlObjectPermission.htm similarity index 100% rename from Documentation/static/Get-SqlObjectPermission.htm rename to Deprecated/Documentation/static/Get-SqlObjectPermission.htm diff --git a/Documentation/static/Get-SqlPort.htm b/Deprecated/Documentation/static/Get-SqlPort.htm similarity index 100% rename from Documentation/static/Get-SqlPort.htm rename to Deprecated/Documentation/static/Get-SqlPort.htm diff --git a/Documentation/static/Get-SqlProcess.htm b/Deprecated/Documentation/static/Get-SqlProcess.htm similarity index 100% rename from Documentation/static/Get-SqlProcess.htm rename to Deprecated/Documentation/static/Get-SqlProcess.htm diff --git a/Documentation/static/Get-SqlSchema.htm b/Deprecated/Documentation/static/Get-SqlSchema.htm similarity index 100% rename from Documentation/static/Get-SqlSchema.htm rename to Deprecated/Documentation/static/Get-SqlSchema.htm diff --git a/Documentation/static/Get-SqlScripter.htm b/Deprecated/Documentation/static/Get-SqlScripter.htm similarity index 100% rename from Documentation/static/Get-SqlScripter.htm rename to Deprecated/Documentation/static/Get-SqlScripter.htm diff --git a/Documentation/static/Get-SqlServer.htm b/Deprecated/Documentation/static/Get-SqlServer.htm similarity index 100% rename from Documentation/static/Get-SqlServer.htm rename to Deprecated/Documentation/static/Get-SqlServer.htm diff --git a/Documentation/static/Get-SqlServerPermission.htm b/Deprecated/Documentation/static/Get-SqlServerPermission.htm similarity index 100% rename from Documentation/static/Get-SqlServerPermission.htm rename to Deprecated/Documentation/static/Get-SqlServerPermission.htm diff --git a/Documentation/static/Get-SqlServerRole.htm b/Deprecated/Documentation/static/Get-SqlServerRole.htm similarity index 100% rename from Documentation/static/Get-SqlServerRole.htm rename to Deprecated/Documentation/static/Get-SqlServerRole.htm diff --git a/Documentation/static/Get-SqlShowMbrs.htm b/Deprecated/Documentation/static/Get-SqlShowMbrs.htm similarity index 100% rename from Documentation/static/Get-SqlShowMbrs.htm rename to Deprecated/Documentation/static/Get-SqlShowMbrs.htm diff --git a/Documentation/static/Get-SqlStatistic.htm b/Deprecated/Documentation/static/Get-SqlStatistic.htm similarity index 100% rename from Documentation/static/Get-SqlStatistic.htm rename to Deprecated/Documentation/static/Get-SqlStatistic.htm diff --git a/Documentation/static/Get-SqlStoredProcedure.htm b/Deprecated/Documentation/static/Get-SqlStoredProcedure.htm similarity index 100% rename from Documentation/static/Get-SqlStoredProcedure.htm rename to Deprecated/Documentation/static/Get-SqlStoredProcedure.htm diff --git a/Documentation/static/Get-SqlSynonym.htm b/Deprecated/Documentation/static/Get-SqlSynonym.htm similarity index 100% rename from Documentation/static/Get-SqlSynonym.htm rename to Deprecated/Documentation/static/Get-SqlSynonym.htm diff --git a/Documentation/static/Get-SqlSysDatabases.htm b/Deprecated/Documentation/static/Get-SqlSysDatabases.htm similarity index 100% rename from Documentation/static/Get-SqlSysDatabases.htm rename to Deprecated/Documentation/static/Get-SqlSysDatabases.htm diff --git a/Documentation/static/Get-SqlTable.htm b/Deprecated/Documentation/static/Get-SqlTable.htm similarity index 100% rename from Documentation/static/Get-SqlTable.htm rename to Deprecated/Documentation/static/Get-SqlTable.htm diff --git a/Documentation/static/Get-SqlTransaction.htm b/Deprecated/Documentation/static/Get-SqlTransaction.htm similarity index 100% rename from Documentation/static/Get-SqlTransaction.htm rename to Deprecated/Documentation/static/Get-SqlTransaction.htm diff --git a/Documentation/static/Get-SqlTrigger.htm b/Deprecated/Documentation/static/Get-SqlTrigger.htm similarity index 100% rename from Documentation/static/Get-SqlTrigger.htm rename to Deprecated/Documentation/static/Get-SqlTrigger.htm diff --git a/Documentation/static/Get-SqlUser.htm b/Deprecated/Documentation/static/Get-SqlUser.htm similarity index 100% rename from Documentation/static/Get-SqlUser.htm rename to Deprecated/Documentation/static/Get-SqlUser.htm diff --git a/Documentation/static/Get-SqlUserDefinedDataType.htm b/Deprecated/Documentation/static/Get-SqlUserDefinedDataType.htm similarity index 100% rename from Documentation/static/Get-SqlUserDefinedDataType.htm rename to Deprecated/Documentation/static/Get-SqlUserDefinedDataType.htm diff --git a/Documentation/static/Get-SqlUserDefinedFunction.htm b/Deprecated/Documentation/static/Get-SqlUserDefinedFunction.htm similarity index 100% rename from Documentation/static/Get-SqlUserDefinedFunction.htm rename to Deprecated/Documentation/static/Get-SqlUserDefinedFunction.htm diff --git a/Documentation/static/Get-SqlVersion.htm b/Deprecated/Documentation/static/Get-SqlVersion.htm similarity index 100% rename from Documentation/static/Get-SqlVersion.htm rename to Deprecated/Documentation/static/Get-SqlVersion.htm diff --git a/Documentation/static/Get-SqlView.htm b/Deprecated/Documentation/static/Get-SqlView.htm similarity index 100% rename from Documentation/static/Get-SqlView.htm rename to Deprecated/Documentation/static/Get-SqlView.htm diff --git a/Documentation/static/Invoke-SqlBackup.htm b/Deprecated/Documentation/static/Invoke-SqlBackup.htm similarity index 100% rename from Documentation/static/Invoke-SqlBackup.htm rename to Deprecated/Documentation/static/Invoke-SqlBackup.htm diff --git a/Documentation/static/Invoke-SqlDatabaseCheck.htm b/Deprecated/Documentation/static/Invoke-SqlDatabaseCheck.htm similarity index 100% rename from Documentation/static/Invoke-SqlDatabaseCheck.htm rename to Deprecated/Documentation/static/Invoke-SqlDatabaseCheck.htm diff --git a/Documentation/static/Invoke-SqlIndexDefrag.htm b/Deprecated/Documentation/static/Invoke-SqlIndexDefrag.htm similarity index 100% rename from Documentation/static/Invoke-SqlIndexDefrag.htm rename to Deprecated/Documentation/static/Invoke-SqlIndexDefrag.htm diff --git a/Documentation/static/Invoke-SqlIndexRebuild.htm b/Deprecated/Documentation/static/Invoke-SqlIndexRebuild.htm similarity index 100% rename from Documentation/static/Invoke-SqlIndexRebuild.htm rename to Deprecated/Documentation/static/Invoke-SqlIndexRebuild.htm diff --git a/Documentation/static/Invoke-SqlRestore.htm b/Deprecated/Documentation/static/Invoke-SqlRestore.htm similarity index 100% rename from Documentation/static/Invoke-SqlRestore.htm rename to Deprecated/Documentation/static/Invoke-SqlRestore.htm diff --git a/Documentation/static/New-ISApplication.htm b/Deprecated/Documentation/static/New-ISApplication.htm similarity index 100% rename from Documentation/static/New-ISApplication.htm rename to Deprecated/Documentation/static/New-ISApplication.htm diff --git a/Documentation/static/New-ISItem.htm b/Deprecated/Documentation/static/New-ISItem.htm similarity index 100% rename from Documentation/static/New-ISItem.htm rename to Deprecated/Documentation/static/New-ISItem.htm diff --git a/Documentation/static/New-ReplMergePublication.htm b/Deprecated/Documentation/static/New-ReplMergePublication.htm similarity index 100% rename from Documentation/static/New-ReplMergePublication.htm rename to Deprecated/Documentation/static/New-ReplMergePublication.htm diff --git a/Documentation/static/New-ReplScriptOptions.htm b/Deprecated/Documentation/static/New-ReplScriptOptions.htm similarity index 100% rename from Documentation/static/New-ReplScriptOptions.htm rename to Deprecated/Documentation/static/New-ReplScriptOptions.htm diff --git a/Documentation/static/New-ReplTransPublication.htm b/Deprecated/Documentation/static/New-ReplTransPublication.htm similarity index 100% rename from Documentation/static/New-ReplTransPublication.htm rename to Deprecated/Documentation/static/New-ReplTransPublication.htm diff --git a/Documentation/static/New-ShowMbrs.htm b/Deprecated/Documentation/static/New-ShowMbrs.htm similarity index 100% rename from Documentation/static/New-ShowMbrs.htm rename to Deprecated/Documentation/static/New-ShowMbrs.htm diff --git a/Documentation/static/New-SqlScriptingOptions.htm b/Deprecated/Documentation/static/New-SqlScriptingOptions.htm similarity index 100% rename from Documentation/static/New-SqlScriptingOptions.htm rename to Deprecated/Documentation/static/New-SqlScriptingOptions.htm diff --git a/Documentation/static/Out-SqlScript.htm b/Deprecated/Documentation/static/Out-SqlScript.htm similarity index 100% rename from Documentation/static/Out-SqlScript.htm rename to Deprecated/Documentation/static/Out-SqlScript.htm diff --git a/Documentation/static/Remove-ISItem.htm b/Deprecated/Documentation/static/Remove-ISItem.htm similarity index 100% rename from Documentation/static/Remove-ISItem.htm rename to Deprecated/Documentation/static/Remove-ISItem.htm diff --git a/Documentation/static/Remove-SqlDatabase.htm b/Deprecated/Documentation/static/Remove-SqlDatabase.htm similarity index 100% rename from Documentation/static/Remove-SqlDatabase.htm rename to Deprecated/Documentation/static/Remove-SqlDatabase.htm diff --git a/Documentation/static/Remove-SqlDatabaseRole.htm b/Deprecated/Documentation/static/Remove-SqlDatabaseRole.htm similarity index 100% rename from Documentation/static/Remove-SqlDatabaseRole.htm rename to Deprecated/Documentation/static/Remove-SqlDatabaseRole.htm diff --git a/Documentation/static/Remove-SqlDatabaseRoleMember.htm b/Deprecated/Documentation/static/Remove-SqlDatabaseRoleMember.htm similarity index 100% rename from Documentation/static/Remove-SqlDatabaseRoleMember.htm rename to Deprecated/Documentation/static/Remove-SqlDatabaseRoleMember.htm diff --git a/Documentation/static/Remove-SqlLogin.htm b/Deprecated/Documentation/static/Remove-SqlLogin.htm similarity index 100% rename from Documentation/static/Remove-SqlLogin.htm rename to Deprecated/Documentation/static/Remove-SqlLogin.htm diff --git a/Documentation/static/Remove-SqlServerRoleMember.htm b/Deprecated/Documentation/static/Remove-SqlServerRoleMember.htm similarity index 100% rename from Documentation/static/Remove-SqlServerRoleMember.htm rename to Deprecated/Documentation/static/Remove-SqlServerRoleMember.htm diff --git a/Documentation/static/Remove-SqlUser.htm b/Deprecated/Documentation/static/Remove-SqlUser.htm similarity index 100% rename from Documentation/static/Remove-SqlUser.htm rename to Deprecated/Documentation/static/Remove-SqlUser.htm diff --git a/Documentation/static/Rename-ISItem.htm b/Deprecated/Documentation/static/Rename-ISItem.htm similarity index 100% rename from Documentation/static/Rename-ISItem.htm rename to Deprecated/Documentation/static/Rename-ISItem.htm diff --git a/Documentation/static/Set-AgentJobHistoryFilter.htm b/Deprecated/Documentation/static/Set-AgentJobHistoryFilter.htm similarity index 100% rename from Documentation/static/Set-AgentJobHistoryFilter.htm rename to Deprecated/Documentation/static/Set-AgentJobHistoryFilter.htm diff --git a/Documentation/static/Set-ISConnectionString.htm b/Deprecated/Documentation/static/Set-ISConnectionString.htm similarity index 100% rename from Documentation/static/Set-ISConnectionString.htm rename to Deprecated/Documentation/static/Set-ISConnectionString.htm diff --git a/Documentation/static/Set-ISPackage.htm b/Deprecated/Documentation/static/Set-ISPackage.htm similarity index 100% rename from Documentation/static/Set-ISPackage.htm rename to Deprecated/Documentation/static/Set-ISPackage.htm diff --git a/Documentation/static/Set-ShowMbrs.htm b/Deprecated/Documentation/static/Set-ShowMbrs.htm similarity index 100% rename from Documentation/static/Set-ShowMbrs.htm rename to Deprecated/Documentation/static/Set-ShowMbrs.htm diff --git a/Documentation/static/Set-SqlData.htm b/Deprecated/Documentation/static/Set-SqlData.htm similarity index 100% rename from Documentation/static/Set-SqlData.htm rename to Deprecated/Documentation/static/Set-SqlData.htm diff --git a/Documentation/static/Set-SqlDatabasePermission.htm b/Deprecated/Documentation/static/Set-SqlDatabasePermission.htm similarity index 100% rename from Documentation/static/Set-SqlDatabasePermission.htm rename to Deprecated/Documentation/static/Set-SqlDatabasePermission.htm diff --git a/Documentation/static/Set-SqlObjectPermission.htm b/Deprecated/Documentation/static/Set-SqlObjectPermission.htm similarity index 100% rename from Documentation/static/Set-SqlObjectPermission.htm rename to Deprecated/Documentation/static/Set-SqlObjectPermission.htm diff --git a/Documentation/static/Set-SqlServerPermission.htm b/Deprecated/Documentation/static/Set-SqlServerPermission.htm similarity index 100% rename from Documentation/static/Set-SqlServerPermission.htm rename to Deprecated/Documentation/static/Set-SqlServerPermission.htm diff --git a/Documentation/static/Test-ISPath.htm b/Deprecated/Documentation/static/Test-ISPath.htm similarity index 100% rename from Documentation/static/Test-ISPath.htm rename to Deprecated/Documentation/static/Test-ISPath.htm diff --git a/Documentation/static/Test-SqlScript.htm b/Deprecated/Documentation/static/Test-SqlScript.htm similarity index 100% rename from Documentation/static/Test-SqlScript.htm rename to Deprecated/Documentation/static/Test-SqlScript.htm diff --git a/Documentation/static/Update-SqlStatistic.htm b/Deprecated/Documentation/static/Update-SqlStatistic.htm similarity index 100% rename from Documentation/static/Update-SqlStatistic.htm rename to Deprecated/Documentation/static/Update-SqlStatistic.htm diff --git a/Documentation/static/default.htm b/Deprecated/Documentation/static/default.htm similarity index 100% rename from Documentation/static/default.htm rename to Deprecated/Documentation/static/default.htm diff --git a/Documentation/static/index.htm b/Deprecated/Documentation/static/index.htm similarity index 100% rename from Documentation/static/index.htm rename to Deprecated/Documentation/static/index.htm diff --git a/Modules/ISECreamBasic/Add-IseMenu.ps1 b/Deprecated/ISECreamBasic/Add-IseMenu.ps1 similarity index 100% rename from Modules/ISECreamBasic/Add-IseMenu.ps1 rename to Deprecated/ISECreamBasic/Add-IseMenu.ps1 diff --git a/Modules/ISECreamBasic/ISECreamBasic.psm1 b/Deprecated/ISECreamBasic/ISECreamBasic.psm1 similarity index 100% rename from Modules/ISECreamBasic/ISECreamBasic.psm1 rename to Deprecated/ISECreamBasic/ISECreamBasic.psm1 diff --git a/Modules/ISECreamBasic/Remove-IseMenu.ps1 b/Deprecated/ISECreamBasic/Remove-IseMenu.ps1 similarity index 100% rename from Modules/ISECreamBasic/Remove-IseMenu.ps1 rename to Deprecated/ISECreamBasic/Remove-IseMenu.ps1 diff --git a/Modules/ISECreamBasic/license.txt b/Deprecated/ISECreamBasic/license.txt similarity index 98% rename from Modules/ISECreamBasic/license.txt rename to Deprecated/ISECreamBasic/license.txt index 0218f75..da3dc93 100644 --- a/Modules/ISECreamBasic/license.txt +++ b/Deprecated/ISECreamBasic/license.txt @@ -1,31 +1,31 @@ -Microsoft Public License (Ms-PL) - -This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. - -1. Definitions - -The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. - -A "contribution" is the original software, or any additions or changes to the software. - -A "contributor" is any person that distributes its contribution under this license. - -"Licensed patents" are a contributor's patent claims that read directly on its contribution. - -2. Grant of Rights - -(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. - -(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. - -3. Conditions and Limitations - -(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. - -(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. - -(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. - -(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. - +Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. + +1. Definitions + +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + +A "contribution" is the original software, or any additions or changes to the software. + +A "contributor" is any person that distributes its contribution under this license. + +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights + +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations + +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. \ No newline at end of file diff --git a/Modules/ISECreamBasic/readme.txt b/Deprecated/ISECreamBasic/readme.txt similarity index 98% rename from Modules/ISECreamBasic/readme.txt rename to Deprecated/ISECreamBasic/readme.txt index 4372ebf..e9f6d0a 100644 --- a/Modules/ISECreamBasic/readme.txt +++ b/Deprecated/ISECreamBasic/readme.txt @@ -1,2 +1,2 @@ -Note: IseCreamBasic is derived from "PowerShell ISE-Cream" http://psisecream.codeplex.com/ -The module is redistributed according to the license terms as noted in license.txt +Note: IseCreamBasic is derived from "PowerShell ISE-Cream" http://psisecream.codeplex.com/ +The module is redistributed according to the license terms as noted in license.txt diff --git a/Library/LibraryAgent.ps1 b/Deprecated/Library/LibraryAgent.ps1 similarity index 96% rename from Library/LibraryAgent.ps1 rename to Deprecated/Library/LibraryAgent.ps1 index 83d594e..9b6dee6 100644 --- a/Library/LibraryAgent.ps1 +++ b/Deprecated/Library/LibraryAgent.ps1 @@ -1,375 +1,375 @@ -# --------------------------------------------------------------------------- -### -# --------------------------------------------------------------------------- - -####################### -function Get-AgentJobServer -{ - param($sqlserver=$(throw 'Get-AgentJobServer:`$sqlserver is required'),[string]$Username,[string]$Password) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver $Username $Password } - 'Server' { $server = $sqlserver } - default { throw 'Get-AgentJobServer:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-AgentJobServer $($server.Name)" - return $server.JobServer - -} #Get-AgentJobServer - -####################### -function Get-AgentAlertCategory -{ - param($jobserver=$(throw 'Get-AgentAlertCategory:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentAlertCategory:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentAlertCategory $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.AlertCategories.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.AlertCategories[$name] - } - } - else - { $jobsrv.AlertCategories } - - -} #Get-AgentAlertCategory - -####################### -function Get-AgentAlert -{ - param($jobserver=$(throw 'Get-AgentAlert:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentAlert:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentAlert $($jobsrv.Name)" - - if ($name) - { if (!$jobsrv.Alerts.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.Alerts[$name] - } - } - else - { $jobsrv.Alerts } - - -} #Get-AgentAlert - -####################### -function Get-AgentJob -{ - param($jobserver=$(throw 'Get-AgentJob:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentJob:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentJob $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.Jobs.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.Jobs[$name] - } - } - else - { $jobsrv.Jobs } - -} #Get-AgentJob - -####################### -function Get-AgentJobSchedule -{ - param($job, [string]$name="*") - begin - { - function Select-AgentJobSchedule ($job, [string]$name="*") - { - - foreach ($jobSchedule in $job.JobSchedules) - { - if ($jobSchedule.name -like "*$name*" -or $name.Contains($jobSchedule.name)) - { - #Return JobSchedule Object - $jobSchedule - } - } - - } #Select-AgentJobSchedule - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Job') - { Write-Verbose "Get-AgentJobSchedule $($_.Name)" - Select-AgentJobSchedule $_ -name $name } - else - { throw 'Get-AgentJobSchedule:Param `$job must be a Job object.' } - } - } - end - { - if ($job) - { $job | Get-AgentJobSchedule -name $name } - } - -} #Get-AgentJobSchedule - -####################### -function Get-AgentJobStep -{ - param($job, [string]$name="*") - begin - { - function Select-AgentJobStep ($job, [string]$name="*") - { - - foreach ($JobStep in $job.JobSteps) - { - if ($JobStep.name -like "*$name*" -or $name.Contains($jobStep.name)) - { - #Return JobStep Object - $JobStep - } - } - - } #Select-AgentJobStep - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Job') - { Write-Verbose "Get-AgentJobStep $($_.Name)" - Select-AgentJobStep $_ -name $name } - else - { throw 'Get-AgentJobStep:Param `$job must be a Job object.' } - } - } - end - { - if ($job) - { $job | Get-AgentJobStep -name $name } - } - -} #Get-AgentJobStep - -####################### -function Get-AgentOperator -{ - param($jobserver=$(throw 'Get-AgentOperator:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentOperator:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentOperator $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.Operators.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.Operators[$name] - } - } - else - { $jobsrv.Operators } - -} #Get-AgentOperator - -####################### -function Get-AgentOperatorCategory -{ - param($jobserver=$(throw 'Get-AgentOperatorCategory:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentOperatorCategory:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentOperatorCategory $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.OperatorCategories.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.OperatorCategories[$name] - } - } - else - { $jobsrv.OperatorCategories } - -} #Get-AgentOperatorCategory - -####################### -function Get-AgentProxyAccount -{ - param($jobserver=$(throw 'Get-AgentProxyAccount:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentProxyAccount:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentProxyAccount $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.ProxyAccounts.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.ProxyAccounts[$name] - } - } - else - { $jobsrv.ProxyAccounts } - -} #Get-AgentProxyAccount - -####################### -function Get-AgentSchedule -{ - param($jobserver=$(throw 'Get-AgentJobSchedule:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentJobSchedule:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentJobSchedule $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.SharedSchedules.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.SharedSchedules[$name] - } - } - else - { $jobsrv.SharedSchedules } - -} #Get-AgentSchedule - -####################### -function Get-AgentTargetServerGroup -{ - param($jobserver=$(throw 'Get-AgentTargetServerGroup:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentTargetServerGroup:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentTargetServerGroup $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.TargetServerGroups.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.TargetServerGroups[$name] - } - } - else - { $jobsrv.TargetServerGroups } - -} #Get-AgentTargetServerGroup - -####################### -function Get-AgentTargetServer -{ - param($jobserver=$(throw 'Get-AgentTargetServer:`$jobserver is required'),[string]$name) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentTargetServer:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentTargetServer $($jobsrv.Name) $name" - - if ($name) - { if (!$jobsrv.TargetServers.Contains("$name")) {throw 'Check $name Name.'} - else { - $jobsrv.TargetServers[$name] - } - } - else - { $jobsrv.TargetServers } - -} #Get-AgentTargetServer - -####################### -function Set-AgentJobHistoryFilter -{ - param([string]$name,$endDate,$startDate,[string]$outCome) - - $jobHistoryFilter = New-Object Microsoft.SqlServer.Management.Smo.Agent.JobHistoryFilter - if ($name) { $jobHistoryFilter.JobName = $name } - if ($endDate) { $jobHistoryFilter.EndRunDate = [datetime]$endDate } - if ($startDate) { $jobHistoryFilter.StartRunDate = [datetime]$startDate } - #outComeTypes: Cancelled,Failed, InProgress, Retry, Succeeded, Unknow - if ($outcome) { $jobHistoryFilter.OutComeTypes = $outCome } - - return $jobHistoryFilter -} -####################### -function Get-AgentJobHistory -{ - param($jobserver=$(throw 'Get-AgentJobHistory:`$jobserver is required'),$jobHistoryFilter) - - switch ($jobserver.GetType().Name) - { - 'String' { $jobsrv = Get-AgentJobServer $jobserver } - 'JobServer' { $jobsrv = $jobserver } - default { throw 'Get-AgentJobHistory:Param `$jobserver must be a String or JobServer object.' } - } - - Write-Verbose "Get-AgentJobHistory $($jobsrv.Name)" - - if ($jobHistoryFilter) - { if ($jobHistoryFilter.GetType().Name -ne "JobHistoryFilter") {throw 'JobHistoryFilter must be a JobHistoryFilter object.'} - else { - $jobsrv.EnumJobHistory($jobHistoryFilter) - } - } - else - { $jobsrv.EnumJobHistory() } - -} #Get-AgentJobHistory - +# --------------------------------------------------------------------------- +### +# --------------------------------------------------------------------------- + +####################### +function Get-AgentJobServer +{ + param($sqlserver=$(throw 'Get-AgentJobServer:`$sqlserver is required'),[string]$Username,[string]$Password) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver $Username $Password } + 'Server' { $server = $sqlserver } + default { throw 'Get-AgentJobServer:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-AgentJobServer $($server.Name)" + return $server.JobServer + +} #Get-AgentJobServer + +####################### +function Get-AgentAlertCategory +{ + param($jobserver=$(throw 'Get-AgentAlertCategory:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentAlertCategory:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentAlertCategory $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.AlertCategories.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.AlertCategories[$name] + } + } + else + { $jobsrv.AlertCategories } + + +} #Get-AgentAlertCategory + +####################### +function Get-AgentAlert +{ + param($jobserver=$(throw 'Get-AgentAlert:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentAlert:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentAlert $($jobsrv.Name)" + + if ($name) + { if (!$jobsrv.Alerts.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.Alerts[$name] + } + } + else + { $jobsrv.Alerts } + + +} #Get-AgentAlert + +####################### +function Get-AgentJob +{ + param($jobserver=$(throw 'Get-AgentJob:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentJob:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentJob $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.Jobs.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.Jobs[$name] + } + } + else + { $jobsrv.Jobs } + +} #Get-AgentJob + +####################### +function Get-AgentJobSchedule +{ + param($job, [string]$name="*") + begin + { + function Select-AgentJobSchedule ($job, [string]$name="*") + { + + foreach ($jobSchedule in $job.JobSchedules) + { + if ($jobSchedule.name -like "*$name*" -or $name.Contains($jobSchedule.name)) + { + #Return JobSchedule Object + $jobSchedule + } + } + + } #Select-AgentJobSchedule + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Job') + { Write-Verbose "Get-AgentJobSchedule $($_.Name)" + Select-AgentJobSchedule $_ -name $name } + else + { throw 'Get-AgentJobSchedule:Param `$job must be a Job object.' } + } + } + end + { + if ($job) + { $job | Get-AgentJobSchedule -name $name } + } + +} #Get-AgentJobSchedule + +####################### +function Get-AgentJobStep +{ + param($job, [string]$name="*") + begin + { + function Select-AgentJobStep ($job, [string]$name="*") + { + + foreach ($JobStep in $job.JobSteps) + { + if ($JobStep.name -like "*$name*" -or $name.Contains($jobStep.name)) + { + #Return JobStep Object + $JobStep + } + } + + } #Select-AgentJobStep + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Job') + { Write-Verbose "Get-AgentJobStep $($_.Name)" + Select-AgentJobStep $_ -name $name } + else + { throw 'Get-AgentJobStep:Param `$job must be a Job object.' } + } + } + end + { + if ($job) + { $job | Get-AgentJobStep -name $name } + } + +} #Get-AgentJobStep + +####################### +function Get-AgentOperator +{ + param($jobserver=$(throw 'Get-AgentOperator:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentOperator:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentOperator $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.Operators.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.Operators[$name] + } + } + else + { $jobsrv.Operators } + +} #Get-AgentOperator + +####################### +function Get-AgentOperatorCategory +{ + param($jobserver=$(throw 'Get-AgentOperatorCategory:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentOperatorCategory:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentOperatorCategory $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.OperatorCategories.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.OperatorCategories[$name] + } + } + else + { $jobsrv.OperatorCategories } + +} #Get-AgentOperatorCategory + +####################### +function Get-AgentProxyAccount +{ + param($jobserver=$(throw 'Get-AgentProxyAccount:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentProxyAccount:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentProxyAccount $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.ProxyAccounts.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.ProxyAccounts[$name] + } + } + else + { $jobsrv.ProxyAccounts } + +} #Get-AgentProxyAccount + +####################### +function Get-AgentSchedule +{ + param($jobserver=$(throw 'Get-AgentJobSchedule:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentJobSchedule:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentJobSchedule $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.SharedSchedules.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.SharedSchedules[$name] + } + } + else + { $jobsrv.SharedSchedules } + +} #Get-AgentSchedule + +####################### +function Get-AgentTargetServerGroup +{ + param($jobserver=$(throw 'Get-AgentTargetServerGroup:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentTargetServerGroup:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentTargetServerGroup $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.TargetServerGroups.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.TargetServerGroups[$name] + } + } + else + { $jobsrv.TargetServerGroups } + +} #Get-AgentTargetServerGroup + +####################### +function Get-AgentTargetServer +{ + param($jobserver=$(throw 'Get-AgentTargetServer:`$jobserver is required'),[string]$name) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentTargetServer:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentTargetServer $($jobsrv.Name) $name" + + if ($name) + { if (!$jobsrv.TargetServers.Contains("$name")) {throw 'Check $name Name.'} + else { + $jobsrv.TargetServers[$name] + } + } + else + { $jobsrv.TargetServers } + +} #Get-AgentTargetServer + +####################### +function Set-AgentJobHistoryFilter +{ + param([string]$name,$endDate,$startDate,[string]$outCome) + + $jobHistoryFilter = New-Object Microsoft.SqlServer.Management.Smo.Agent.JobHistoryFilter + if ($name) { $jobHistoryFilter.JobName = $name } + if ($endDate) { $jobHistoryFilter.EndRunDate = [datetime]$endDate } + if ($startDate) { $jobHistoryFilter.StartRunDate = [datetime]$startDate } + #outComeTypes: Cancelled,Failed, InProgress, Retry, Succeeded, Unknow + if ($outcome) { $jobHistoryFilter.OutComeTypes = $outCome } + + return $jobHistoryFilter +} +####################### +function Get-AgentJobHistory +{ + param($jobserver=$(throw 'Get-AgentJobHistory:`$jobserver is required'),$jobHistoryFilter) + + switch ($jobserver.GetType().Name) + { + 'String' { $jobsrv = Get-AgentJobServer $jobserver } + 'JobServer' { $jobsrv = $jobserver } + default { throw 'Get-AgentJobHistory:Param `$jobserver must be a String or JobServer object.' } + } + + Write-Verbose "Get-AgentJobHistory $($jobsrv.Name)" + + if ($jobHistoryFilter) + { if ($jobHistoryFilter.GetType().Name -ne "JobHistoryFilter") {throw 'JobHistoryFilter must be a JobHistoryFilter object.'} + else { + $jobsrv.EnumJobHistory($jobHistoryFilter) + } + } + else + { $jobsrv.EnumJobHistory() } + +} #Get-AgentJobHistory + diff --git a/Library/LibraryRmo.ps1 b/Deprecated/Library/LibraryRmo.ps1 similarity index 96% rename from Library/LibraryRmo.ps1 rename to Deprecated/Library/LibraryRmo.ps1 index aec933d..25991a4 100644 --- a/Library/LibraryRmo.ps1 +++ b/Deprecated/Library/LibraryRmo.ps1 @@ -1,498 +1,498 @@ -# --------------------------------------------------------------------------- -### -# --------------------------------------------------------------------------- -[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") -[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.Common") > $null -[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.RMO") > $null - -####################### -function Get-SqlConnection -{ - param([string]$sqlserver=$(Throw 'Get-SqlConnection:`$sqlserver is required.'),[string]$Username,[string]$Password) - - Write-Verbose "Get-SqlConnection $sqlserver" - - if($Username -and $Password) - { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver,$Username,$Password } - else - { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver } - - $con.Connect() - - return $con - -} #Get-ServerConnection - -####################### -function Get-ReplServer -{ - param([string]$replServer=$(throw 'Get-ReplServer:`$replServer is required.'),[string]$Username,[string]$Password) - - $con = Get-SqlConnection $replServer $Username $Password - - Write-Verbose "Get-ReplServer $($con.ServerInstance)" - - $repl = new-object ("Microsoft.SqlServer.Replication.ReplicationServer") $con - - return $repl - -} #Get-ReplServer - -####################### -function Get-ReplLightPublication -{ - #The following note appears in documentaton about this class "supports the SQL Server 2005 infrastructure and is not intended to be used directly - #from your code. This is a bit a of problem as enumlightpublications() appears to be the only method to retrieve a list of publications from a - #ReplicationServer. So this method will be used by Get-ReplPublication. - param($replServer=$(throw 'Get-ReplLighPublication:`$replServer is required.')) - - switch ($replServer.GetType().Name) - { - 'String' { $repl = Get-ReplServer $replServer } - 'ReplicationServer' { $repl = $replServer } - default { throw 'Get-ReplLightPublication:Param `$replServer must be a String or ReplicationServer object.' } - } - - Write-Verbose "Get-ReplLightPublication $($repl.Name)" - - #(Name of database, [1 = trans, 2 = merge, 3 = all], return hetro, return empty tran) - $lightPub = $repl.enumlightpublications($null, 3, $true, $true) - $lightPub | add-Member -memberType noteProperty -name ConnectionContext -value $repl.ConnectionContext -passthru - -} #Get-ReplLightPublication - -####################### -function New-ReplTransPublication -{ - param([string]$name=$(throw 'Get-ReplTransPublication:`$name is required.'), - [string]$databaseName=$(throw 'Get-ReplTransPublication:`$databaseName is required.'), - $connectionContext=$(throw 'Get-ReplTransPublication:`$connectionContext is required.'),[switch]$createSnapshotAgent) - - Write-Verbose "New-ReplTransPublication $name" - - $pub = new-object ("Microsoft.SqlServer.Replication.TransPublication") $name,$databaseName,$connectionContext,$($createSnapshotAgent.IsPresent) - - return $pub - -} #New-ReplTransPublication - -####################### -function New-ReplMergePublication -{ - param([string]$name=$(throw 'Get-ReplMergePublication:`$name is required.'), - [string]$databaseName=$(throw 'Get-ReplMergePublication:`$databaseName is required.'), - $connectionContext=$(throw 'Get-ReplMergePublication:`$connectionContext is required.'),[switch]$createSnapshotAgent) - - Write-Verbose "New-ReplMergePublication $name" - - $pub = new-object ("Microsoft.SqlServer.Replication.MergePublication") $name,$databaseName,$connectionContext,$($createSnapshotAgent.IsPresent) - - return $pub - -} #New-ReplMergePublication - -####################### -function Get-ReplSubscriberSubscription -{ - #Note: This function is meant to be called on the subscriber. All other functions are called from the publisher/distributor - param($replServer=$(throw 'Get-ReplSubscriberSubscription:`$replServer is required.')) - - switch ($replServer.GetType().Name) - { - 'String' { $repl = Get-ReplServer $replServer } - 'ReplicationServer' { $repl = $replServer } - default { throw 'Get-ReplSubscriberSubscription:Param `$replServer must be a String or ReplicationServer object.' } - } - - Write-Verbose "Get-ReplSubscriberSubscription $($repl.Name)" - - $repl.EnumSubscriberSubscriptions($null,3) - -} #Get-ReplSubscriberSubscription - -####################### -function Get-ReplPublication -{ - param($replServer=$(throw 'Get-ReplPublication:`$replServer is required.')) - - switch ($replServer.GetType().Name) - { - 'String' { $repl = Get-ReplServer $replServer } - 'ReplicationServer' { $repl = $replServer } - default { throw 'Get-ReplPublication:Param `$replServer must be a String or ReplicationServer object.' } - } - - Write-Verbose "Get-ReplPublication $($repl.Name)" - - #Note: We are not creating a new publication, we are calling the respective Publication Constructor passing in - #an existing publication. - foreach ($lp in $(Get-ReplLightPublication $repl)) - { - switch ($lp.Type) - { - 'Transactional' { New-ReplTransPublication $lp.name $lp.PublicationDBName $lp.ConnectionContext } - 'Merge' { New-ReplMergePublication $lp.name $lp.PublicationDBName $lp.ConnectionContext } - } - } - -} #Get-Publication - -####################### -function Get-ReplSubscription -{ - #equivalent to executing sp_helpmergepublication or sp_helparticle - param($pub) - - process - { - Write-Verbose "Get-ReplSubscription $($_.Name)" - $p = $_ - switch ($p.Type) - { - 'Transactional' { $p.TransSubscriptions } - 'Merge' { $p.MergeSubscriptions } - default { throw 'Get-ReplSubscription:Param `$pub must be a Publication object.' } - } - } - end - { - if ($pub) - { $pub | Get-ReplSubscription } - } - -} #Get-ReplSubscription - -####################### -function Get-ReplArticle -{ - #equivalent to executing sp_helpmergepublication or sp_helparticle - param($pub) - - process - { - Write-Verbose "Get-ReplArticle $($_.Name)" - $a = $_ - switch ($a.Type) - { - 'Transactional' {$a.TransArticles } - 'Merge' {$a.MergeArticles } - default { throw 'Get-ReplArticle:Param `$pub must be a Publication object.' } - } - } - end - { - if ($pub) - { $pub | Get-ReplArticle } - } - -} #Get-ReplArticle - -####################### -function Get-ReplMonitor -{ - #There is a basic hierarchy with monitoring: - #ReplicationServer => PublisherMonitor => PublicationMonitor - param($replServer=$(throw 'Get-ReplMonitor:`$replServer is required')) - - switch ($replServer.GetType().Name) - { - 'String' { $con = Get-SqlConnection $replServer } - 'ServerConnection' { $con = $replServer } - default { throw 'Get-ReplMonitor:Param `$replServer must be a String or ServerConnection object.' } - } - - Write-Verbose "Get-ReplMonitor $($con.ServerInstance)" - - $replMon = new-object ("Microsoft.SqlServer.Replication.ReplicationMonitor") $con - - return $replMon - - -} #Get-ReplMonitor - -####################### -function Get-ReplPublisherMonitor -{ - param($replServer=$(throw 'Get-ReplPublisherMonitor:`$replServer is required')) - - Write-Verbose "Get-ReplPublisherMonitor" - - $replMon = Get-ReplMonitor $replServer - - return $replMon.PublisherMonitors - -} #Get-ReplPublisherMonitor - -####################### -function Get-ReplPublicationMonitor -{ - param($replServer=$(throw 'Get-ReplPublicationMonitor:`$replServer is required')) - - Write-Verbose "Get-ReplPublicationMonitor" - - $publisherMon = Get-ReplPublisherMonitor $replServer - - return $publisherMon.PublicationMonitors - -} #Get-ReplPublicationMonitor - -####################### -function Get-ReplEnumPublications -{ - param($publisherMon) - - process - { - if ($_.GetType().Name -eq 'PublisherMonitor') - { - Write-Verbose "Get-ReplEnumPublications $($_.Name) " - $_.EnumPublications() | foreach { $_.Tables} | foreach { $_.Rows } - } - else - { throw 'Get-ReplEnumPublications:Param `$publisherMon must be a PublisherMonitor object.' } - } - end - { - if ($publisherMon) - { $publisherMon | Get-ReplEnumPublications } - } - -} #Get-Get-ReplEnumPublications - -####################### -function Get-ReplEnumPublications2 -{ - #equivalent to executing sp_replmonitorhelppublication - #Only available for Microsoft SQL Server version 2005 or later - param($publisherMon) - - process - { - if ($_.GetType().Name -eq 'PublisherMonitor') - { - Write-Verbose "Get-ReplEnumPublications $($_.Name) " - $_.EnumPublications2() | foreach { $_.Tables} | foreach { $_.Rows } - } - else - { throw 'Get-ReplEnumPublications2:Param `$publisherMon must be a PublisherMonitor object.' } - } - end - { - if ($publisherMon) - { $publisherMon | Get-ReplEnumPublications2 } - } - -} #Get-Get-ReplEnumPublications2 - -####################### -function Get-ReplEnumSubscriptions -{ - param($pubMon) - - process - { - if ($_.GetType().Name -eq 'PublicationMonitor') - { - Write-Verbose "Get-ReplEnumSubscriptions $($_.Name)" - $_.EnumSubscriptions() | foreach { $_.Tables} | foreach { $_.Rows } - } - else - { throw 'Get-ReplEnumSubscriptions:Param `$pubMon must be a PublicationMonitor object.' } - } - end - { - if ($pubMon) - { $pubMon | Get-ReplEnumSubscriptions } - } - -} #Get-Get-ReplEnumSubscriptions - -####################### -function Get-ReplEnumSubscriptions2 -{ - #equivalent to executing sp_replmonitorhelpSubscription - #Only available for Microsoft SQL Server version 2005 or later - param($pubMon) - - process - { - if ($_.GetType().Name -eq 'PublicationMonitor') - { - Write-Verbose "Get-ReplEnumSubscriptions2 $($_.Name)" - $_.EnumSubscriptions2(0) | foreach { $_.Tables} | foreach { $_.Rows } - } - else - { throw 'Get-ReplEnumSubscriptions2:Param `$pubMon must be a PublicationMonitor object.' } - } - end - { - if ($pubMon) - { $pubMon | Get-ReplEnumSubscriptions2 } - } - -} #Get-Get-ReplEnumSubscriptions2 - -####################### -function Get-ReplTransPendingCommandInfo -{ - #equivalent to executing sp_replmonitorsubscriptionpendingcmds - #Only available for Microsoft SQL Server version 2005 or later - param($pubMon) - - process - { - if ($_.GetType().Name -eq 'PublicationMonitor') - { - Write-Verbose "Get-ReplTransPendingCommandInfo $($_.Name)" - $p = $_ - $p | Get-ReplEnumSubscriptions | foreach { $p.TransPendingCommandInfo($_.subscriber, $_.subscriber_db, $_.type) } - } - else - { throw 'Get-ReplTransPendingCommandInfo:Param `$pubMon must be a PublicationMonitor object.' } - - } - end - { - if ($pubMon) - { $pubMon | Get-TransPendingCommandInfo } - } - -} #Get-ReplTransPendingCommandInfo - -####################### -function Get-ReplEnumLogReaderAgent -{ - param($pubMon) - - process - { - if ($_.GetType().Name -eq 'PublicationMonitor') - { - Write-Verbose "Get-ReplEnumLogReaderAgent $($_.Name)" - $_.EnumLogReaderAgent() | foreach { $_.Tables} | foreach { $_.Rows } - } - else - { throw 'Get-ReplEnumLogReaderAgent:Param `$pubMon must be a PublicationMonitor object.' } - } - end - { - if ($pubMon) - { $pubMon | Get-ReplEnumLogReaderAgent } - } - -} #Get-Get-ReplEnumLogReaderAgent - -####################### -function Get-ReplEnumSnapshotAgent -{ - param($pubMon) - - process - { - if ($_.GetType().Name -eq 'PublicationMonitor') - { - Write-Verbose "Get-ReplEnumSnapshotAgent $($_.Name)" - $_.EnumSnapshotAgent() | foreach { $_.Tables} | foreach { $_.Rows } - } - else - { throw 'Get-ReplEnumSnapshotAgent:Param `$pubMon must be a PublicationMonitor object.' } - } - end - { - if ($pubMon) - { $pubMon | Get-ReplEnumSnapshotAgent } - } - -} #Get-Get-ReplEnumSnapshotAgent - -####################### -function Set-ReplScriptOptions -{ - param($optsFile="replscriptopts.txt") - - #There 35 settable scripting options at the time of this writing, rather than set the options as parameters - #I've choosen to set them through a separate file. Modify the passed in file to set - #the various scriptingOptions to your liking. See the following MSDN link for a description of the settable options: - #http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.replication.scriptoptions(SQL.90).aspx - #NOTE: UNLIKE SMO SCRIPTER CLASS, YOU MUST SET THE SCRIPTING OPTIONS IN RMO TO AT LEAST CREATION - Write-Verbose "Set-ReplScriptOptions $optsFile" - - $ScriptOpts = @() - if (test-path $scriptRoot\$optsFile) - { - $include = [System.IO.File]::ReadAllText("$scriptRoot\$optsFile") - invoke-expression $include - } - elseif (test-path $optsFile) - { - $include = [System.IO.File]::ReadAllText("$optsFile") - invoke-expression $include - } - - return $scriptOpts - -} #Set-ReplScriptOptions - -####################### -function Get-ReplScript -{ - param($rmo, $scriptOpts=$(Set-ReplScriptOptions)) - begin - { - function Select-ReplScript ($rmo, $scriptOpts=$(Set-ReplScriptOptions)) - { - $rmo.Script($scriptOpts) - - } #Select-ReplScript - } - process - { - if ($_) - { - if ($_.GetType().Namespace -like "Microsoft.SqlServer.Replication*") - { Write-Verbose "Get-ReplScript $($_.Name)" - Select-ReplScript $_ $scriptOpts } - else - { throw 'Get-ReplScript:Param `$rmo must be an rmo object.' } - - } - } - end - { - if ($rmo) - { $rmo | Get-ReplScript -scriptOpts $scriptOpts } - } - -} #Get-ReplScript +# --------------------------------------------------------------------------- +### +# --------------------------------------------------------------------------- +[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") +[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.Common") > $null +[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.RMO") > $null + +####################### +function Get-SqlConnection +{ + param([string]$sqlserver=$(Throw 'Get-SqlConnection:`$sqlserver is required.'),[string]$Username,[string]$Password) + + Write-Verbose "Get-SqlConnection $sqlserver" + + if($Username -and $Password) + { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver,$Username,$Password } + else + { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver } + + $con.Connect() + + return $con + +} #Get-ServerConnection + +####################### +function Get-ReplServer +{ + param([string]$replServer=$(throw 'Get-ReplServer:`$replServer is required.'),[string]$Username,[string]$Password) + + $con = Get-SqlConnection $replServer $Username $Password + + Write-Verbose "Get-ReplServer $($con.ServerInstance)" + + $repl = new-object ("Microsoft.SqlServer.Replication.ReplicationServer") $con + + return $repl + +} #Get-ReplServer + +####################### +function Get-ReplLightPublication +{ + #The following note appears in documentaton about this class "supports the SQL Server 2005 infrastructure and is not intended to be used directly + #from your code. This is a bit a of problem as enumlightpublications() appears to be the only method to retrieve a list of publications from a + #ReplicationServer. So this method will be used by Get-ReplPublication. + param($replServer=$(throw 'Get-ReplLighPublication:`$replServer is required.')) + + switch ($replServer.GetType().Name) + { + 'String' { $repl = Get-ReplServer $replServer } + 'ReplicationServer' { $repl = $replServer } + default { throw 'Get-ReplLightPublication:Param `$replServer must be a String or ReplicationServer object.' } + } + + Write-Verbose "Get-ReplLightPublication $($repl.Name)" + + #(Name of database, [1 = trans, 2 = merge, 3 = all], return hetro, return empty tran) + $lightPub = $repl.enumlightpublications($null, 3, $true, $true) + $lightPub | add-Member -memberType noteProperty -name ConnectionContext -value $repl.ConnectionContext -passthru + +} #Get-ReplLightPublication + +####################### +function New-ReplTransPublication +{ + param([string]$name=$(throw 'Get-ReplTransPublication:`$name is required.'), + [string]$databaseName=$(throw 'Get-ReplTransPublication:`$databaseName is required.'), + $connectionContext=$(throw 'Get-ReplTransPublication:`$connectionContext is required.'),[switch]$createSnapshotAgent) + + Write-Verbose "New-ReplTransPublication $name" + + $pub = new-object ("Microsoft.SqlServer.Replication.TransPublication") $name,$databaseName,$connectionContext,$($createSnapshotAgent.IsPresent) + + return $pub + +} #New-ReplTransPublication + +####################### +function New-ReplMergePublication +{ + param([string]$name=$(throw 'Get-ReplMergePublication:`$name is required.'), + [string]$databaseName=$(throw 'Get-ReplMergePublication:`$databaseName is required.'), + $connectionContext=$(throw 'Get-ReplMergePublication:`$connectionContext is required.'),[switch]$createSnapshotAgent) + + Write-Verbose "New-ReplMergePublication $name" + + $pub = new-object ("Microsoft.SqlServer.Replication.MergePublication") $name,$databaseName,$connectionContext,$($createSnapshotAgent.IsPresent) + + return $pub + +} #New-ReplMergePublication + +####################### +function Get-ReplSubscriberSubscription +{ + #Note: This function is meant to be called on the subscriber. All other functions are called from the publisher/distributor + param($replServer=$(throw 'Get-ReplSubscriberSubscription:`$replServer is required.')) + + switch ($replServer.GetType().Name) + { + 'String' { $repl = Get-ReplServer $replServer } + 'ReplicationServer' { $repl = $replServer } + default { throw 'Get-ReplSubscriberSubscription:Param `$replServer must be a String or ReplicationServer object.' } + } + + Write-Verbose "Get-ReplSubscriberSubscription $($repl.Name)" + + $repl.EnumSubscriberSubscriptions($null,3) + +} #Get-ReplSubscriberSubscription + +####################### +function Get-ReplPublication +{ + param($replServer=$(throw 'Get-ReplPublication:`$replServer is required.')) + + switch ($replServer.GetType().Name) + { + 'String' { $repl = Get-ReplServer $replServer } + 'ReplicationServer' { $repl = $replServer } + default { throw 'Get-ReplPublication:Param `$replServer must be a String or ReplicationServer object.' } + } + + Write-Verbose "Get-ReplPublication $($repl.Name)" + + #Note: We are not creating a new publication, we are calling the respective Publication Constructor passing in + #an existing publication. + foreach ($lp in $(Get-ReplLightPublication $repl)) + { + switch ($lp.Type) + { + 'Transactional' { New-ReplTransPublication $lp.name $lp.PublicationDBName $lp.ConnectionContext } + 'Merge' { New-ReplMergePublication $lp.name $lp.PublicationDBName $lp.ConnectionContext } + } + } + +} #Get-Publication + +####################### +function Get-ReplSubscription +{ + #equivalent to executing sp_helpmergepublication or sp_helparticle + param($pub) + + process + { + Write-Verbose "Get-ReplSubscription $($_.Name)" + $p = $_ + switch ($p.Type) + { + 'Transactional' { $p.TransSubscriptions } + 'Merge' { $p.MergeSubscriptions } + default { throw 'Get-ReplSubscription:Param `$pub must be a Publication object.' } + } + } + end + { + if ($pub) + { $pub | Get-ReplSubscription } + } + +} #Get-ReplSubscription + +####################### +function Get-ReplArticle +{ + #equivalent to executing sp_helpmergepublication or sp_helparticle + param($pub) + + process + { + Write-Verbose "Get-ReplArticle $($_.Name)" + $a = $_ + switch ($a.Type) + { + 'Transactional' {$a.TransArticles } + 'Merge' {$a.MergeArticles } + default { throw 'Get-ReplArticle:Param `$pub must be a Publication object.' } + } + } + end + { + if ($pub) + { $pub | Get-ReplArticle } + } + +} #Get-ReplArticle + +####################### +function Get-ReplMonitor +{ + #There is a basic hierarchy with monitoring: + #ReplicationServer => PublisherMonitor => PublicationMonitor + param($replServer=$(throw 'Get-ReplMonitor:`$replServer is required')) + + switch ($replServer.GetType().Name) + { + 'String' { $con = Get-SqlConnection $replServer } + 'ServerConnection' { $con = $replServer } + default { throw 'Get-ReplMonitor:Param `$replServer must be a String or ServerConnection object.' } + } + + Write-Verbose "Get-ReplMonitor $($con.ServerInstance)" + + $replMon = new-object ("Microsoft.SqlServer.Replication.ReplicationMonitor") $con + + return $replMon + + +} #Get-ReplMonitor + +####################### +function Get-ReplPublisherMonitor +{ + param($replServer=$(throw 'Get-ReplPublisherMonitor:`$replServer is required')) + + Write-Verbose "Get-ReplPublisherMonitor" + + $replMon = Get-ReplMonitor $replServer + + return $replMon.PublisherMonitors + +} #Get-ReplPublisherMonitor + +####################### +function Get-ReplPublicationMonitor +{ + param($replServer=$(throw 'Get-ReplPublicationMonitor:`$replServer is required')) + + Write-Verbose "Get-ReplPublicationMonitor" + + $publisherMon = Get-ReplPublisherMonitor $replServer + + return $publisherMon.PublicationMonitors + +} #Get-ReplPublicationMonitor + +####################### +function Get-ReplEnumPublications +{ + param($publisherMon) + + process + { + if ($_.GetType().Name -eq 'PublisherMonitor') + { + Write-Verbose "Get-ReplEnumPublications $($_.Name) " + $_.EnumPublications() | foreach { $_.Tables} | foreach { $_.Rows } + } + else + { throw 'Get-ReplEnumPublications:Param `$publisherMon must be a PublisherMonitor object.' } + } + end + { + if ($publisherMon) + { $publisherMon | Get-ReplEnumPublications } + } + +} #Get-Get-ReplEnumPublications + +####################### +function Get-ReplEnumPublications2 +{ + #equivalent to executing sp_replmonitorhelppublication + #Only available for Microsoft SQL Server version 2005 or later + param($publisherMon) + + process + { + if ($_.GetType().Name -eq 'PublisherMonitor') + { + Write-Verbose "Get-ReplEnumPublications $($_.Name) " + $_.EnumPublications2() | foreach { $_.Tables} | foreach { $_.Rows } + } + else + { throw 'Get-ReplEnumPublications2:Param `$publisherMon must be a PublisherMonitor object.' } + } + end + { + if ($publisherMon) + { $publisherMon | Get-ReplEnumPublications2 } + } + +} #Get-Get-ReplEnumPublications2 + +####################### +function Get-ReplEnumSubscriptions +{ + param($pubMon) + + process + { + if ($_.GetType().Name -eq 'PublicationMonitor') + { + Write-Verbose "Get-ReplEnumSubscriptions $($_.Name)" + $_.EnumSubscriptions() | foreach { $_.Tables} | foreach { $_.Rows } + } + else + { throw 'Get-ReplEnumSubscriptions:Param `$pubMon must be a PublicationMonitor object.' } + } + end + { + if ($pubMon) + { $pubMon | Get-ReplEnumSubscriptions } + } + +} #Get-Get-ReplEnumSubscriptions + +####################### +function Get-ReplEnumSubscriptions2 +{ + #equivalent to executing sp_replmonitorhelpSubscription + #Only available for Microsoft SQL Server version 2005 or later + param($pubMon) + + process + { + if ($_.GetType().Name -eq 'PublicationMonitor') + { + Write-Verbose "Get-ReplEnumSubscriptions2 $($_.Name)" + $_.EnumSubscriptions2(0) | foreach { $_.Tables} | foreach { $_.Rows } + } + else + { throw 'Get-ReplEnumSubscriptions2:Param `$pubMon must be a PublicationMonitor object.' } + } + end + { + if ($pubMon) + { $pubMon | Get-ReplEnumSubscriptions2 } + } + +} #Get-Get-ReplEnumSubscriptions2 + +####################### +function Get-ReplTransPendingCommandInfo +{ + #equivalent to executing sp_replmonitorsubscriptionpendingcmds + #Only available for Microsoft SQL Server version 2005 or later + param($pubMon) + + process + { + if ($_.GetType().Name -eq 'PublicationMonitor') + { + Write-Verbose "Get-ReplTransPendingCommandInfo $($_.Name)" + $p = $_ + $p | Get-ReplEnumSubscriptions | foreach { $p.TransPendingCommandInfo($_.subscriber, $_.subscriber_db, $_.type) } + } + else + { throw 'Get-ReplTransPendingCommandInfo:Param `$pubMon must be a PublicationMonitor object.' } + + } + end + { + if ($pubMon) + { $pubMon | Get-TransPendingCommandInfo } + } + +} #Get-ReplTransPendingCommandInfo + +####################### +function Get-ReplEnumLogReaderAgent +{ + param($pubMon) + + process + { + if ($_.GetType().Name -eq 'PublicationMonitor') + { + Write-Verbose "Get-ReplEnumLogReaderAgent $($_.Name)" + $_.EnumLogReaderAgent() | foreach { $_.Tables} | foreach { $_.Rows } + } + else + { throw 'Get-ReplEnumLogReaderAgent:Param `$pubMon must be a PublicationMonitor object.' } + } + end + { + if ($pubMon) + { $pubMon | Get-ReplEnumLogReaderAgent } + } + +} #Get-Get-ReplEnumLogReaderAgent + +####################### +function Get-ReplEnumSnapshotAgent +{ + param($pubMon) + + process + { + if ($_.GetType().Name -eq 'PublicationMonitor') + { + Write-Verbose "Get-ReplEnumSnapshotAgent $($_.Name)" + $_.EnumSnapshotAgent() | foreach { $_.Tables} | foreach { $_.Rows } + } + else + { throw 'Get-ReplEnumSnapshotAgent:Param `$pubMon must be a PublicationMonitor object.' } + } + end + { + if ($pubMon) + { $pubMon | Get-ReplEnumSnapshotAgent } + } + +} #Get-Get-ReplEnumSnapshotAgent + +####################### +function Set-ReplScriptOptions +{ + param($optsFile="replscriptopts.txt") + + #There 35 settable scripting options at the time of this writing, rather than set the options as parameters + #I've choosen to set them through a separate file. Modify the passed in file to set + #the various scriptingOptions to your liking. See the following MSDN link for a description of the settable options: + #http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.replication.scriptoptions(SQL.90).aspx + #NOTE: UNLIKE SMO SCRIPTER CLASS, YOU MUST SET THE SCRIPTING OPTIONS IN RMO TO AT LEAST CREATION + Write-Verbose "Set-ReplScriptOptions $optsFile" + + $ScriptOpts = @() + if (test-path $scriptRoot\$optsFile) + { + $include = [System.IO.File]::ReadAllText("$scriptRoot\$optsFile") + invoke-expression $include + } + elseif (test-path $optsFile) + { + $include = [System.IO.File]::ReadAllText("$optsFile") + invoke-expression $include + } + + return $scriptOpts + +} #Set-ReplScriptOptions + +####################### +function Get-ReplScript +{ + param($rmo, $scriptOpts=$(Set-ReplScriptOptions)) + begin + { + function Select-ReplScript ($rmo, $scriptOpts=$(Set-ReplScriptOptions)) + { + $rmo.Script($scriptOpts) + + } #Select-ReplScript + } + process + { + if ($_) + { + if ($_.GetType().Namespace -like "Microsoft.SqlServer.Replication*") + { Write-Verbose "Get-ReplScript $($_.Name)" + Select-ReplScript $_ $scriptOpts } + else + { throw 'Get-ReplScript:Param `$rmo must be an rmo object.' } + + } + } + end + { + if ($rmo) + { $rmo | Get-ReplScript -scriptOpts $scriptOpts } + } + +} #Get-ReplScript diff --git a/Library/LibrarySSIS.ps1 b/Deprecated/Library/LibrarySSIS.ps1 similarity index 97% rename from Library/LibrarySSIS.ps1 rename to Deprecated/Library/LibrarySSIS.ps1 index b648bb3..3916b32 100644 --- a/Library/LibrarySSIS.ps1 +++ b/Deprecated/Library/LibrarySSIS.ps1 @@ -1,624 +1,624 @@ -# --------------------------------------------------------------------------- -### -# --------------------------------------------------------------------------- -[reflection.assembly]::Load("Microsoft.SqlServer.ManagedDTS, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91") > $null -#[Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll") > $null -#[reflection.assembly]::Load("Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91") > $null -#[Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll") > $null -#[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ManagedDTS") > $null - -####################### -function New-ISApplication -{ - Write-Verbose "New-ISApplication" - - new-object ("Microsoft.SqlServer.Dts.Runtime.Application") - -} #New-ISApplication - - -####################### -function Copy-ISItemSQLToSQL -{ - param([string]$path, [string]$topLevelFolder, [string]$serverName, - [string]$destination, [string]$destinationServer, [switch]$recurse, - [string]$include="*", [string]$exclude=$null, [switch]$whatIf, [switch]$force, $connectionInfo) - - #If destinationServer contains instance i.e. server\instance, convert to just servername: - $destinationServer = $destinationserver -replace "\\.*" - -Write-Verbose "Copy-ISItemSQLToSQL path:$path serverName:$serverName destination:$destination destinationServer:$destinationServer recurse:$($recurse.IsPresent) include:$include exclude:$exclude whatIf:$($whatIf.IsPresent)" - - $literalPath = $($topLevelFolder + "\" + $path) -replace "\\\\","\" - Write-Verbose "literalPath:$literalPath" - - if (Test-ISPath $literalPath $serverName 'Package') - { - if ($whatIf) - { Write-Host "What if:Set-ISPackage $literalPath $destination $destinationServer $($force.IsPresent)" } - else - { - $package = Get-ISPackage $literalPath $serverName - if ($package) - { - if ($connectionInfo) - { Set-ISConnectionString $package $connectionInfo } - if ($force) - { Set-ISPackage -package $package -path $destination -serverName $destinationServer -force } - else - { Set-ISPackage -package $package -path $destination -serverName $destinationServer } - } - } - } - elseif (Test-ISPath $literalPath $serverName 'Folder') - { - if ($recurse) - { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -recurse $include $exclude } - else - { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -include $include -exclude $exclude } - - $count = $pInfos | Measure-Object | Select Count - foreach ($pInfo in $pInfos) - { - $i++ - $folder = $($destination + $pInfo.Folder) - Write-Verbose "folder:$folder" - - if ($pInfo.Flags -eq 'Folder') - { - $testPath = $($folder + "\" -replace "\\$") + $pInfo.Name - Write-Verbose "testPath:$testPath" - if (!(Test-ISPath $testPath $destinationServer 'Folder')) - { - if ($whatIf) - { Write-Host "What if:New-ISItem $Folder $($pInfo.Name) $destinationServer" } - else - { - Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) - New-ISItem $Folder $pInfo.Name $destinationServer - } - } - } - elseif ($pInfo.Flags -eq 'Package') - { - $destPath = $($folder + "\" -replace "\\\\","\") + $pInfo.Name - if ($whatIf) - { Write-Host "What if:Set-ISPackage -package $($pInfo.Name) -path $destPath -serverName $destinationServer -force $($force.IsPresent)" } - else - { - $package = Get-ISPackage $pInfo.literalPath $serverName - if ($package) - { - Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) - if ($connectionInfo) - { Set-ISConnectionString $package $connectionInfo } - if ($force) - { Set-ISPackage -package $package -path $destPath -serverName $destinationServer -force } - else - { Set-ISPackage -package $package -path $destPath -serverName $destinationServer } - } - } - } - } - } - else - { throw "Package $path does not exist on server $serverName" } - -} #Copy-ISItemSQLToSQL - -####################### -function Copy-ISItemSQLToFile -{ - param([string]$path, [string]$topLevelFolder, [string]$serverName, [string]$destination, - [switch]$recurse, [string]$include="*", [string]$exclude=$null, [switch]$whatIf, [switch]$force, $connectionInfo) - -Write-Verbose "Copy-ISItemSQLToFile path:$path serverName:$serverName destination:$destination recurse:$($recurse.IsPresent) include:$include exclude:$exclude whatIf:$($whatIf.IsPresent)" - - $literalPath = $($topLevelFolder + "\" + $path) -replace "\\\\","\" - Write-Verbose "literalPath:$literalPath" - - if (Test-ISPath $literalPath $serverName 'Package') - { - if ($whatIf) - { Write-Host "What if:Set-ISPackage $($package.Name) $destination $($force.IsPresent)" } - else - { - $package = Get-ISPackage $literalPath $serverName - if ($package) - { - if ($connectionInfo) - { Set-ISConnectionString $package $connectionInfo } - if ($force) - { Set-ISPackage -package $package -path $destination -force } - else - { Set-ISPackage -package $package -path $destination } - } - } - } - elseif (Test-ISPath $literalPath $serverName 'Folder') - { - if ($recurse) - { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -recurse $include $exclude } - else - { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -include $include -exclude $exclude } - - $count = $pInfos | Measure-Object | Select Count - foreach ($pInfo in $pInfos) - { - $i++ - $folder = $($destination + $pInfo.Folder) -replace "\\\\","\" - Write-Verbose "folder:$folder" - - if ($pInfo.Flags -eq 'Folder') - { - $testPath = $($folder + "\" + $pInfo.Name) -replace "\\\\","\" - Write-Verbose "testPath:$testPath" - if (!(Test-Path -literalPath $testPath)) - { - if ($whatIf) - { Write-Host "What if:New-Item -path $Folder -name $($pInfo.Name) -ltype directory" } - else - { - Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) - New-Item -path $Folder -name $pInfo.Name -type directory - } - } - } - elseif ($pInfo.Flags -eq 'Package') - { - $destPath = $($folder + "\" + $pInfo.Name + ".dtsx") -replace "\\\\","\" - if ($whatIf) - { Write-Host "What if:Set-ISPackage -package $($pInfo.Name) -path $destPath -force $($force.IsPresent)" } - else - { - $package = Get-ISPackage $pInfo.literalPath $serverName - if ($package) - { - Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) - if ($connectionInfo) - { Set-ISConnectionString $package $connectionInfo } - if ($force) - { Set-ISPackage -package $package -path $destPath -force } - else - { Set-ISPackage -package $package -path $destPath } - } - } - } - } - } - else - { throw "Package $path does not exist on server $serverName" } - -} #Copy-ISItemSQLToFile - -####################### -function Copy-ISItemFileToSQL -{ - param([string]$path, [string]$destination, - [string]$destinationServer, [switch]$recurse, - [string]$include="*", [string]$exclude=$null, [switch]$whatIf, [switch]$force, $connectionInfo) - - #If destinationServer contains instance i.e. server\instance, convert to just servername: - $destinationServer = $destinationserver -replace "\\.*" - - Write-Verbose "Copy-ISItemFileToSQL path:$path destination:$destination destinationServer$desinationServer recurse:$($recurse.IsPresent) include:$include exclude:$exclude whatIf:$($whatIf.IsPresent)" - - ####################### - function Copy-ISChildItemFileToSQL - { - param($item, [string]$path, [string]$destination, [string]$destinationServer, [switch]$force, $connectionInfo) - $parentPath = Split-Path $item.FullName -parent | Split-Path -leaf - $itemPath = $parentPath -replace "$([system.io.path]::getpathroot($item.FullName) -replace '\\','\\')" - Write-Verbose "itemPath:$itemPath" - $folder = $destination - Write-Verbose "folder:$folder" - - if ($item.PSIsContainer) - { - $testPath = $($folder + "\" + $item.Name) -replace "\\\\","\" - Write-Verbose "testPath:$testPath" - if (!(Test-ISPath $testPath $destinationServer 'Folder')) - { - if ($whatIf) - { Write-Host "What if:New-ISItem $Folder $item.Name $destinationServer" } - else - { New-ISItem $Folder $item.Name $destinationServer } - } - } - else - { - $destPath = $($folder + "\" + $item.BaseName) -replace "\\\\","\" - if ($whatIf) - { Write-Host "What if:Set-ISPackage $($package.Name) $folder" } - else - { - $package = Get-ISPackage $item.FullName - if ($package) - { - if ($connectionInfo) - { Set-ISConnectionString $package $connectionInfo } - if ($force) - { Set-ISPackage -package $package -path $destPath -serverName $destinationServer -force } - else - { Set-ISPackage -package $package -path $destPath -serverName $destinationServer } - } - } - } - - } #Copy-ISChildItemFileToSQL - - if (Test-Path $path) - { - if ($recurse) - { - $items = Get-ChildItem -path $path -include $include -exclude $exclude -recurse - $count = $items | Measure-Object | Select Count - foreach ($item in $items) - { - $i++ - Write-Progress -activity "Copying Items..." -status "Copying $($item.Name)" -percentcomplete ($i/$count.count*100) - if ($force) - { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -force -connectionInfo $connectionInfo } - else - { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -connectionInfo $connectionInfo } - } - } - else - { - $items = Get-ChildItem -path $path -include $include -exclude $exclude - $count = $items | Measure-Object | Select Count - foreach ($item in $items) - { - $i++ - Write-Progress -activity "Copying Items..." -status "Copying $($item.Name)" -percentcomplete ($i/$count.count*100) - if ($force) - { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -force -connectionInfo $connectionInfo } - else - { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -connectionInfo $connectionInfo } - } - } - } - else - { throw "Package $path does not exist" } - -} #Copy-ISItemFileToSQL - -####################### -function Get-ISItem -{ - param([string]$path="\", [string]$topLevelFolder, [string]$serverName=$(throw 'serverName is required.'), - [switch]$recurse, [string]$include="*", [string]$exclude=$null) - - Write-Verbose "Get-ISItem path:$path topLevelFolder:$topLevelFolder serverName:$serverName recurse:$($recurse.IsPresent) include:$include exclude:$exclude" - - #Note: Unlike SSMS, specify an instance name. There are some inconsistencies in the implementation of methods in the Application class - #GetPackagesInfos unlike every other method expects a SQL instance as the server name while the other methods expect an Integration Services server. - #This inconsistency applies to folder as well path where GetPackagesInfo defaults to the TopLevelFolders path defined in MsDtsSrvr.ini.xml and the - #other methods expect you to fully qualify the path with the TopLevelFolder name. There does not appear to be programatic way to determine the - #TopLevelFolders which seems odd given that SSMS shows the top level folders. To workaround the TopLevelFolder issue we will pass the value as parameter - - $app = New-ISApplication - - if ($recurse) - { - foreach ($pInfo in $app.GetPackageInfos($path, $serverName, $null, $null)) - { - if ($pInfo.Name -like $include -and $pInfo.Name -notlike $exclude) - { - $literalPath = $($topLevelFolder + $pInfo.Folder + "\" + $pInfo.Name) -replace "\\\\","\" - $pInfo | add-Member -memberType noteProperty -name serverName -value $serverName -passthru | - add-Member -memberType noteProperty -name topLevelFolder -value $topLevelFolder -passthru | - add-Member -memberType noteProperty -name literalPath -value $literalPath -passthru - - if ($pInfo.flags -eq 'Folder') - { $childItem = $($pInfo.Folder + "\" + $pInfo.Name) -replace "\\\\","\" - Get-ISItem $childItem $topLevelFolder $serverName -recurse $include $exclude } - } - } - } - else - { - foreach ($pInfo in $app.GetPackageInfos($path, $serverName, $null, $null)) - { - if ($pInfo.Name -like $include -and $pInfo.Name -notlike $exclude) - { - $literalPath = $($topLevelFolder + $pInfo.Folder + "\" + $pInfo.Name) -replace "\\\\","\" - $pInfo | add-Member -memberType noteProperty -name serverName -value $serverName -passthru | - add-Member -memberType noteProperty -name topLevelFolder -value $topLevelFolder -passthru | - add-Member -memberType noteProperty -name literalPath -value $literalPath -passthru - } - } - } - -} #Get-ISItem - -####################### -function Test-ISPath -{ - param([string]$path=$(throw 'path is required.'), [string]$serverName=$(throw 'serverName is required.'), [string]$pathType='Any') - - #If serverName contains instance i.e. server\instance, convert to just servername: - $serverName = $serverName -replace "\\.*" - - Write-Verbose "Test-ISPath path:$path serverName:$serverName pathType:$pathType" - - #Note: Don't specify instance name - - $app = New-ISApplication - - switch ($pathType) - { - 'Package' { trap { $false; continue } $app.ExistsOnDtsServer($path,$serverName) } - 'Folder' { trap { $false; continue } $app.FolderExistsOnDtsServer($path,$serverName) } - 'Any' { $p=Test-ISPath $path $serverName 'Package'; $f=Test-ISPath $path $serverName 'Folder'; [bool]$($p -bor $f)} - default { throw 'pathType must be Package, Folder, or Any' } - } - -} #Test-ISPath - -####################### -function New-ISItem -{ - param([string]$path=$(throw 'path is required.'), [string]$value=$(throw 'value is required.'), [string]$serverName=$(throw 'serverName is required.')) - - #If serverName contains instance i.e. server\instance, convert to just servername: - $serverName = $serverName -replace "\\.*" - - Write-Verbose "New-ISItem path:$path value:$value serverName:$serverName" - - $app = New-ISApplication - - $testPath = $($path + "\" + $value) -replace "\\\\","\" - - if (!(Test-ISPath $testPath $serverName 'Folder')) - { $app.CreateFolderOnDtsServer($path, $value, $serverName) } - else - { throw "Path $testPath already exists!" } - -} #New-ISItem - -####################### -function Rename-ISItem -{ - param([string]$path=$(throw 'path is required.'), [string]$oldName=$(throw 'oldName is required.'), - [string]$newName=$(throw 'newName is required.'), [string]$serverName=$(throw 'serverName is required.')) - - #If serverName contains instance i.e. server\instance, convert to just servername: - $serverName = $serverName -replace "\\.*" - - Write-Verbose "Rename-ISItem path:$path oldName:$oldName newName:$newName serverName:$serverName" - - $app = New-ISApplication - - $testPath = $($path + "\" + $oldName) -replace "\\\\","\" - - if (Test-ISPath $testPath $serverName 'Folder') - { $app.RenameFolderOnDtsServer($path, $oldName, $newName, $serverName) } - else - { throw "Path $testPath does not exist" } - -} #Rename-ISItem - -####################### -function Remove-ISItem -{ - param($pInfo, [switch]$whatIf) - begin - { - ####################### - function Remove-ISChildItem - { - param($pInfo, [switch]$whatIf) - - $app = New-ISApplication - #If serverName contains instance i.e. server\instance, convert to just servername: - $serverName = $pInfo.serverName -replace "\\.*" - switch ($pInfo.Flags) - { - 'Package' { - if (Test-ISPath $pInfo.literalPath $serverName 'Package') - { - if ($whatIf) - { Write-Host "What if:RemoveFromDtsServer($($pInfo.literalPath),$serverName)" } - else - { $app.RemoveFromDtsServer($pInfo.literalPath,$serverName) } - } - else - { throw "Package $($pInfo.literalPath) does not exist on server $serverName" } - } - 'Folder' { - if (Test-ISPath $pInfo.literalPath $serverName 'Folder') - { - if ($whatIf) - { Write-Host "What if:RemoveFolderFromDtsServer($($pInfo.literalPath),$serverName)" } - else - { $app.RemoveFolderFromDtsServer($pInfo.literalPath,$serverName) } - } - else - { throw "Folder $($pInfo.literalPath) does not exist on server $serverName" } - } - } - } #Remove-ISChildItem - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'PackageInfo') - { - Write-Verbose "Remove-ISChildItem $($_.literalPath) $($whatIf.IsPresent)" - if ($whatif) - { Remove-ISChildItem $_ -whatIf } - else - { Remove-ISChildItem $_ } - } - else - { throw 'Remove-ISChildItem:Param pInfo must be a PackageInfo object.' } - } - } - end - { - if ($pInfo) - { - if ($whatIf) - { $pInfo | Remove-ISChildItem -whatIf } - else - { $pInfo | Remove-ISChildItem } - } - } - -} #Remove-ISItem - -####################### -function Get-ISPackage -{ - param([string]$path, [string]$serverName) - - #If serverName contains instance i.e. server\instance, convert to just servername: - $serverName = $serverName -replace "\\.*" - - Write-Verbose "Get-ISPackage path:$path serverName:$serverName" - - $app = New-ISApplication - - #SQL Server Store - if ($path -and $serverName) - { - if (Test-ISPath $path $serverName 'Package') - { $app.LoadFromDtsServer($path, $serverName, $null) } - else - { Write-Error "Package $path does not exist on server $serverName" } - } - #File Store - elseif ($path -and !$serverName) - { - if (Test-Path -literalPath $path) - { $app.LoadPackage($path, $null) } - else - { Write-Error "Package $path does not exist" } - } - else - { throw 'You must specify a file path or package store path and server name' } - -} #Get-ISPackage - -####################### -function Set-ISPackage -{ - param($package=$(throw 'package is required.'), [string]$path, [string]$serverName, [switch]$force) - - #If serverName contains instance i.e. server\instance, convert to just servername: - $serverName = $serverName -replace "\\.*" - - Write-Verbose "Set-ISPackage package:$($package.Name) path:$path serverName:$serverName" - - $app = New-ISApplication - - #SQL Server Store - if ($path -and $serverName) - { - if (!(Test-ISPath $path $serverName 'Package') -or $($force)) - { $app.SaveToDtsServer($package, $null, $path, $serverName) } - else - { throw "Package $path already exists on server $serverName" } - } - #File Store - elseif ($path -and !$serverName) - { - if (!(Test-Path -literalPath $path) -or $($force)) - { $app.SaveToXml($path, $package, $null) } - else - { throw "Package $path already exists" } - } - else - { throw 'You must specify a file path or package store path and server name' } - -} #Set-ISPackage - -####################### -function Get-ISRunningPackage -{ - param($serverName=$(throw 'serverName is required.')) - - #If serverName contains instance i.e. server\instance, convert to just servername: - $serverName = $serverName -replace "\\.*" - - Write-Verbose "Get-ISRunningPackage serverName:$serverName" - - $app = New-ISApplication - - $app.GetRunningPackages($serverName) - -} #Get-ISRunningPackage - -####################### -function Set-ISConnectionString -{ - param($package=$(throw 'package is required.'), $connectionInfo=$(throw 'value is required.')) - - Write-Verbose "Set-ISConnectionString" - - foreach ($i in $connectionInfo.GetEnumerator()) - { - $name = $($i.Key); $value = $($i.Value); - Write-Verbose "Set-ISConnectionString name:$name value:$value " - $connectionManager = $package.connections | where {$_.Name -eq "$name"} - Write-Verbose "Set-ISConnectionString connString1:$($connectionManager.ConnectionString)" - if ($connectionManager) - { - $connString = $connectionManager.ConnectionString - Write-Verbose "Set-ISConnectionString connString:$connString" - $connString -match "^Data Source=(?[^;]+);" > $null - $newConnString = $connString -replace $($matches.server -replace "\\","\\"),$value - Write-Verbose "Set-ISConnectionString newConnString:$newConnString" - if ($newConnString) - { $connectionManager.ConnectionString = $newConnString } - } - } - -} #Set-ISConnectionString - -####################### -function Get-ISData -{ - param([string]$serverName=$(throw 'serverName is required.'), [string]$databaseName=$(throw 'databaseName is required.'), - [string]$query=$(throw 'query is required.')) - - Write-Verbose "Get-ISData serverName:$serverName databaseName:$databaseName query:$query" - - $connString = "Server=$serverName;Database=$databaseName;Integrated Security=SSPI;" - $da = New-Object "System.Data.SqlClient.SqlDataAdapter" ($query,$connString) - $dt = New-Object "System.Data.DataTable" - $da.fill($dt) > $null - $dt - -} #Get-ISData - -####################### -function Get-ISSqlConfigurationItem -{ - param($serverName, $databaseName, [string]$configurationTable=$(throw 'configurationTable is required.'), - [string]$configurationFilter=$(throw 'configurationFilter is required.'), [string]$packagePath=$(throw 'packagePath is required.')) - -Write-Verbose "Get-ISSqlConfigurationItem serverName:$serverName db:$databaseName table:$configurationTable filer:$configurationFilter path:$packagePath query:$query" - -$query = @" -Select ConfiguredValue FROM $configurationTable - WHERE ConfigurationFilter = '$configurationFilter' - AND PackagePath = '$packagePath' -"@ - - $item = Get-ISData $serverName $databaseName $query - $item | foreach { $_.ConfiguredValue } - -} #Get-ISSqlPackageConfiguration +# --------------------------------------------------------------------------- +### +# --------------------------------------------------------------------------- +[reflection.assembly]::Load("Microsoft.SqlServer.ManagedDTS, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91") > $null +#[Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll") > $null +#[reflection.assembly]::Load("Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91") > $null +#[Reflection.Assembly]::LoadFile("C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll") > $null +#[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ManagedDTS") > $null + +####################### +function New-ISApplication +{ + Write-Verbose "New-ISApplication" + + new-object ("Microsoft.SqlServer.Dts.Runtime.Application") + +} #New-ISApplication + + +####################### +function Copy-ISItemSQLToSQL +{ + param([string]$path, [string]$topLevelFolder, [string]$serverName, + [string]$destination, [string]$destinationServer, [switch]$recurse, + [string]$include="*", [string]$exclude=$null, [switch]$whatIf, [switch]$force, $connectionInfo) + + #If destinationServer contains instance i.e. server\instance, convert to just servername: + $destinationServer = $destinationserver -replace "\\.*" + +Write-Verbose "Copy-ISItemSQLToSQL path:$path serverName:$serverName destination:$destination destinationServer:$destinationServer recurse:$($recurse.IsPresent) include:$include exclude:$exclude whatIf:$($whatIf.IsPresent)" + + $literalPath = $($topLevelFolder + "\" + $path) -replace "\\\\","\" + Write-Verbose "literalPath:$literalPath" + + if (Test-ISPath $literalPath $serverName 'Package') + { + if ($whatIf) + { Write-Host "What if:Set-ISPackage $literalPath $destination $destinationServer $($force.IsPresent)" } + else + { + $package = Get-ISPackage $literalPath $serverName + if ($package) + { + if ($connectionInfo) + { Set-ISConnectionString $package $connectionInfo } + if ($force) + { Set-ISPackage -package $package -path $destination -serverName $destinationServer -force } + else + { Set-ISPackage -package $package -path $destination -serverName $destinationServer } + } + } + } + elseif (Test-ISPath $literalPath $serverName 'Folder') + { + if ($recurse) + { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -recurse $include $exclude } + else + { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -include $include -exclude $exclude } + + $count = $pInfos | Measure-Object | Select Count + foreach ($pInfo in $pInfos) + { + $i++ + $folder = $($destination + $pInfo.Folder) + Write-Verbose "folder:$folder" + + if ($pInfo.Flags -eq 'Folder') + { + $testPath = $($folder + "\" -replace "\\$") + $pInfo.Name + Write-Verbose "testPath:$testPath" + if (!(Test-ISPath $testPath $destinationServer 'Folder')) + { + if ($whatIf) + { Write-Host "What if:New-ISItem $Folder $($pInfo.Name) $destinationServer" } + else + { + Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) + New-ISItem $Folder $pInfo.Name $destinationServer + } + } + } + elseif ($pInfo.Flags -eq 'Package') + { + $destPath = $($folder + "\" -replace "\\\\","\") + $pInfo.Name + if ($whatIf) + { Write-Host "What if:Set-ISPackage -package $($pInfo.Name) -path $destPath -serverName $destinationServer -force $($force.IsPresent)" } + else + { + $package = Get-ISPackage $pInfo.literalPath $serverName + if ($package) + { + Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) + if ($connectionInfo) + { Set-ISConnectionString $package $connectionInfo } + if ($force) + { Set-ISPackage -package $package -path $destPath -serverName $destinationServer -force } + else + { Set-ISPackage -package $package -path $destPath -serverName $destinationServer } + } + } + } + } + } + else + { throw "Package $path does not exist on server $serverName" } + +} #Copy-ISItemSQLToSQL + +####################### +function Copy-ISItemSQLToFile +{ + param([string]$path, [string]$topLevelFolder, [string]$serverName, [string]$destination, + [switch]$recurse, [string]$include="*", [string]$exclude=$null, [switch]$whatIf, [switch]$force, $connectionInfo) + +Write-Verbose "Copy-ISItemSQLToFile path:$path serverName:$serverName destination:$destination recurse:$($recurse.IsPresent) include:$include exclude:$exclude whatIf:$($whatIf.IsPresent)" + + $literalPath = $($topLevelFolder + "\" + $path) -replace "\\\\","\" + Write-Verbose "literalPath:$literalPath" + + if (Test-ISPath $literalPath $serverName 'Package') + { + if ($whatIf) + { Write-Host "What if:Set-ISPackage $($package.Name) $destination $($force.IsPresent)" } + else + { + $package = Get-ISPackage $literalPath $serverName + if ($package) + { + if ($connectionInfo) + { Set-ISConnectionString $package $connectionInfo } + if ($force) + { Set-ISPackage -package $package -path $destination -force } + else + { Set-ISPackage -package $package -path $destination } + } + } + } + elseif (Test-ISPath $literalPath $serverName 'Folder') + { + if ($recurse) + { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -recurse $include $exclude } + else + { $pInfos = Get-ISItem -path $path $topLevelFolder $serverName -include $include -exclude $exclude } + + $count = $pInfos | Measure-Object | Select Count + foreach ($pInfo in $pInfos) + { + $i++ + $folder = $($destination + $pInfo.Folder) -replace "\\\\","\" + Write-Verbose "folder:$folder" + + if ($pInfo.Flags -eq 'Folder') + { + $testPath = $($folder + "\" + $pInfo.Name) -replace "\\\\","\" + Write-Verbose "testPath:$testPath" + if (!(Test-Path -literalPath $testPath)) + { + if ($whatIf) + { Write-Host "What if:New-Item -path $Folder -name $($pInfo.Name) -ltype directory" } + else + { + Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) + New-Item -path $Folder -name $pInfo.Name -type directory + } + } + } + elseif ($pInfo.Flags -eq 'Package') + { + $destPath = $($folder + "\" + $pInfo.Name + ".dtsx") -replace "\\\\","\" + if ($whatIf) + { Write-Host "What if:Set-ISPackage -package $($pInfo.Name) -path $destPath -force $($force.IsPresent)" } + else + { + $package = Get-ISPackage $pInfo.literalPath $serverName + if ($package) + { + Write-Progress -activity "Copying ISItems..." -status "Copying $($pInfo.Name)" -percentcomplete ($i/$count.count*100) + if ($connectionInfo) + { Set-ISConnectionString $package $connectionInfo } + if ($force) + { Set-ISPackage -package $package -path $destPath -force } + else + { Set-ISPackage -package $package -path $destPath } + } + } + } + } + } + else + { throw "Package $path does not exist on server $serverName" } + +} #Copy-ISItemSQLToFile + +####################### +function Copy-ISItemFileToSQL +{ + param([string]$path, [string]$destination, + [string]$destinationServer, [switch]$recurse, + [string]$include="*", [string]$exclude=$null, [switch]$whatIf, [switch]$force, $connectionInfo) + + #If destinationServer contains instance i.e. server\instance, convert to just servername: + $destinationServer = $destinationserver -replace "\\.*" + + Write-Verbose "Copy-ISItemFileToSQL path:$path destination:$destination destinationServer$desinationServer recurse:$($recurse.IsPresent) include:$include exclude:$exclude whatIf:$($whatIf.IsPresent)" + + ####################### + function Copy-ISChildItemFileToSQL + { + param($item, [string]$path, [string]$destination, [string]$destinationServer, [switch]$force, $connectionInfo) + $parentPath = Split-Path $item.FullName -parent | Split-Path -leaf + $itemPath = $parentPath -replace "$([system.io.path]::getpathroot($item.FullName) -replace '\\','\\')" + Write-Verbose "itemPath:$itemPath" + $folder = $destination + Write-Verbose "folder:$folder" + + if ($item.PSIsContainer) + { + $testPath = $($folder + "\" + $item.Name) -replace "\\\\","\" + Write-Verbose "testPath:$testPath" + if (!(Test-ISPath $testPath $destinationServer 'Folder')) + { + if ($whatIf) + { Write-Host "What if:New-ISItem $Folder $item.Name $destinationServer" } + else + { New-ISItem $Folder $item.Name $destinationServer } + } + } + else + { + $destPath = $($folder + "\" + $item.BaseName) -replace "\\\\","\" + if ($whatIf) + { Write-Host "What if:Set-ISPackage $($package.Name) $folder" } + else + { + $package = Get-ISPackage $item.FullName + if ($package) + { + if ($connectionInfo) + { Set-ISConnectionString $package $connectionInfo } + if ($force) + { Set-ISPackage -package $package -path $destPath -serverName $destinationServer -force } + else + { Set-ISPackage -package $package -path $destPath -serverName $destinationServer } + } + } + } + + } #Copy-ISChildItemFileToSQL + + if (Test-Path $path) + { + if ($recurse) + { + $items = Get-ChildItem -path $path -include $include -exclude $exclude -recurse + $count = $items | Measure-Object | Select Count + foreach ($item in $items) + { + $i++ + Write-Progress -activity "Copying Items..." -status "Copying $($item.Name)" -percentcomplete ($i/$count.count*100) + if ($force) + { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -force -connectionInfo $connectionInfo } + else + { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -connectionInfo $connectionInfo } + } + } + else + { + $items = Get-ChildItem -path $path -include $include -exclude $exclude + $count = $items | Measure-Object | Select Count + foreach ($item in $items) + { + $i++ + Write-Progress -activity "Copying Items..." -status "Copying $($item.Name)" -percentcomplete ($i/$count.count*100) + if ($force) + { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -force -connectionInfo $connectionInfo } + else + { Copy-ISChildItemFileToSQL -item $item -path $path -destination $destination -destinationServer $destinationServer -connectionInfo $connectionInfo } + } + } + } + else + { throw "Package $path does not exist" } + +} #Copy-ISItemFileToSQL + +####################### +function Get-ISItem +{ + param([string]$path="\", [string]$topLevelFolder, [string]$serverName=$(throw 'serverName is required.'), + [switch]$recurse, [string]$include="*", [string]$exclude=$null) + + Write-Verbose "Get-ISItem path:$path topLevelFolder:$topLevelFolder serverName:$serverName recurse:$($recurse.IsPresent) include:$include exclude:$exclude" + + #Note: Unlike SSMS, specify an instance name. There are some inconsistencies in the implementation of methods in the Application class + #GetPackagesInfos unlike every other method expects a SQL instance as the server name while the other methods expect an Integration Services server. + #This inconsistency applies to folder as well path where GetPackagesInfo defaults to the TopLevelFolders path defined in MsDtsSrvr.ini.xml and the + #other methods expect you to fully qualify the path with the TopLevelFolder name. There does not appear to be programatic way to determine the + #TopLevelFolders which seems odd given that SSMS shows the top level folders. To workaround the TopLevelFolder issue we will pass the value as parameter + + $app = New-ISApplication + + if ($recurse) + { + foreach ($pInfo in $app.GetPackageInfos($path, $serverName, $null, $null)) + { + if ($pInfo.Name -like $include -and $pInfo.Name -notlike $exclude) + { + $literalPath = $($topLevelFolder + $pInfo.Folder + "\" + $pInfo.Name) -replace "\\\\","\" + $pInfo | add-Member -memberType noteProperty -name serverName -value $serverName -passthru | + add-Member -memberType noteProperty -name topLevelFolder -value $topLevelFolder -passthru | + add-Member -memberType noteProperty -name literalPath -value $literalPath -passthru + + if ($pInfo.flags -eq 'Folder') + { $childItem = $($pInfo.Folder + "\" + $pInfo.Name) -replace "\\\\","\" + Get-ISItem $childItem $topLevelFolder $serverName -recurse $include $exclude } + } + } + } + else + { + foreach ($pInfo in $app.GetPackageInfos($path, $serverName, $null, $null)) + { + if ($pInfo.Name -like $include -and $pInfo.Name -notlike $exclude) + { + $literalPath = $($topLevelFolder + $pInfo.Folder + "\" + $pInfo.Name) -replace "\\\\","\" + $pInfo | add-Member -memberType noteProperty -name serverName -value $serverName -passthru | + add-Member -memberType noteProperty -name topLevelFolder -value $topLevelFolder -passthru | + add-Member -memberType noteProperty -name literalPath -value $literalPath -passthru + } + } + } + +} #Get-ISItem + +####################### +function Test-ISPath +{ + param([string]$path=$(throw 'path is required.'), [string]$serverName=$(throw 'serverName is required.'), [string]$pathType='Any') + + #If serverName contains instance i.e. server\instance, convert to just servername: + $serverName = $serverName -replace "\\.*" + + Write-Verbose "Test-ISPath path:$path serverName:$serverName pathType:$pathType" + + #Note: Don't specify instance name + + $app = New-ISApplication + + switch ($pathType) + { + 'Package' { trap { $false; continue } $app.ExistsOnDtsServer($path,$serverName) } + 'Folder' { trap { $false; continue } $app.FolderExistsOnDtsServer($path,$serverName) } + 'Any' { $p=Test-ISPath $path $serverName 'Package'; $f=Test-ISPath $path $serverName 'Folder'; [bool]$($p -bor $f)} + default { throw 'pathType must be Package, Folder, or Any' } + } + +} #Test-ISPath + +####################### +function New-ISItem +{ + param([string]$path=$(throw 'path is required.'), [string]$value=$(throw 'value is required.'), [string]$serverName=$(throw 'serverName is required.')) + + #If serverName contains instance i.e. server\instance, convert to just servername: + $serverName = $serverName -replace "\\.*" + + Write-Verbose "New-ISItem path:$path value:$value serverName:$serverName" + + $app = New-ISApplication + + $testPath = $($path + "\" + $value) -replace "\\\\","\" + + if (!(Test-ISPath $testPath $serverName 'Folder')) + { $app.CreateFolderOnDtsServer($path, $value, $serverName) } + else + { throw "Path $testPath already exists!" } + +} #New-ISItem + +####################### +function Rename-ISItem +{ + param([string]$path=$(throw 'path is required.'), [string]$oldName=$(throw 'oldName is required.'), + [string]$newName=$(throw 'newName is required.'), [string]$serverName=$(throw 'serverName is required.')) + + #If serverName contains instance i.e. server\instance, convert to just servername: + $serverName = $serverName -replace "\\.*" + + Write-Verbose "Rename-ISItem path:$path oldName:$oldName newName:$newName serverName:$serverName" + + $app = New-ISApplication + + $testPath = $($path + "\" + $oldName) -replace "\\\\","\" + + if (Test-ISPath $testPath $serverName 'Folder') + { $app.RenameFolderOnDtsServer($path, $oldName, $newName, $serverName) } + else + { throw "Path $testPath does not exist" } + +} #Rename-ISItem + +####################### +function Remove-ISItem +{ + param($pInfo, [switch]$whatIf) + begin + { + ####################### + function Remove-ISChildItem + { + param($pInfo, [switch]$whatIf) + + $app = New-ISApplication + #If serverName contains instance i.e. server\instance, convert to just servername: + $serverName = $pInfo.serverName -replace "\\.*" + switch ($pInfo.Flags) + { + 'Package' { + if (Test-ISPath $pInfo.literalPath $serverName 'Package') + { + if ($whatIf) + { Write-Host "What if:RemoveFromDtsServer($($pInfo.literalPath),$serverName)" } + else + { $app.RemoveFromDtsServer($pInfo.literalPath,$serverName) } + } + else + { throw "Package $($pInfo.literalPath) does not exist on server $serverName" } + } + 'Folder' { + if (Test-ISPath $pInfo.literalPath $serverName 'Folder') + { + if ($whatIf) + { Write-Host "What if:RemoveFolderFromDtsServer($($pInfo.literalPath),$serverName)" } + else + { $app.RemoveFolderFromDtsServer($pInfo.literalPath,$serverName) } + } + else + { throw "Folder $($pInfo.literalPath) does not exist on server $serverName" } + } + } + } #Remove-ISChildItem + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'PackageInfo') + { + Write-Verbose "Remove-ISChildItem $($_.literalPath) $($whatIf.IsPresent)" + if ($whatif) + { Remove-ISChildItem $_ -whatIf } + else + { Remove-ISChildItem $_ } + } + else + { throw 'Remove-ISChildItem:Param pInfo must be a PackageInfo object.' } + } + } + end + { + if ($pInfo) + { + if ($whatIf) + { $pInfo | Remove-ISChildItem -whatIf } + else + { $pInfo | Remove-ISChildItem } + } + } + +} #Remove-ISItem + +####################### +function Get-ISPackage +{ + param([string]$path, [string]$serverName) + + #If serverName contains instance i.e. server\instance, convert to just servername: + $serverName = $serverName -replace "\\.*" + + Write-Verbose "Get-ISPackage path:$path serverName:$serverName" + + $app = New-ISApplication + + #SQL Server Store + if ($path -and $serverName) + { + if (Test-ISPath $path $serverName 'Package') + { $app.LoadFromDtsServer($path, $serverName, $null) } + else + { Write-Error "Package $path does not exist on server $serverName" } + } + #File Store + elseif ($path -and !$serverName) + { + if (Test-Path -literalPath $path) + { $app.LoadPackage($path, $null) } + else + { Write-Error "Package $path does not exist" } + } + else + { throw 'You must specify a file path or package store path and server name' } + +} #Get-ISPackage + +####################### +function Set-ISPackage +{ + param($package=$(throw 'package is required.'), [string]$path, [string]$serverName, [switch]$force) + + #If serverName contains instance i.e. server\instance, convert to just servername: + $serverName = $serverName -replace "\\.*" + + Write-Verbose "Set-ISPackage package:$($package.Name) path:$path serverName:$serverName" + + $app = New-ISApplication + + #SQL Server Store + if ($path -and $serverName) + { + if (!(Test-ISPath $path $serverName 'Package') -or $($force)) + { $app.SaveToDtsServer($package, $null, $path, $serverName) } + else + { throw "Package $path already exists on server $serverName" } + } + #File Store + elseif ($path -and !$serverName) + { + if (!(Test-Path -literalPath $path) -or $($force)) + { $app.SaveToXml($path, $package, $null) } + else + { throw "Package $path already exists" } + } + else + { throw 'You must specify a file path or package store path and server name' } + +} #Set-ISPackage + +####################### +function Get-ISRunningPackage +{ + param($serverName=$(throw 'serverName is required.')) + + #If serverName contains instance i.e. server\instance, convert to just servername: + $serverName = $serverName -replace "\\.*" + + Write-Verbose "Get-ISRunningPackage serverName:$serverName" + + $app = New-ISApplication + + $app.GetRunningPackages($serverName) + +} #Get-ISRunningPackage + +####################### +function Set-ISConnectionString +{ + param($package=$(throw 'package is required.'), $connectionInfo=$(throw 'value is required.')) + + Write-Verbose "Set-ISConnectionString" + + foreach ($i in $connectionInfo.GetEnumerator()) + { + $name = $($i.Key); $value = $($i.Value); + Write-Verbose "Set-ISConnectionString name:$name value:$value " + $connectionManager = $package.connections | where {$_.Name -eq "$name"} + Write-Verbose "Set-ISConnectionString connString1:$($connectionManager.ConnectionString)" + if ($connectionManager) + { + $connString = $connectionManager.ConnectionString + Write-Verbose "Set-ISConnectionString connString:$connString" + $connString -match "^Data Source=(?[^;]+);" > $null + $newConnString = $connString -replace $($matches.server -replace "\\","\\"),$value + Write-Verbose "Set-ISConnectionString newConnString:$newConnString" + if ($newConnString) + { $connectionManager.ConnectionString = $newConnString } + } + } + +} #Set-ISConnectionString + +####################### +function Get-ISData +{ + param([string]$serverName=$(throw 'serverName is required.'), [string]$databaseName=$(throw 'databaseName is required.'), + [string]$query=$(throw 'query is required.')) + + Write-Verbose "Get-ISData serverName:$serverName databaseName:$databaseName query:$query" + + $connString = "Server=$serverName;Database=$databaseName;Integrated Security=SSPI;" + $da = New-Object "System.Data.SqlClient.SqlDataAdapter" ($query,$connString) + $dt = New-Object "System.Data.DataTable" + $da.fill($dt) > $null + $dt + +} #Get-ISData + +####################### +function Get-ISSqlConfigurationItem +{ + param($serverName, $databaseName, [string]$configurationTable=$(throw 'configurationTable is required.'), + [string]$configurationFilter=$(throw 'configurationFilter is required.'), [string]$packagePath=$(throw 'packagePath is required.')) + +Write-Verbose "Get-ISSqlConfigurationItem serverName:$serverName db:$databaseName table:$configurationTable filer:$configurationFilter path:$packagePath query:$query" + +$query = @" +Select ConfiguredValue FROM $configurationTable + WHERE ConfigurationFilter = '$configurationFilter' + AND PackagePath = '$packagePath' +"@ + + $item = Get-ISData $serverName $databaseName $query + $item | foreach { $_.ConfiguredValue } + +} #Get-ISSqlPackageConfiguration diff --git a/Library/LibraryShowMbrs.ps1 b/Deprecated/Library/LibraryShowMbrs.ps1 similarity index 96% rename from Library/LibraryShowMbrs.ps1 rename to Deprecated/Library/LibraryShowMbrs.ps1 index 39d8b87..72c6988 100644 --- a/Library/LibraryShowMbrs.ps1 +++ b/Deprecated/Library/LibraryShowMbrs.ps1 @@ -1,96 +1,96 @@ -# --------------------------------------------------------------------------- -### -# --------------------------------------------------------------------------- -####################### -function New-ShowMbrs -{ - Write-Verbose "New-ShowMbrs" - - #__SQLPSXGroupUser is a session variable, so only create if it doesn't exist - if (!(Test-Path Variable:__SQLPSXGroupUser)) - { Set-Variable __SQLPSXGroupUser @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } - -} #New-ShowMbrs - -####################### -function Set-ShowMbrs -{ - param($account,$groupkey) - - Write-Verbose "Set-ShowMbrs $account $groupkey" - - if (!($__SQLPSXGroupUser.Contains($groupkey))) - { $__SQLPSXGroupUser[$groupkey] = @($account) } - elseif (!($__SQLPSXGroupUser[$groupkey] -contains $account)) - { $__SQLPSXGroupUser[$groupkey] += @($account) } - -} # Set-ShowMbrs - -####################### -function Get-GroupUser -{ - - param($group,$groupkey = $group) - - Write-Verbose "Get-GroupUser $group $groupkey" - - #If we haven't already enumerated the group this Powershell session - if (!($__SQLPSXGroupUser[$groupkey] -contains $group)) - { - if ($__SQLPSXGroupUser.Contains($group)) - { Set-ShowMbrs $__SQLPSXGroupUser[$group] $groupkey } - else - { - Set-ShowMbrs $group $groupkey - - $domain = $($group.ToString()).split("\")[0] - $groupname = $($group.ToString()).split("\")[1] - - if ($domain -ne 'NT AUTHORITY' -and $domain -ne 'BUILTIN') - { - - $groupUser= [ADSI]"WinNT://$($domain + '/' + $groupname),group" - $groupUser.psbase.Invoke("Members") | foreach { - $name = $_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null) - $type = $_.GetType().InvokeMember("Class", 'GetProperty', $null, $_, $null) - $path = $_.GetType().InvokeMember("AdsPath", 'GetProperty', $null, $_, $null) - $arPath = $path.Split("/") - $domain = $arPath[$arPath.length - 2] - $account = $domain + "\" + $name - if ($type -eq 'Group') - { Get-GroupUser $account $groupkey } - else - { Set-ShowMbrs $account $groupkey } - } - - } - } - } - -} #Get-GroupUser - -####################### -function Get-ShowMbrs -{ - param($group=$(throw '$group is required')) - - Write-Verbose "Get-ShowMbrs $group" - - New-ShowMbrs - - Get-GroupUser $group - - return $__SQLPSXGroupUser[$group] - -} #Get-ShowMbrs +# --------------------------------------------------------------------------- +### +# --------------------------------------------------------------------------- +####################### +function New-ShowMbrs +{ + Write-Verbose "New-ShowMbrs" + + #__SQLPSXGroupUser is a session variable, so only create if it doesn't exist + if (!(Test-Path Variable:__SQLPSXGroupUser)) + { Set-Variable __SQLPSXGroupUser @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } + +} #New-ShowMbrs + +####################### +function Set-ShowMbrs +{ + param($account,$groupkey) + + Write-Verbose "Set-ShowMbrs $account $groupkey" + + if (!($__SQLPSXGroupUser.Contains($groupkey))) + { $__SQLPSXGroupUser[$groupkey] = @($account) } + elseif (!($__SQLPSXGroupUser[$groupkey] -contains $account)) + { $__SQLPSXGroupUser[$groupkey] += @($account) } + +} # Set-ShowMbrs + +####################### +function Get-GroupUser +{ + + param($group,$groupkey = $group) + + Write-Verbose "Get-GroupUser $group $groupkey" + + #If we haven't already enumerated the group this Powershell session + if (!($__SQLPSXGroupUser[$groupkey] -contains $group)) + { + if ($__SQLPSXGroupUser.Contains($group)) + { Set-ShowMbrs $__SQLPSXGroupUser[$group] $groupkey } + else + { + Set-ShowMbrs $group $groupkey + + $domain = $($group.ToString()).split("\")[0] + $groupname = $($group.ToString()).split("\")[1] + + if ($domain -ne 'NT AUTHORITY' -and $domain -ne 'BUILTIN') + { + + $groupUser= [ADSI]"WinNT://$($domain + '/' + $groupname),group" + $groupUser.psbase.Invoke("Members") | foreach { + $name = $_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null) + $type = $_.GetType().InvokeMember("Class", 'GetProperty', $null, $_, $null) + $path = $_.GetType().InvokeMember("AdsPath", 'GetProperty', $null, $_, $null) + $arPath = $path.Split("/") + $domain = $arPath[$arPath.length - 2] + $account = $domain + "\" + $name + if ($type -eq 'Group') + { Get-GroupUser $account $groupkey } + else + { Set-ShowMbrs $account $groupkey } + } + + } + } + } + +} #Get-GroupUser + +####################### +function Get-ShowMbrs +{ + param($group=$(throw '$group is required')) + + Write-Verbose "Get-ShowMbrs $group" + + New-ShowMbrs + + Get-GroupUser $group + + return $__SQLPSXGroupUser[$group] + +} #Get-ShowMbrs diff --git a/Library/LibrarySmo.ps1 b/Deprecated/Library/LibrarySmo.ps1 similarity index 97% rename from Library/LibrarySmo.ps1 rename to Deprecated/Library/LibrarySmo.ps1 index 5b44f4e..d7bbb01 100644 --- a/Library/LibrarySmo.ps1 +++ b/Deprecated/Library/LibrarySmo.ps1 @@ -1,2941 +1,2941 @@ -# --------------------------------------------------------------------------- -### -# --------------------------------------------------------------------------- -[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") -$smoAssembly = [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") -if (!($smoVersion)) -{ Set-Variable -name SmoVersion -value $smoAssembly.GetName().Version.Major -Scope Global -Option Constant -Description "SQLPSX variable" } -[reflection.assembly]::LoadWithPartialName('Microsoft.SqlServer.SMOExtended') > $null - -$scriptRoot = Split-Path (Resolve-Path $myInvocation.MyCommand.Path) -. $scriptRoot\LibraryShowMbrs.ps1 - -Set-Alias Get-InvalidLogins $scriptRoot\Get-InvalidLogins.ps1 -Set-Alias Get-SessionTimeStamp $scriptRoot\Get-SessionTimeStamp.ps1 - -####################### -function Get-SqlConnection -{ - param([string]$sqlserver=$(Throw 'Get-SqlConnection:`$sqlserver is required.'),[string]$Username,[string]$Password) - - Write-Verbose "Get-SqlConnection $sqlserver" - - if($Username -and $Password) - { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver,$Username,$Password } - else - { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver } - - $con.Connect() - - return $con - -} #Get-ServerConnection - -####################### -function Get-SqlServer -{ - param([string]$sqlserver=$(throw 'Get-SqlServer:`$sqlserver is required.'),[string]$Username,[string]$Password) - #When $sqlserver passed in from the SMO Name property, brackets - #are automatically inserted which then need to be removed - $sqlserver = $sqlserver -replace "\[|\]" - - Write-Verbose "Get-SqlServer $sqlserver" - - $con = Get-SqlConnection $sqlserver $Username $Password - - $server = new-object ("Microsoft.SqlServer.Management.Smo.Server") $con - $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.StoredProcedure], "IsSystemObject") - $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.Table], "IsSystemObject") - $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.View], "IsSystemObject") - $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.UserDefinedFunction], "IsSystemObject") - #trap { "Check $SqlServer Name"; continue} $server.ConnectionContext.Connect() - return $server - -} #Get-SqlServer - -####################### -function Get-SqlDatabase -{ - param($sqlserver=$(throw 'Get-SqlDatabase:`$sqlserver is required'),[string]$dbname) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlDatabase:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlDatabase $($server.Name) $dbname" - - if ($dbname) - { if (!$server.Databases.Contains("$dbname")) {throw 'Check $dbname Name.'} - else { - if ($server.Databases[$dbname].IsAccessible -eq $false) {throw "Database $dname not accessible."} - else {$server.Databases[$dbname]} - } - } - else - #Skip systems databases - { $server.Databases | where {$_.IsSystemObject -eq $false -and $_.IsAccessible -eq $true} } - -} # Get-SqlDatabase - -####################### -function Get-SqlData -{ - param($sqlserver,$dbname=$(throw 'Get-SqlData:`$dbname is required.'),[string]$qry=$(throw 'Get-SqlData:`$qry is required.')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Get-SqlData:Param '`$dbname' must be a String or Database object." } - } - - #Write-Verbose "Get-SqlData $($db.Parent.Name) $($db.Name) $qry" - Write-Verbose "Get-SqlData $($db.Parent.Name) $($db.Name)" - - $ds = $db.ExecuteWithResults("$qry") - $ds.Tables | foreach { $_.Rows} - -}# Get-SqlData - -####################### -function Set-SqlData -{ - param($sqlserver,$dbname=$(throw 'Set-SqlData:`$dbname is required.'),[string]$qry=$(throw 'Set-SqlData:`$qry is required.')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Set-SqlData:Param '`$dbname' must be a String or Database object." } - } - - #Write-Verbose "Set-SqlData $($db.Parent.Name) $($db.Name) $qry" - Write-Verbose "Set-SqlData $($db.Parent.Name) $($db.Name)" - - $db.ExecuteNonQuery("$qry") - -}# Set-SqlData - -####################### -function ConvertTo-MemberXml -{ - param($member) - - $xmlMember = $null - $member | foreach { $xmlMember += "$_"} - return $xmlMember - -}# ConvertTo-MemberXml - -####################### -function Get-SqlShowMbrs -{ - param($server,[string]$group=$(throw 'Get-SqlShowMbrs:`$group is required.')) - - if ($server.GetType().Name -ne 'Server') - { throw 'Get-SqlShowMbrs:Param `$server must be a Server object.' } - - Write-Verbose "Get-SqlShowMbrs $($server.Name) $group" - - New-ShowMbrs - - #The call to EnumWindowsGroupInfo will error out on groups which have been removed from AD or - #which have been renamed. We need to check for this condition when enumerating groups - #Individual logins may also be orphaned so we will skip orphaned and enumerate the renamed group - #for renamed groups. As a best practice you should run Get-InvalidLogins to identifiy logins/groups and drop - #orphaned logins or recreate renamed logins to maintain consistency with Active Directory - $invalidLogin = @() - Get-InvalidLogins $server.Name | foreach {$invalidLogin += $_.NTLogin} - $renamed = @{} - Get-InvalidLogins $server.Name | where {$_.IsRenamed -eq $true} | foreach {$renamed[$_.NTLogin] = $_.NewNTAccount} - - #if group is a valid login i.e. not in invalidLogin array then enumerate it - if (!($invalidLogin -contains $group )) - { - #EnumWindowsGroupInfo is somewhat unreliable, for instance MyServer\SQLServer2005MSSQLUser$MyServer$Myinstance - #will return null but using a WMI query will return group information. EnumWindowsGroupInfo does not work - #for groups which have not been granted access to the SQ instnace. since we are using a global session variable - #to store group user membership the Builtin group is not unique (all other group members should be i.e. a domain - #or computer cannot have duplicate group names). So Builtin needs to be handled specially - if ($group -eq 'BUILTIN\Administrators') - { - #if we've already enumerated Builtin perhaps for another server remove it and re-enumerate it - $__SQLPSXGroupUser.remove('BUILTIN\Administrators') - - if ($server.Information.IsClustered) - { $allNodes = Get-WmiObject -class MSCluster_Node -namespace "root\mscluster" -computername $($server.Information.NetName) | select name - foreach ($node in $allNodes) - { Get-GroupUser "$($node.name)\Administrators" 'BUILTIN\Administrators'}} - else - - { Get-GroupUser "$($server.Information.NetName)\Administrators" 'BUILTIN\Administrators'} - } - else - { Get-GroupUser $group } - } - #if the group is invalid but has been renamed in AD thus still has access to SQL Server enumerate the new group name - elseif ($renamed.Contains($group)) - { - Get-GroupUser $renamed[$group] - } - - return $__SQLPSXGroupUser[$group] - -} #Get-SqlShowMbrs - -####################### -function Get-SqlUser -{ - param($db) - begin - { - function Select-SqlUser ($db) - { - foreach ($user in $db.Users | where {$_.UserType.ToString() -ne 'Certificate'}) - { - $member = @() - - if ($user.HasDBAccess) - { - $member += @($(Get-SqlUserMember $user)) - $object = $null - - #Get objects owned by user, this part is slow with SQL 2000, In 2005 if user owns an object only the schema is listed - #as the owned object, so even though SQL 2000 does really doesn't have schemas, will just report they do. - if ($db.Parent.Information.Version.Major -ge 9) - { - foreach ($urn in $user.EnumOwnedObjects()) - { - $object += [string] "" - } - } - elseif ($user.EnumOwnedObjects() -ne $null) - { $object += [string] "" } - - #Return SqlUser Object - $user | add-Member -memberType noteProperty -name members -value $member -passthru | - add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name objects -value $object -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - - } - } - - } #Select-SqlUser - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlUser $($_.Name)" - Select-SqlUser $_ } - else - { throw 'Get-SqlUser:Param `$db must be a database object.' } - } - } - end - { - if ($db) - { $db | Get-SqlUser } - } - -} # Get-SqlUser - -####################### -function New-SqlUserMember -{ - Write-Verbose "New-SqlUserMember" - - #__SQLPSXUserMember is a session variable, so only create if it doesn't exist - if (!(Test-Path Variable:__SQLPSXUserMember)) - { Set-Variable __SQLPSXUserMember @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } - -} #New-SQLUserMember - -####################### -function Get-SqlUserMember -{ - param($user,$db) - - Write-Verbose "Get-SqlUserMember $($user.Name) $($db.Name)" - - New-SqlUserMember - - if ($user -and $user.GetType().Name -eq 'User') - { - $key = $null - $key = $user.parent.parent.name + "." + $user.parent.name - - if(!($__SQLPSXUserMember.$key.$($user.Name))) { - $member = @() - $tmpMember = $null - if ($user.LoginType -eq 1) - { - $tmpMember = Get-SqlShowMbrs $user.parent.parent $user.Login - if ($tmpMember -ne $null) - {$member += $tmpMember} - } - - #If Guest user i.e. UserType = NoLogin - if ($user.UserType.ToString() -eq 'NoLogin' -or $user.Name -eq 'guest') - { $member += $user.Name } - elseif ($member -notcontains $user.Login) - { $member += $user.Login } - #Add member to global hash - $__SQLPSXUserMember[$key] += @{$user.Name = $member} - #Return member array - Return $member - } - else - { $__SQLPSXUserMember.$key.$($user.Name) } - } - elseif ($db -and $db.GetType().Name -eq 'Database') - { - $key = $null - $key = $db.parent.name + "." + $db.name - if(!($__SQLPSXUserMember[$key])) { - Get-SqlUser $db > $null - #Return User Hash - $__SQLPSXUserMember[$key] - } - else - #Return Login Hash - { $__SQLPSXUserMember[$key] } - } - else - { throw 'Get-SqlUserMember:Param `$user or `$db missing or invalid type.' } - -} # Get-SqlUserMember - -####################### -function Get-SqlDatabaseRole -{ - param($db) - begin - { - function Select-SqlDatabaseRole ($db) - { - - foreach ($role in $db.Roles) - { - $member = @() - $member += @($(Get-SqlDatabaseRoleMember $role)) - - #Return DatabaseRole Object - $role | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name members -value $member -passthru | - add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - - } - - } # Select-SqlDatabaseRole - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlDatabaseRole $($_.Name)" - Select-SqlDatabaseRole $_ } - else - { throw 'Get-SqlDatabaseRole:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlDatabaseRole } - } - -} #Get-SqlDatabaseRole - -####################### -function New-SqlDatabaseRoleMember -{ - Write-Verbose "New-SqlDatabaseRoleMember" - - #__SQLPSXDatabaseRoleMember is a session variable, so only create if it doesn't exist - if (!(Test-Path Variable:__SQLPSXDatabaseRoleMember)) - { Set-Variable __SQLPSXDatabaseRoleMember @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } - -} #New-SqlDatabaseRoleMember - -####################### -function Get-SqlDatabaseRoleMember -{ - param($role,$db) - - Write-Verbose "Get-SqlDatabaseRoleMember $($role.Name) $($db.Name)" - - New-SqlDatabaseRoleMember - - if ($role -and $role.GetType().Name -eq 'DatabaseRole') - { - $key = $null - $key = $role.parent.parent.name + "." + $role.parent.name - - if(!($__SQLPSXDatabaseRoleMember.$key.$($role.Name))) { - $user = @{} - $user = Get-SqlUserMember -db $role.parent - - $member = @() - $tmpMember = @() - - #Although public is a role its members cannot be enumerated using EnumMembers() - if (!($role.Name -eq "public")) - { - #The EnumMembers() method will recursively (reports nested role members) enumerate role membership for you - #Thank You Microsoft SMO Developers! - #List only members that are Roles or valid users i.e. users which meet condition in get-sqluser, this will - #eliminate users that do not have access to the database (orphaned DB users) - $tmpMember = $role.EnumMembers() | where { $role.parent.Roles.Contains($_) -or $user.Contains($_) } - if ($tmpMember -ne $null) - {$member += $tmpMember} - $member += $role.Name - #Now let's re-enumerate and flatten out Windows group membership, adding the SqlUser Objects members array - #However we will ensure we only list an individual login once - $member | where { $user.Contains($_) } | foreach { $member += $user[$_] } - $member = $member | Sort-Object -unique - - } - #enumerate public role by extractng unique values from user hash - else - { - $user.values | foreach { $member += $_ } - $member += $role.Name - $member = $member | Sort-Object -unique - } - #Add member to global hash - $__SQLPSXDatabaseRoleMember[$key] += @{$role.Name = $member} - #Return member array - Return $member - } - else - { $__SQLPSXDatabaseRoleMember.$key.$($role.Name) } - } - elseif ($db -and $db.GetType().Name -eq 'Database') - { - $key = $null - $key = $db.parent.name + "." + $db.name - if(!($__SQLPSXDatabaseRoleMember[$key])) { - Get-SqlDatabaseRole $db > $null - #Return User Hash - $__SQLPSXDatabaseRoleMember[$key] - } - else - #Return Login Hash - { $__SQLPSXDatabaseRoleMember[$key] } - } - else - { throw 'Get-SqlDatabaseRoleMember:Param `$role or `$db missing or invalid type.' } - -} # Get-SqlDatabaseRoleMember - -####################### -function Get-SqlLogin -{ - param($sqlserver=$(throw 'Get-SqlLogin:`$sqlserver is required.')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlLogin:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlLogin $($server.Name)" - - foreach ($login in $server.Logins | where {$_.LoginType.ToString() -ne 'Certificate'}) - { - $member = @() - $member += @($(Get-SqlLoginMember $login)) - - #Return Login Object - $login | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name members -value $member -passthru | - add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-Member -memberType noteProperty -name Server -value $server.Name -passthru - - } - -} # Get-SqlLogin - -####################### -function Get-SqlLinkedServerLogin -{ - param($sqlserver=$(throw 'Get-SqlLogin:`$sqlserver is required.')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlLogin:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlLogin $($server.Name)" - - foreach ($linkedSrv in $server.LinkedServers) - { - #Some DataSources contains commas such as "myserver.mydomain.com,1433" - #This can cause problems when exporting to csv so replace , with ; - $dataSource = $linkedSrv.DataSource -replace ",",";" - - foreach ($linkedSrvLogin in $linkedSrv.LinkedServerLogins) - { - #Return linked Server Login Object - $linkedSrvLogin | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name LinkedServer -value $linkedSrv.Name -passthru | - add-Member -memberType noteProperty -name DataSource -value $dataSource -passthru | - add-Member -memberType noteProperty -name Server -value $server.Name -passthru - } - } -}# Get-SqlLinkedServerLogin - -####################### -function New-SqlLoginMember -{ - Write-Verbose "New-SqlLoginMember" - - #__SQLPSXLoginMember is a session variable, so only create if it doesn't exist - if (!(Test-Path Variable:__SQLPSXLoginMember)) - { Set-Variable __SQLPSXLoginMember @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } - -} #New-SQLLoginMember - -####################### -function Get-SqlLoginMember -{ - param($login,$server) - - Write-Verbose "Get-SqlLoginMember $($login.Name) $($server.Name)" - - New-SqlLoginMember - - if ($login -and $login.GetType().Name -eq 'Login') - { - if(!($__SQLPSXLoginMember.$($login.parent.name).$($login.Name))) { - $member = @() - $tmpMember = $null - if ($login.LoginType -eq 1) - { - $tmpMember = Get-SqlShowMbrs $login.parent $login.Name - if ($tmpMember -ne $null) - {$member += $tmpMember} - } - - if ($member -notcontains $login.Name) - { $member += $login.Name } - #Add member to global hash - $__SQLPSXLoginMember[$login.parent.name] += @{$login.Name = $member} - #Return member array - Return $member - } - else - { $__SQLPSXLoginMember.$($login.parent.name).$($login.Name) } - - } - elseif ($server -and $server.GetType().Name -eq 'Server') - { - if(!($__SQLPSXLoginMember[$server.name])) { - Get-SqlLogin $server > $null - #Return Login Hash - $__SQLPSXLoginMember[$server.name] - } - else - #Return Login Hash - { $__SQLPSXLoginMember[$server.name] } - } - else - { throw 'Get-SqlLoginMember:Param `$login or `$server missing or invalid type.' } - -} # Get-SqlLoginMember - -####################### -function Get-SqlServerRole -{ - param($sqlserver=$(throw 'Get-SqlServerRole:`$sqlserver is required.')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlServerRole:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlServerRole $($server.Name)" - - $login = @{} - $login = Get-SqlLoginMember -server $server - - foreach ($svrole in $server.Roles) - { - $member = @() - - #Although public is a role its members cannot be enumerated using EnumServerRoleMembers() - if (!($svrole.Name -eq "public")) - { - #EnumMembers and flatten out Windows group membership, adding the Sqllogin Objects members array - #However we will ensure we only list an individual login once - $svrole.EnumServerRoleMembers() | foreach {$login.$_} | foreach {if (!($member -contains $_)) {$member += $_}} - } - #enumerate public role by extractng unique values from login hash - else - { - $login.values | foreach { $member += $_ } - $member = $member | Sort-Object -unique - } - - $member += $svrole.Name - - #Return ServerRole Object - $svrole | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name members -value $member -passthru | - add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-Member -memberType noteProperty -name Server -value $server.Name -passthru - } - -} #Get-SqlServerRole - -####################### -function Get-SqlServerPermission -{ - param($sqlserver=$(throw 'Get-SqlServerPermission:`$sqlserver is required.')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlServerPermission:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlServerPermission $($server.Name)" - - if ($server.Information.Version.Major -ge 9) - {$perm = Get-SqlServerPermission90 $server; $perm += Get-SqlDatabasePermission $(Get-SqlDatabase $server 'master'); $perm} - else {Get-SqlDatabasePermission $(Get-SqlDatabase $server 'master')} - -}# Get-SqlServerPermission - -####################### -function Get-SqlServerPermission90 -{ - param($server=$(throw 'Get-SqlServerPermission90:`$server is required.')) - - if ($server.GetType().Name -ne 'Server') - { throw 'Get-SqlServerPermission90:Param `$server must be a Server object.' } - - Write-Verbose "Get-SqlServerPermission90 $($server.Name)" - - #SQL 2000 Does not suppport the concept of Server Permissions. SQL Server 2000 relies on Server Roles to grant server level permissions - #There are only three grantable permissions in SQL 2000/2005 only applicable to the master database: CREATE DATABASE; BACKUP DATABASE; BACKUP LOG - #Although we may think Create Database, Backup and Backup Log are server level permissions the SQL development team apparently does not - #share the same opinion and EnumServerPermissions will not enumerate these permissions. - #since I think they should I'll create a custom object and append to accomplish this in Get-SqlServerPermission - - $principal = @{} - #Get-SqlLogin $server | foreach { $principal[$_.Name] = $_.members } - $principal = Get-SqlLoginMember -server $server - - #Apparently having a login to SQL Server is considered a ServePermission in SQL 2005, all logins have this permission - #I'd rather eliminate the CONNECT SQL permissionType from the output - foreach ($perm in $server.EnumServerPermissions() | where {$_.PermissionType.ToString() -ne 'CONNECT SQL'}) - { - $member = @() - $member = $principal["$($perm.Grantee)"] - #Return ServerPermission Object - $perm | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name members -value $member -passthru | - add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-Member -memberType noteProperty -name dbname 'master' -passthru | - add-Member -memberType noteProperty -name Server -value $server.Name -passthru - } -} #Get-SqlServerPermission90 - -####################### -function Get-Permission80 -{ -param($db=$(throw 'Get-Permission80:`$db is required.')) - -if ($db.GetType().Name -ne 'Database') -{ throw 'Get-Permission80:Param `$db must be a Database object.' } - -Write-Verbose "Get-Permission80 $($db.Name)" - -$qry = @" -SELECT -grantee_principal.name AS [Grantee], -grantor_principal.name AS [Grantor], -CASE prmssn.protecttype WHEN 204 THEN 'GRANT_W_GRANT' WHEN 205 THEN 'GRANT' WHEN 206 THEN 'DENY' END AS [PermissionState], -CASE prmssn.id WHEN 0 THEN 'Database' ELSE 'ObjectOrColumn' END AS [ObjectClass], -null AS [ColumnName], -CASE prmssn.id WHEN 0 THEN DB_NAME() ELSE object_name(prmssn.id) END AS [ObjectName], -user_name(prmssn.uid) AS [ObjectSchema], -CASE prmssn.id WHEN 0 THEN DB_ID() ELSE prmssn.id END AS [ObjectID], -CASE - WHEN 1 = grantee_principal.issqlrole THEN 'DatabaseRole' - WHEN 1 = grantee_principal.isapprole THEN 'ApplicationRole' - ELSE 'User' -END AS [GranteeType], -CASE - WHEN 1 = grantor_principal.issqlrole THEN 'DatabaseRole' - WHEN 1 = grantor_principal.isapprole THEN 'ApplicationRole' - ELSE 'User' -END AS [GrantorType], -CASE CAST(prmssn.action AS int) - WHEN 26 THEN 'REFERENCES' - WHEN 178 THEN 'CREATE FUNCTION' - WHEN 193 THEN 'SELECT' - WHEN 195 THEN 'INSERT' - WHEN 196 THEN 'DELETE' - WHEN 197 THEN 'UPDATE' - WHEN 198 THEN 'CREATE TABLE' - WHEN 203 THEN 'CREATE DATABASE' - WHEN 207 THEN 'CREATE VIEW' - WHEN 222 THEN 'CREATE PROCEDURE' - WHEN 224 THEN 'EXECUTE' - WHEN 228 THEN 'BACKUP DATABASE' - WHEN 233 THEN 'CREATE DEFAULT' - WHEN 235 THEN 'BACKUP LOG' - WHEN 236 THEN 'CREATE RULE' -END AS [PermissionType] -FROM -dbo.sysprotects AS prmssn -INNER JOIN sysusers AS grantee_principal ON grantee_principal.uid = prmssn.uid -INNER JOIN sysusers AS grantor_principal ON grantor_principal.uid = prmssn.grantor -WHERE (prmssn.id > 0 AND OBJECTPROPERTY(prmssn.id,'IsMSShipped') = 0) -OR prmssn.id = 0 -"@ - Get-SqlData -dbname $db -qry $qry - -}# Get-Permission80 - -# Note: From BOL "sp_helprotect does not return information about securables that are introduced in SQL Server 2005." -# The output of 90 and 80 versions of Get-SqlDatabasePermission and Get-SqlObjectPermissions will not match when -# run against a SQL 2005 or higher server -####################### -function Get-SqlDatabasePermission -{ - param($db) - begin - { - ####################### - function Select-SqlDatabasePermission90 ($db) - { - Write-Verbose "Get-SqlDatabasePermission90 $($db.Name)" - - $user = @{} - $role = @{} - $user = Get-SqlUserMember -db $db - $role = Get-SqlDatabaseRoleMember -db $db - #Unfortunately on case sensitive servers you can have a role and user with the same name. So instead of using a single hash called - #principal we will use two different hashes and use the GranteeType to determine which one to use for listing the effective members - #of the permission. - - foreach ($perm in $db.EnumDatabasePermissions() | where {$_.PermissionType.ToString() -ne 'CONNECT'}) - { - $member = @() - switch ($perm.GranteeType) - { - 'User' { $member = $user["$($perm.Grantee)"] } - 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } - } - - #Return DatabasePermission Object - $perm | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name members -value $member -passthru | - add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member aliasproperty dbname ObjectName -passthru - } - - }# Select-SqlDatabasePermission90 - - ####################### - function Select-SqlDatabasePermission80 ($db) - { - Write-Verbose "Get-SqlDatabasePermission80 $($db.Name)" - - $user = @{} - $role = @{} - $user = Get-SqlUserMember -db $db - $role = Get-SqlDatabaseRoleMember -db $db - - foreach ($perm in Get-Permission80 $db | where {$_.ObjectClass -eq 'Database'}) - { - $member = @() - switch ($perm.GranteeType) - { - 'User' { $member = $user["$($perm.Grantee)"] } - 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } - } - - #Return DatabasePermission Object - $perm | add-member -memberType NoteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-member -memberType NoteProperty -name members -value $member -passthru | - add-member -memberType NoteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-member -memberType NoteProperty -name Server -value $db.parent.Name -passthru | - add-member aliasproperty dbname ObjectName -passthru - } - - }# Select-SqlDatabasePermission80 - } - process - { - if ($_) { - if ($_.GetType().Name -eq 'Database') - { - Write-Verbose "Get-SqlDatabasePermission $($_.Name)" - if ($_.Parent.Information.Version.Major -ge 9) - { Select-SqlDatabasePermission90 $_ } - else { Select-SqlDatabasePermission80 $_ } - } - else { throw 'Get-SqlDatabasePermission:Param `$db must be a database object.' } - } - } - end - { - if ($db) - { $db | Get-SqlDatabasePermission } - } - -}# Get-SqlServerPermission - -####################### -function Get-Permission90 -{ -param($db=$(throw 'Get-Permission90:`$db is required.')) - -if ($db.GetType().Name -ne 'Database') -{ throw 'Get-Permission90:Param `$db must be a Database object.' } - -Write-Verbose "Get-Permission90 $($db.Name)" - -$qry = @" -SELECT -grantee_principal.name AS [Grantee], -grantor_principal.name AS [Grantor], -CASE prmssn.state WHEN 'W' THEN 'GRANT_W_GRANT' WHEN 'G' THEN 'GRANT' WHEN 'D' THEN 'DENY' WHEN 'R' THEN 'REVOKE'END AS [PermissionState], -'ObjectOrColumn' AS [ObjectClass], -COL_NAME(prmssn.major_id,prmssn.minor_id) AS [ColumnName], -obj.name AS [ObjectName], -schema_name(obj.schema_id) AS [ObjectSchema], -prmssn.major_id AS [ObjectID], -CASE grantee_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' -END AS [GranteeType], -CASE grantor_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' -END AS [GrantorType], -CASE prmssn.type -WHEN 'AL' THEN 'ALTER' -WHEN 'CL' THEN 'CONTROL' -WHEN 'DL' THEN 'DELETE' -WHEN 'EX' THEN 'EXECUTE' -WHEN 'IN' THEN 'INSERT' -WHEN 'RC' THEN 'RECEIVE' -WHEN 'RF' THEN 'REFERENCES' -WHEN 'SL' THEN 'SELECT' -WHEN 'TO' THEN 'TAKE OWNERSHIP' -WHEN 'UP' THEN 'UPDATE' -WHEN 'VW' THEN 'VIEW DEFINITION' -END AS [PermissionType] -FROM -sys.database_permissions AS prmssn -INNER JOIN sys.database_principals AS grantee_principal ON grantee_principal.principal_id = prmssn.grantee_principal_id -INNER JOIN sys.database_principals AS grantor_principal ON grantor_principal.principal_id = prmssn.grantor_principal_id -INNER JOIN sys.all_objects AS obj ON obj.object_id = prmssn.major_id and prmssn.class = 1 -WHERE prmssn.major_id > 0 -UNION -SELECT -grantee_principal.name AS [Grantee], -grantor_principal.name AS [Grantor], -CASE prmssn.state WHEN 'W' THEN 'GRANT_W_GRANT' WHEN 'G' THEN 'GRANT' WHEN 'D' THEN 'DENY' WHEN 'R' THEN 'REVOKE'END AS [PermissionState], -'Schema' AS [ObjectClass], -null AS [ColumnName], -obj.name AS [ObjectName], -null AS [ObjectSchema], -prmssn.major_id AS [ObjectID], -CASE grantee_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' -END AS [GranteeType], -CASE grantor_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' -END AS [GrantorType], -CASE prmssn.type -WHEN 'AL' THEN 'ALTER' -WHEN 'CL' THEN 'CONTROL' -WHEN 'DL' THEN 'DELETE' -WHEN 'EX' THEN 'EXECUTE' -WHEN 'IN' THEN 'INSERT' -WHEN 'RC' THEN 'RECEIVE' -WHEN 'RF' THEN 'REFERENCES' -WHEN 'SL' THEN 'SELECT' -WHEN 'TO' THEN 'TAKE OWNERSHIP' -WHEN 'UP' THEN 'UPDATE' -WHEN 'VW' THEN 'VIEW DEFINITION' -END AS [PermissionType] -FROM -sys.database_permissions AS prmssn -INNER JOIN sys.database_principals AS grantee_principal ON grantee_principal.principal_id = prmssn.grantee_principal_id -INNER JOIN sys.database_principals AS grantor_principal ON grantor_principal.principal_id = prmssn.grantor_principal_id -INNER JOIN sys.schemas AS obj ON obj.schema_id = prmssn.major_id and prmssn.class = 3 -"@ - - Get-SqlData -dbname $db -qry $qry - -}# Get-Permission90 - -####################### -function Get-SqlObjectPermission -{ - param($db) - begin - { - ####################### - function Select-SqlObjectPermission90 ($db) - { - Write-Verbose "Get-SqlObjectPermission90 $($db.Name)" - - $user = @{} - $role = @{} - $user = Get-SqlUserMember -db $db - $role = Get-SqlDatabaseRoleMember -db $db - - Write-Verbose "EnumObjectPermissions" - - #Skip object permissions for system objects i.e. ObjectID > 0 - #EnumObjectPermissions() will take a long time to return data for very large permission sets - #in my testing a database with over 57,000 permission will take 10 min. - #dtproperties is an annoying little MS table used for DB diagrams it shows up as user table and - #is automatically created when someone clicks on DB Diagrams in SSMS/EM, permissions default to public - foreach ($perm in $db.EnumObjectPermissions() | where {$_.ObjectID -gt 0 -and $_.ObjectName -ne 'dtproperties'}) - { - $member = @() - switch ($perm.GranteeType) - { - 'User' { $member = $user["$($perm.Grantee)"] } - 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } - } - - #Return ObjectPermission Object - $perm | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name members -value $member -passthru | - add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - - } #Select-SqlObjectPermission90 - - ####################### - function Select-SqlObjectPermission80 ($db) - { - Write-Verbose "Get-SqlObjectPermission80 $($db.Name)" - - $user = @{} - $role = @{} - $user = Get-SqlUserMember -db $db - $role = Get-SqlDatabaseRoleMember -db $db - - foreach ($perm in Get-Permission80 $db | where {$_.ObjectClass -eq 'ObjectOrColumn' -and $_.ObjectID -gt 0 -and $_.ObjectName -ne 'dtproperties'}) - { - $member = @() - switch ($perm.GranteeType) - { - 'User' { $member = $user["$($perm.Grantee)"] } - 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } - } - - #Return ObjectPermission Object - $perm | add-member -memberType NoteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-member -memberType NoteProperty -name members -value $member -passthru | - add-member -memberType NoteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | - add-member -memberType NoteProperty -name Server -value $db.parent.Name -passthru | - add-member -memberType NoteProperty -name dbname -value $db.name -passthru - } - - } #Select-SqlObjectPermission80 - } - process - { - if ($_) { - if ($_.GetType().Name -eq 'Database') - { - Write-Verbose "Get-SqlObjectPermission $($_.Name)" - if ($_.Parent.Information.Version.Major -ge 9) - { Select-SqlObjectPermission90 $_ } - else { Select-SqlObjectPermission80 $_ } - } - else { throw 'Get-SqlObjectPermission:Param `$db must be a database object.' } - } - } - end - { - if ($db) - { $db | Get-SqlObjectPermission } - } - -}# Get-SqlObjectPermission - -####################### -function Get-SqlTable -{ - param($db, $name="*") - begin - { - function Select-SqlTable ($db, $name="*") - { - - foreach ($table in $db.Tables) - { - if ($table.IsSystemObject -eq $false -and ($table.name -like "*$name*" -or $name.Contains($table.name))) - { - #Return Table Object - $table | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $table.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - } - - } # Select-SqlTable - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlTable $($_.Name)" - Select-SqlTable $_ -name $name } - else - { throw 'Get-SqlTable:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlTable -name $name } - } - -} #Get-SqlTable - -####################### -function Get-SqlStoredProcedure -{ - param($db, $name="*") - begin - { - function Select-SqlStoredProcedure ($db, $name="*") - { - - foreach ($storedProcedure in $db.StoredProcedures) - { - if ($storedProcedure.IsSystemObject -eq $false -and ($storedProcedure.name -like "*$name*" -or $name.Contains($storedProcedure.name))) - { - #Return StoredProcedure Object - $storedProcedure | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $storedProcedure.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - } - - } # Select-SqlStoredProcedure - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlStoredProcedure $($_.Name)" - Select-SqlStoredProcedure $_ -name $name } - else - { throw 'Get-SqlStoredProcedure:Param `$db must be a database object.' } - } - } - end - { - if ($db) - { $db | Get-SqlStoredProcedure -name $name } - } - -} #Get-SqlStoredProcedure - -####################### -function Get-SqlView -{ - param($db, $name="*") - begin - { - function Select-SqlView ($db, $name="*") - { - - foreach ($view in $db.Views) - { - if ($view.IsSystemObject -eq $false -and ($view.name -like "*$name*" -or $name.Contains($view.name))) - { - #Return View Object - $view | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $view.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - } - - } # Select-SqlView - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlView $($_.Name)" - Select-SqlView $_ -name $name } - else - { throw 'Get-SqlView:Param `$db must be a database object.' } - } - } - end - { - if ($db) - { $db | Get-SqlView -name $name } - } - -} #Get-SqlView - -####################### -function Get-SqlUserDefinedDataType -{ - param($db, $name="*") - begin - { - function Select-SqlUserDefinedDataType ($db, $name="*") - { - - foreach ($userDefinedDataType in $db.UserDefinedDataTypes) - { - if ($userDefinedDataType.IsSystemObject -eq $false -and ($userDefinedDataType.name -like "*$name*" -or $name.Contains($userDefinedDataType.name))) - { - #Return UserDefinedDataType Object - $userDefinedDataType | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $userDefinedDataType.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - } - - } # Select-SqlUserDefinedDataType - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlUserDefinedDataType $($_.Name)" - Select-SqlUserDefinedDataType $_ -name $name } - else - { throw 'Get-SqlUserDefinedDataType:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlUserDefinedDataType -name $name } - } - -} #Get-SqlUserDefinedDataType - -####################### -function Get-SqlUserDefinedFunction -{ - param($db, $name="*") - begin - { - function Select-SqlUserDefinedFunction ($db, $name="*") - { - - foreach ($userDefinedFunction in $db.UserDefinedFunctions) - { - if ($userDefinedFunction.IsSystemObject -eq $false -and ($userDefinedFunction.name -like "*$name*" -or $name.Contains($userDefinedFunction.name))) - { - #Return UserDefinedFunction Object - $userDefinedFunction | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $userDefinedFunction.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - } - - } #Select-SqlUserFunction - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlUserDefinedFunction $($_.Name)" - Select-SqlUserDefinedFunction $_ -name $name } - else - { throw 'Get-SqlUserDefinedFunction:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlUserDefinedFunction -name $name } - } - -} #Get-SqlUserDefinedFunction - -####################### -function Get-SqlSynonym -{ - param($db, $name="*") - begin - { - function Select-SqlSynonym ($db, $name="*") - { - - foreach ($synonym in $db.Synonyms) - { - if ($synonym.name -like "*$name*" -or $name.Contains($synonym.name)) - { - #Return Synonym Object - $synonym | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $synonym.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - } - - } # Select-SqlSynonym - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlSynonym $($_.Name)" - Select-SqlSynonym $_ -name $name } - else - { throw 'Get-SqlSynonym:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlSynonym -name $name } - } - -} #Get-SqlSynonym - -####################### -function Get-SqlTrigger -{ - param($smo, $name="*") - begin - { - function Select-SqlTrigger ($smo, $name="*") - { - - foreach ($trigger in $smo.Triggers) - { - if ($trigger.name -like "*$name*" -or $name.Contains($trigger.name)) - { - switch ($smo.GetType().Name) - { - 'Server' { $server = $smo.Name } - 'Database' { $server = $smo.parent.Name; $dbname = $smo.Name } - #Default is table or view - Default { $server = $smo.parent.parent.Name; $dbname = $smo.parent.Name; $schema = $smo.parent.schema; $tbl = $smo.Name } - } - #Return Trigger Object - if ($trigger -ne $null) - { - $trigger | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $triggr.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $server -passthru | - add-Member -memberType noteProperty -name dbname -value $dbname -passthru | - add-Member -memberType noteProperty -name Schema -value $schema -passthru | - add-Member -memberType noteProperty -name Table -value $tbl -passthru - } - } - } - - } #Select-SqlTrigger - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Server' -or $_.GetType().Name -eq 'Database' -or $_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') - { Write-Verbose "Get-SqlTrigger $($_.Name)" - Select-SqlTrigger $_ -name $name } - else - { throw 'Get-SqlTrigger:Param `$smo must be a server, database, table or view object.' } - - } - } - end - { - if ($smo) - { $smo | Get-SqlTrigger -name $name } - } - -} #Get-SqlTrigger - -####################### -function Get-SqlColumn -{ - param($table) - begin - { - function Select-SqlColumn ($table) - { - - foreach ($column in $table.Columns) - { - #Return Column Object - $column | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $column.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | - add-Member -memberType noteProperty -name Schema -value $table.schema -passthru | - add-Member -memberType noteProperty -name Table -value $table.Name -passthru - } - - } # Select-SqlColumn - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') - { Write-Verbose "Get-SqlColumn $($_.Name)" - Select-SqlColumn $_ } - else - { throw 'Get-SqlColumn:Param `$table must be a table or view object.' } - - } - } - end - { - if ($table) - { $table | Get-SqlColumn } - } - -} #Get-SqlColumn - -####################### -function Get-SqlIndex -{ - param($table) - begin - { - function Select-SqlIndex ($table) - { - - foreach ($index in $table.Indexes) - { - #Return Index Object - $index | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $index.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name XMLIndexedColumns -value $(ConvertTo-IndexedColumnXML $index.IndexedColumns) -passthru | - add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | - add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | - add-Member -memberType noteProperty -name Table -value $table.Name -passthru - } - - } #Select-SqlIndex - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') - { Write-Verbose "Get-SqlIndex $($_.Name)" - Select-SqlIndex $_ } - else - { throw 'Get-SqlIndex:Param `$table must be a table or view object.' } - - } - } - end - { - if ($table) - { $table | Get-SqlIndex } - } - -} #Get-SqlIndex - -####################### -function Get-SqlStatistic -{ - param($table) - begin - { - function Select-SqlStatistic ($table) - { - - foreach ($statistic in $table.Statistics) - { - #Only return statistics not associated with indexes - if ($statistic.IsFromIndexCreation -eq $false) - { - #Return Statistic Object - $statistic | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $statistic.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name XMLStatisticColumns -value $(ConvertTo-StatisticColumnXML $statistic.StatisticColumns) -passthru | - add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | - add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | - add-Member -memberType noteProperty -name Table -value $table.Name -passthru - } - } - - } #Select-SqlStatistic - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') - { Write-Verbose "Get-SqlStatistic $($_.Name)" - Select-SqlStatistic $_ } - else - { throw 'Get-SqlStatistic:Param `$table must be a table or view object.' } - - } - } - end - { - if ($table) - { $table | Get-SqlStatistic } - } - -} #Get-SqlStatistic - -####################### -function Get-SqlCheck -{ - param($table) - begin - { - function Select-SqlCheck ($table) - { - - foreach ($Check in $table.Checks) - { - #Return Check Object - $Check | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $check.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | - add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | - add-Member -memberType noteProperty -name Table -value $table.Name -passthru - } - - } #Select-SqlCheck - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') - { Write-Verbose "Get-SqlCheck $($_.Name)" - Select-SqlCheck $_ } - else - { throw 'Get-SqlCheck:Param `$table must be a table or view object.' } - - } - } - end - { - if ($table) - { $table | Get-SqlCheck } - } - -} #Get-SqlCheck - -####################### -function Get-SqlForeignKey -{ - param($table) - begin - { - function Select-SqlForeignKey ($table) - { - - foreach ($ForeignKey in $table.ForeignKeys) - { - #Return ForeignKey Object - $ForeignKey | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $ForeignKey.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | - add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | - add-Member -memberType noteProperty -name Table -value $table.Name -passthru - } - - } #Select-SqlForeignKey - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') - { Write-Verbose "Get-SqlForeignKey $($_.Name)" - Select-SqlForeignKey $_ } - else - { throw 'Get-SqlForeignKey:Param `$table must be a table or view object.' } - - } - } - end - { - if ($table) - { $table | Get-SqlForeignKey } - } - -} #Get-SqlForeignKey - -####################### -function Set-SqlScriptingOptions -{ - param($optsFile="scriptopts.txt") - - #There 77 settable scripting options at the time of this writing, rather than set the options as parameters - #I've choosen to set them through a separate file. Modify the passed in file to set - #the various scriptingOptions to your liking. See the following MSDN link for a description of the settable options: - #http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions_members.aspx - Write-Verbose "Set-SqlScriptingOptions $optsFile" - - $ScriptingOptions = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions - if (test-path $scriptRoot\$optsFile) - { - $include = [System.IO.File]::ReadAllText("$scriptRoot\$optsFile") - invoke-expression $include - } - elseif (test-path $optsFile) - { - $include = [System.IO.File]::ReadAllText("$optsFile") - invoke-expression $include - } - - return $scriptingOptions - -} #Set-SqlScriptingOptions - -####################### -function Get-SqlScripter -{ - param($smo, $scriptingOptions=$(Set-SqlScriptingOptions)) - begin - { - function Select-SqlScripter ($smo, $scriptingOptions=$(Set-SqlScriptingOptions)) - { - $smo.Script($scriptingOptions) - - } #Select-SqlScripter - } - process - { - if ($_) - { - if ($_.GetType().Namespace -like "Microsoft.SqlServer.Management.Smo*") - { Write-Verbose "Get-SqlScripter $($_.Name)" - Select-SqlScripter $_ $scriptingOptions } - else - { throw 'Get-SqlScripter:Param `$smo must be an SMO object.' } - - } - } - end - { - if ($smo) - { $smo | Get-SqlScripter -scriptingOptions $scriptingOptions } - } - -} #Get-SqlScripter - -####################### -function Get-Information_Schema.Tables -{ - param($db,$name='%') - begin - { - function Select-Information_Schema.Tables ($db, $name='%') - { -$qry = @" -SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.TABLES -WHERE TABLE_TYPE = 'BASE TABLE' -AND OBJECTPROPERTY(OBJECT_ID('['+TABLE_SCHEMA+'].['+TABLE_NAME+']'),'IsMSShipped') = 0 -AND TABLE_NAME NOT IN ('dtproperties','sysdiagrams') -AND TABLE_NAME LIKE '%$name%' -"@ - Get-SqlData -dbname $db -qry $qry - } #Select-Information_Schema.Tables - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-Information_Schema.Tables $($_.Name)" - Select-Information_Schema.Tables $_ -name $name } - else - { throw 'Get-Information_Schema.Tables:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-Information_Schema.Tables -name $name } - } - -} #Get-Information_Schema.Tables - -####################### -function Get-Information_Schema.Columns -{ - param($db,$tblname='%',$colname='%') - begin - { - function Select-Information_Schema.Columns ($db,$tblname='%',$colname='%') - { -$qry = @" -SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.COLUMNS -WHERE TABLE_NAME NOT IN ('dtproperties','sysdiagrams') -AND OBJECTPROPERTY(OBJECT_ID('['+TABLE_SCHEMA+'].['+TABLE_NAME+']'),'IsMSShipped') = 0 -AND TABLE_NAME LIKE '%$tblname%' -AND COLUMN_NAME LIKE '%$colname%' -"@ - Get-SqlData -dbname $db -qry $qry - } #Select-Information_Schema.Columns - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-Information_Schema.Columns $($_.Name)" - Select-Information_Schema.Columns $_ -tblname $tblname -colname $colname } - else - { throw 'Get-Information_Schema.Columns:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-Information_Schema.Columns -tblname $tblname -colname $colname } - } - -} #Get-Information_Schema.Columns - -####################### -function Get-Information_Schema.Views -{ - param($db,$name='%') - begin - { - function Select-Information_Schema.Views ($db, $name='%') - { -$qry = @" -SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.VIEWS -WHERE TABLE_NAME like '%$name%' -AND OBJECTPROPERTY(OBJECT_ID('['+TABLE_SCHEMA+'].['+TABLE_NAME+']'),'IsMSShipped') = 0 -"@ - Get-SqlData -dbname $db -qry $qry - } #Select-Information_Schema.Views - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-Information_Schema.Views $($_.Name)" - Select-Information_Schema.Views $_ -name $name } - else - { throw 'Get-Information_Schema.Views:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-Information_Schema.Views -name $name } - } - -} #Get-Information_Schema.Views - -####################### -function Get-Information_Schema.Routines -{ - param($db,$name='%',$text='%') - begin - { - function Select-Information_Schema.Routines ($db, $name='%',$text='%') - { -$qry = @" -SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.ROUTINES -WHERE ROUTINE_NAME NOT LIKE 'sp_%diagram%' -AND OBJECTPROPERTY(OBJECT_ID('['+ROUTINE_SCHEMA+'].['+ROUTINE_NAME+']'),'IsMSShipped') = 0 -AND ROUTINE_NAME LIKE '%$name%' -AND ROUTINE_DEFINITION LIKE '%$text%' -"@ - Get-SqlData -dbname $db -qry $qry - } #Select-Information_Schema.Routines - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-Information_Schema.Routines $($_.Name)" - Select-Information_Schema.Routines $_ -name $name -text $text } - else - { throw 'Get-Information_Schema.Routines:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-Information_Schema.Routines -name $name -text $text } - } - -} #Get-Information_Schema.Routines - -####################### -function Get-SysDatabases -{ - param($sqlserver=$(throw 'Get-SysDatabases:`$sqlserver is required.'),$name='%') - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SysDatabases:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SysDatabases $($server.Name)" - - $db = Get-SqlDatabase $server 'master' -$qry = @" -SELECT SERVERPROPERTY('ServerName') AS Server, name FROM sysdatabases -WHERE name LIKE '%$name%' -"@ - Get-SqlData -dbname $db -qry $qry - -} #Get-SysDatabases - -####################### -function Get-SqlDataFile -{ - param($db) - begin - { - function Select-SqlDataFile ($db) - { - - foreach ($dataFile in $db.FileGroups | % {$_.Files}) - { - #Return DataFile Object - $dataFile | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name FileGroup -value $dataFile.parent.Name -passthru | - add-Member -memberType noteProperty -name FreeSpace -value $($dataFile.Size - $dataFile.UsedSpace) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - - } #Select-SqlDataFile - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlDataFile $($_.Name)" - Select-SqlDataFile $_ } - else - { throw 'Get-SqlDataFile:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlDataFile } - } - -} #Get-SqlDataFile - -####################### -function Get-SqlLogFile -{ - param($db) - begin - { - function Select-SqlLogFile ($db) - { - - foreach ($logFile in $db.LogFiles) - { - #Return LogFile Object - $logFile | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name FreeSpace -value $($logFile.Size - $logFile.UsedSpace) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - - } #Select-SqlLogFile - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlLogFile $($_.Name)" - Select-SqlLogFile $_ } - else - { throw 'Get-SqlLogFile:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlLogFile } - } - -} #Get-SqlLogFile - -####################### -function Get-SqlVersion -{ - param($sqlserver=$(throw 'Get-SqlVersion:`$sqlserver is required.')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlVersion:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlVersion $($server.Name)" - - $server.information | Select @{name='Server';Expression={$server.Name}}, Version - -}#Get-SqlVersion - -####################### -function Get-SqlPort -{ - param([string]$sqlserver=$(throw 'Get-SqlPort:`$sqlserver is required.')) - - #This can be done using Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer, - #but it has some severe limitations -- only support in 2005 or higher and must have a SQL - #instance installed locally, so back SQLDMO instead of SMO for this one - - $dmoServer = New-Object -comobject "SQLDMO.SQLServer" - $dmoServer.loginsecure = $true - $dmoServer.connect($sqlserver) - $tcpPort = $dmoServer.registry.tcpport - $dmoServer.close() - - new-object psobject | - add-member -pass NoteProperty Server $sqlserver | - add-member -pass NoteProperty TcpPort $tcpPort - -}#Get-SqlPort - -####################### -function ConvertTo-ExtendedPropertyXML -{ - param($extendedProperty=$(throw 'ConvertTo-SqlExtendedPropertyXML:`$extendedProperty is required.')) - - Write-Verbose "ConvertTo-SqlExtendedPropertyXML" - - foreach ($xp in $extendedProperty) - { - if ($xp.Name -ne $null -and $xp.Value -ne $null) - { $xpXML += [string] "" } - } - - Return $xpXML - -} #ConvertTo-ExtendedPropertyXML - -####################### -function Get-Sql -{ - param ($computer=$(throw 'Get-Sql:`$computer is required.')) - - if((get-wmiobject win32_pingstatus -Filter "address='$computer'").protocoladdress) - { - Get-WmiObject win32_service -computer $computer | -Where {($_.Name -Like "MSSQL*" -or $_.Name -Like "SQLAgent*" -or $_.Name -Like "SQLServer*" -or $_.Name -eq 'MSDTC') -and $_.Name -ne 'MSSQLServerADHelper'} | Select SystemName, Name, State, StartName | ft - } -} #Get-Sql - -####################### -function ConvertTo-StatisticColumnXML -{ - param($statisticColumn=$(throw 'ConvertTo-SqlStatisticColumnXML:`$statisticColumn is required.')) - - Write-Verbose "ConvertTo-SqlStatisticColumnXML" - - foreach ($wa in $statisticColumn) - { - $waXML += [string] "" - } - - Return $waXML - -} #ConvertTo-StatisticColumnXML - -####################### -function ConvertTo-IndexedColumnXML -{ - param($indexedColumn=$(throw 'ConvertTo-SqlIndexedColumnXML:`$indexedColumn is required.')) - - Write-Verbose "ConvertTo-SqlIndexedColumnXML" - - foreach ($ix in $indexedColumn) - { -$ixXML += [string] "" - } - - Return $ixXML - -} #ConvertTo-IndexedColumnXML - -####################### -function Invoke-SqlDatabaseCheck -{ - param($db) - - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { - Write-Verbose "Invoke-SqlDatabaseCheck $($_.Name)" - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $_.CheckTables('None') - } - else - { throw 'Invoke-SqlDatabaseCheck:Param db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Invoke-SqlDatabaseCheck } - } - -} #Invoke-SqlDatabaseCheck - -####################### -function Invoke-SqlIndexRebuild -{ - param($index) - - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Index') - { - Write-Verbose "Invoke-SqlIndexRebuild $($_.Name)" - Write-Host "Rebuilding Index $($_.Name)" - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $_.Rebuild() - } - else - { throw 'Invoke-SqlIndexRebuild:Param index must be a index object.' } - - } - } - end - { - if ($index) - { $index | Invoke-SqlIndexRebuild } - } - -} #Invoke-SqlIndexRebuild - -####################### -function Invoke-SqlIndexDefrag -{ - param($index) - - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Index') - { - Write-Verbose "Invoke-SqlIndexDefrag $($_.Name)" - Write-Host "Defraging Index $($_.Name)" - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $_.Reorganize() - } - else - { throw 'Invoke-SqlIndexDefrag:Param index must be a index object.' } - - } - } - end - { - if ($index) - { $index | Invoke-SqlIndexDefrag } - } - -} #Invoke-SqlIndexDefrag - -####################### -function Get-SqlIndexFragmentation -{ - param($index) - - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Index') - { Write-Verbose "Get-SqlIndexFragmentation $($_.Name)" - $_.EnumFragmentation() } - else - { throw 'Get-SqlIndexFragmentation:Param index must be a index object.' } - - } - } - end - { - if ($index) - { $index | Get-SqlIndexFragmentation } - } - -} #Get-SqlIndexFragmentation - -####################### -function Update-Statistic -{ - param($statistic, $scanType='Default', [int]$sampleValue, [switch]$recompute) - - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Statistic') - { - Write-Verbose "Update-Statistic $($_.Name)" - Write-Host "Updating statistic $($_.Name)" - - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - if ($sampleValue -and $recompute) - { $_.Update($scanType, $sampleValue, $true) } - elseif ($sampleValue) - { $_.Update($scanType, $sampleValue) } - else - { $_.Update($scanType) } - - } - else - { throw 'Update-Statistic:Param statistic must be a statistic object.' } - - } - } - end - { - if ($statistic) - { $statistic | Update-Statistic } - } - -} #Update-Statistic - -####################### -function Invoke-SqlBackup -{ - param($sqlserver=$(throw 'sqlserver required.'),$dbname=$(throw 'dbname required.'),$filepath=$(throw 'filepath required.') - ,$action='Database', $description='',$name='',[switch]$force,[switch]$incremental,[switch]$copyOnly) - - #action can be Database or Log - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Invoke-SqlBackup:Param sqlserver must be a String or Server object.' } - } - - Write-Verbose "Invoke-SqlBackup $($server.Name) $dbname" - - $backup = new-object ("Microsoft.SqlServer.Management.Smo.Backup") - $backupDevice = new-object ("Microsoft.SqlServer.Management.Smo.BackupDeviceItem") $filepath, 'File' - - $backup.Action = $action - $backup.BackupSetDescription = $description - $backup.BackupSetName = $name - if (!$server.Databases.Contains("$dbname")) {throw 'Database $dbname does not exist on $($server.Name).'} - $backup.Database = $dbname - $backup.Devices.Add($backupDevice) - $backup.Initialize = $($force.IsPresent) - $backup.Incremental = $($incremental.IsPresent) - if ($copyOnly) - { if ($server.Information.Version.Major -ge 9 -and $smoVersion -ge 10) - { $backup.CopyOnly = $true } - else - { throw 'CopyOnly is supported in SQL Server 2005(9.0) or higher with SMO version 10.0 or higher.' } - } - - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $backup.SqlBackup($server) - - if ($?) - { Write-Host "$action backup of $dbname to $filepath complete." } - else - { Write-Host "$action backup of $dbname to $filepath failed." } - -} #Invoke-SqlBackup - -####################### -function Invoke-SqlRestore -{ - param($sqlserver=$(throw 'sqlserver required.'),$dbname=$(throw 'dbname required.'),$filepath=$(throw 'filepath required.'), - $action='Database',$stopat,$relocatefiles,[switch]$force,[switch]$norecovery,[switch]$keepreplication) - - #action can be Database or Log - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Invoke-SqlRestore:Param sqlserver must be a String or Server object.' } - } - - Write-Verbose "Invoke-SqlRestore $($server.Name) $dbname" - - $restore = new-object ("Microsoft.SqlServer.Management.Smo.Restore") - $restoreDevice = new-object ("Microsoft.SqlServer.Management.Smo.BackupDeviceItem") $filepath, 'File' - - $restore.Action = $action - $restore.Database = $dbname - $restore.Devices.Add($restoreDevice) - $restore.ReplaceDatabase = $($force.IsPresent) - $restore.NoRecovery = $($norecovery.IsPresent) - $restore.KeepReplication = $($keepreplication.IsPresent) - - if ($stopat) - { $restore.ToPointInTime = $stopAt } - - if ($relocatefiles) - { - if ($relocateFiles.GetType().Name -ne 'Hashtable') - { throw 'Invoke-SqlRestore:Param relocateFile must be a hashtable' } - - $relocateFileAR = New-Object Collections.ArrayList - - foreach ($i in $relocatefiles.GetEnumerator()) - { - $logicalName = $($i.Key); $physicalName = $($i.Value); - $relocateFile = new-object ("Microsoft.SqlServer.Management.Smo.RelocateFile") $logicalName, $physicalName - [void]$relocateFileAR.Add($relocateFile) - } - - $restore.RelocateFiles = $relocateFileAR - - } - - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $restore.SqlRestore($server) - - if ($?) - { Write-Host "$action restore of $dbname from $filepath complete." } - else - { Write-Host "$action restore of $dbname from $filepath failed." } - -} #Invoke-SqlRestore - -####################### -function Remove-SqlDatabase -{ - - param($sqlserver,$dbname) - - $db = Get-SqlDatabase $sqlserver $dbname - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $db.Drop() - -} #Remove-SqlDatabase - -####################### -function Add-SqlFileGroup -{ - param($db=$(throw 'db is required.'), $name=$(throw 'name is required.')) - - $fileGroup = new-object ('Microsoft.SqlServer.Management.Smo.FileGroup') $db, $name - - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $db.FileGroups.Add($fileGroup) - - return $fileGroup - -} #Add-SqlFileGroup - -####################### -function Add-SqlDataFile -{ - param($filegroup=$(throw 'filegroup is required.'), $name=$(throw 'name is required.'), $filepath=$(throw 'filepath is required.') - ,$size, $growthType, $growth, $maxSize) - #GrowthType is KB, None, Percent - $dataFile = new-object ('Microsoft.SqlServer.Management.Smo.DataFile') $filegroup, $name - $dataFile.FileName = $filepath - if ($size) - { $dataFile.Size = $size } - if ($growthType) - { $dataFile.GrowthType = $growthType } - if ($growth) - { $dataFile.Growth = $growth } - if ($maxSize) - { $dataFile.MaxSize = $maxSize } - - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $filegroup.Files.Add($dataFile) - -} #Add-SqlDataFile - -####################### -function Add-SqlLogFile -{ - param($db=$(throw 'db is required.'), $name=$(throw 'name is required.'), $filepath=$(throw 'filepath is required.') - ,$size, $growthType, $growth, $maxSize) - #GrowthType is KB, None, Percent - $logFile = new-object ('Microsoft.SqlServer.Management.Smo.LogFile') $db, $name - $logFile.FileName = $filepath - if ($size) - { $logFile.Size = $size } - if ($growthType) - { $logFile.GrowthType = $growthType } - if ($growth) - { $logFile.Growth = $growth } - if ($maxSize) - { $logFile.MaxSize = $maxSize } - - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $db.LogFiles.Add($logFile) - -} #Add-SqlLogFile - -####################### -function Add-SqlDatabase -{ - param($sqlserver=$(throw 'sqlserver required.'),$dbname=$(throw 'dbname required.'), - $dataName, $dataFilePath, $dataSize, $dataGrowthType, $dataGrowth, $dataMaxSize, - $logName, $logFilePath, $logSize, $logGrowthType, $logGrowth, $logMaxSize) - #GrowthType is KB, None, Percent - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Add-SqlDatabase:Param sqlserver must be a String or Server object.' } - } - - Write-Verbose "Add-SqlDatabase $($server.Name) $dbname" - - if ($server.Databases.Contains("$dbname")) {throw 'Database $dbname already exists on $($server.Name).'} - - $db = new-object ('Microsoft.SqlServer.Management.Smo.Database') $server, $dbname - - #Need to implement overloaded method if migrated to compiled cmdlet - - if (!($logName)) - { $dataName = $dbname } - if (!($dataFilePath)) - { $dataFilePath = $(Get-SqlDefaultDir $server 'Data') + '\' + $dbname + '.mdf' } - if (!($logName)) - { $logName = $dbname + '_log' } - if (!($logFilePath)) - { $logFilePath = $(Get-SqlDefaultDir $server 'Log') + '\' + $dbname + '_log.ldf' } - - $fileGroup = Add-SqlFileGroup $db 'PRIMARY' -Add-SqlDataFile -filegroup $fileGroup -name $dataName -filepath $dataFilePath -size $dataSize -growthtype $dataGrowthType -growth $dataGrowth -maxsize $dataMaxSize - -Add-SqlLogFile -db $db -name $logName -filepath $logFilePath -size $logSize -growthtype $logGrowthType -growth $logGrowth -maxsize $logMaxSize - - trap { - $ex = $_.Exception - Write-Output $ex.message - $ex = $ex.InnerException - while ($ex.InnerException) - { - Write-Output $ex.InnerException.message - $ex = $ex.InnerException - }; - continue - } - $db.Create() - -} #Add-SqlDatabase - -####################### -function Get-SqlDefaultDir -{ - param ($sqlserver, $dirtype) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlDefaultDir:Param sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlDefaultDir $($server.Name)" - - #The DefaultFile and DefaultLog properties are only written to registry if you modify the properties in SSMS - #even setting the properties to same value will create the registry keys. - #If the properties have not been created used the InstallDataDirectory properties. This seems to recreate how - #SSMS works. I thought about adding this properties to the server object in Get-SqlServer, but felt it was important - #not to mask whether the default directories had been set or not. You should always set the default directories as - #a configuration task - switch ($dirtype) - { - 'Data' { if ($server.DefaultFile) { $server.DefaultFile } else { $server.InstallDataDirectory + '\' + 'Data' } } - 'Log' { if ($server.DefaultLog) { $server.DefaultLog } else { $server.InstallDataDirectory + '\' + 'Data' } } - default { throw 'Get-SqlDefaultDir:Param dirtype must be Data or Log.' } - } - -} #Get-SqlDefaultDir - -####################### -function Add-SqlUser -{ - param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required'),$login=$name,$defaultSchema='dbo') - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Add-SqlUser:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Add-SqlUser $($db.Name) $name" - - if($db.Users | where {$_.name -eq $name}) - { throw "User $name already exists in Database $dbname." } - else - { - $user = new-object ('Microsoft.SqlServer.Management.Smo.User') $db, $name - $user.Login = $login - $user.DefaultSchema = $defaultschema - $user.Create() - } - -} #Add-SqlUser - -####################### -function Remove-SqlUser -{ - param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Remove-SqlUser:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Remove-SqlUser $($db.Name) $name" - - $user = Get-SqlUser $db | where {$_.name -eq $name} - if ($user) - { $user.Drop() } - else - { throw "User $name does not exist in database $($db.Name)." } - -} #Remove-SqlUser - -####################### -function Add-SqlLogin -{ - param($sqlserver=$(throw 'sqlserver is required'),$name=$(throw 'name is required'),$password,$logintype, - $DefaultDatabase='master', [switch]$PasswordExpirationEnabled,[switch]$PasswordPolicyEnforced) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Add-SqlLogin:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlDatabase $($server.Name) $dbname" - - if($server.Logins | where {$_.name -eq $name}) - { throw "Login $name already exists on Server $($server.Name)." } - else - { - $login = new-object ('Microsoft.SqlServer.Management.Smo.Login') $server, $name - $login.DefaultDatabase = $defaultDatabase - - if ($logintype -eq 'SqlLogin') - { - $login.LoginType = $logintype - $login.PasswordExpirationEnabled = $($PasswordExpirationEnabled.IsPresent) - $login.PasswordPolicyEnforced = $($PasswordPolicyEnforced.IsPresent) - $login.Create($password) - } - elseif ($logintype -eq 'WindowsUser' -or $logintype -eq 'WindowsGroup') - { - $login.LoginType = $logintype - $login.Create() - } - else - { throw 'logintype must be SqlLogin, WindowsUser or WindowsGroup.' } - } - -} #Add-SqlLogin - -####################### -function Remove-SqlLogin -{ - - param($sqlserver=$(throw 'sqlserver is required'),$name=$(throw 'name is required')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Remove-SqlLogin:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Remove-SqlLogin $($server.Name) $name" - - $login = Get-SqlLogin $server | where {$_.name -eq $name} - if ($login) - { $login.Drop() } - else - { throw "Login $name does not exist on server $($server.Name)." } - -} #Remove-SqlLogin - -####################### -function Add-SqlServerRoleMember -{ - param($sqlserver=$(throw 'sqlserver is required'),$loginame=$(throw 'loginame is required'),$rolename=$(throw 'rolename is required')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Add-SqlServerRoleMember:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Add-SqlServerRoleMember $($server.Name) $name" - - if($server.Logins | where {$_.name -eq $loginame}) - { - $svrole = Get-SqlServerRole $server | where {$_.name -eq $rolename} - - if ($svrole) - { $svrole.AddMember($loginame) } - else - { throw "ServerRole $rolename does not exist on server $($server.Name)." } - } - else - { throw "Login $loginame does not exist on server $($server.Name)." } - -} #Add-SqlServerRoleMember - -####################### -function Remove-SqlServerRoleMember -{ - param($sqlserver=$(throw 'sqlserver is required'),$loginame=$(throw 'loginame is required'),$rolename=$(throw 'rolename is required')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Remove-SqlServerRoleMember:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Remove-SqlServerRoleMember $($server.Name) $name" - - if($server.Logins | where {$_.name -eq $loginame}) - { - $svrole = Get-SqlServerRole $server | where {$_.name -eq $rolename} - - if ($svrole) - { $svrole.DropMember($loginame) } - else - { throw "ServerRole $rolename does not exist on server $($server.Name)." } - } - else - { throw "Login $loginame does not exist on server $($server.Name)." } - -} #Remove-SqlServerRoleMember - -####################### -function Add-SqlDatabaseRole -{ - param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Add-SqlDatabaseRole:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Add-SqlDatabaseRole $($db.Name) $name" - - if($db.Roles | where {$_.name -eq $name}) - { throw "DatabaseRole $name already exists in Database $($db.Name)." } - else - { - $role = new-object ('Microsoft.SqlServer.Management.Smo.DatabaseRole') $db, $name - $role.Create() - } - -} #Add-SqlDatabaseRole - -####################### -function Remove-SqlDatabaseRole -{ - param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Remove-SqlDatabaseRole:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Remove-SqlDatabaseRole $($db.Name) $name" - - $role = Get-SqlDatabaseRole $db | where {$_.name -eq $name} - - if ($role) - { $role.Drop() } - else - { throw "DatabaseRole $name does not exist in database $($db.Name)." } - -} #Remove-SqlDatabaseRole - -####################### -function Add-SqlDatabaseRoleMember -{ - param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required'),$rolename=$(throw 'rolename is required')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Add-SqlDatabaseRoleMember:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Add-SqlDatabaseRoleMember $($db.Name) $name $rolename" - - if(($db.Users | where {$_.name -eq $name}) -or ($db.Roles | where {$_.name -eq $name})) - { - $role = Get-SqlDatabaseRole $db | where {$_.name -eq $rolename} - - if ($role) - { $role.AddMember($name) } - else - { throw "DatabaseRole $rolename does not exist in database $($db.Name)." } - } - else - { throw "Role or User $name does not exist in database $($db.Name)." } - -} #Add-SqlDatabaseRoleMember - -####################### -function Remove-SqlDatabaseRoleMember -{ - param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required'),$rolename=$(throw 'rolename is required')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Remove-SqlDatabaseRoleMember:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Remove-SqlDatabaseRoleMember $($db.Name) $name $rolename" - - if(($db.Users | where {$_.name -eq $name}) -or ($db.Roles | where {$_.name -eq $name})) - { - $role = Get-SqlDatabaseRole $db | where {$_.name -eq $rolename} - - if ($role) - { $role.DropMember($name) } - else - { throw "DatabaseRole $rolename does not exist in database $($db.Name)." } - } - else - { throw "Role or User $name does not exist in database $($db.Name)." } - -} #Remove-SqlDatabaseRoleMember - -####################### -function Set-SqlServerPermission -{ - param($sqlserver=$(throw 'sqlserver is required'),$permission=$(throw 'permission is required'),$name=$(throw 'name is required'),$action=$(throw 'action is required')) - -#Valid serverpermissions: -#AdministerBulkOperations AlterAnyConnection AlterAnyCredential AlterAnyDatabase AlterAnyEndpoint AlterAnyEventNotification -#AlterAnyLinkedServer AlterAnyLogin AlterAnyServerAudit AlterResources AlterServerState AlterSettings AlterTrace AuthenticateServer -#ConnectSql ControlServer CreateAnyDatabase CreateDdlEventNotification CreateEndpoint CreateTraceEventNotification ExternalAccessAssembly -#UnsafeAssembly ViewAnyDatabase ViewAnyDefinition ViewServerState - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Set-SqlServerPermission:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Set-SqlServerPermission $($server.Name) $serverpermission $name $action" - - if($server.Logins | where {$_.name -eq $name}) - { - $perm = new-object ('Microsoft.SqlServer.Management.Smo.ServerPermissionSet') - $perm.$permission = $true - - switch ($action) - { - 'Grant' { $server.Grant($perm,$name) } - 'Deny' { $server.Deny($perm,$name) } - 'Revoke' { $server.Revoke($perm,$name) } - default { throw 'Set-SqlServerPermission:Param `$action must be Grant, Deny or Revoke.' } - } - } - else - { throw "Login $name does not exist on server $($server.Name)." } - -} #Set-SqlServerPermission - -####################### -function Set-SqlDatabasePermission -{ - param($sqlserver=$(throw 'sqlserver is required'),$dbname=$(throw 'dbname is required'),$permission=$(throw 'permission is required'),$name=$(throw 'name is required'),$action=$(throw 'action is required')) - -#Valid databasepermissions: -#Alter AlterAnyApplicationRole AlterAnyAssembly AlterAnyAsymmetricKey AlterAnyCertificate AlterAnyContract AlterAnyDatabaseAudit -#AlterAnyDatabaseDdlTrigger AlterAnyDatabaseEventNotification AlterAnyDataspace AlterAnyFulltextCatalog AlterAnyMessageType -#AlterAnyRemoteServiceBinding AlterAnyRole AlterAnyRoute AlterAnySchema AlterAnyService AlterAnySymmetricKey AlterAnyUser Authenticate -#BackupDatabase BackupLog Checkpoint Connect ConnectReplication Control CreateAggregate CreateAssembly CreateAsymmetricKey CreateCertificate -#CreateContract CreateDatabase CreateDatabaseDdlEventNotification CreateDefault CreateFulltextCatalog CreateFunction CreateMessageType -#CreateProcedure CreateQueue CreateRemoteServiceBinding CreateRole CreateRoute CreateRule CreateSchema CreateService CreateSymmetricKey -#CreateSynonym CreateTable CreateType CreateView CreateXmlSchemaCollection Delete Execute Insert References Select Showplan -#SubscribeQueryNotifications TakeOwnership Update ViewDatabaseState ViewDefinition - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Set-SqlDatabasePermission:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Set-SqlDatabasePermission $($db.Name) $name $permission $action" - - if(($db.Users | where {$_.name -eq $name}) -or ($db.Roles | where {$_.name -eq $name})) - { - $perm = new-object ('Microsoft.SqlServer.Management.Smo.DatabasePermissionSet') - $perm.$permission = $true - - switch ($action) - { - 'Grant' { $db.Grant($perm,$name) } - 'Deny' { $db.Deny($perm,$name) } - 'Revoke' { $db.Revoke($perm,$name) } - default { throw 'Set-SqlDatabasePermission:Param `$action must be Grant, Deny or Revoke.' } - } - } - else - { throw "Role or User $name does not exist in database $($db.Name)." } - -} #Set-SqlDatabasePermission - -####################### -function Set-SqlObjectPermission -{ - - param($permission=$(throw 'permission is required'),$name=$(throw 'name is required'),$action=$(throw 'action is required')) -#Alter Connect Control Delete Execute Impersonate Insert Receive References Select Send TakeOwnership Update ViewChangeTracking ViewDefinition -#Example: Get-SqlDatabase 'Z002\Sql1 pubs | get-sqlschema -name dbo | set-sqlobjectpermission -permission Select -name test5 -action Grant - process - { - $smo = $_ - if ($smo.GetType().Namespace -like "Microsoft.SqlServer.Management.Smo*") - { - Write-Verbose "Set-SqlObjectPermission $($smo.Name) $permission $name $action" - - if(($smo.Parent.Users | where {$_.name -eq $name}) -or ($_.Parent.Roles | where {$_.name -eq $name})) - { - $perm = new-object ('Microsoft.SqlServer.Management.Smo.ObjectPermissionSet') - $perm.$permission = $true - - switch ($action) - { - 'Grant' { $smo.Grant($perm,$name) } - 'Deny' { $smo.Deny($perm,$name) } - 'Revoke' { $smo.Revoke($perm,$name) } - default { throw 'Set-SqlObjectPermission:Param `$action must be Grant, Deny or Revoke.' } - } - } - else - { throw "Role or User $name does not exist in database $($db.Name)." } - } - else - { throw ' Set-SqlObjectPermission:Param smo must be an smo database object (schema, table, view, storedprocedure, UDF, or synonym).' } - } - -} #Set-SqlObjectPermission - -####################### -function Get-SqlSchema -{ - param($db, $name="*") - begin - { - function Select-SqlSchema ($db, $name="*") - { - - foreach ($schema in $db.Schemas) - { - if ($schema.name -like "*$name*" -or $name.Contains($schema.name)) - { - #Return schema Object - $schema | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | - add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $schema.ExtendedProperties) -passthru | - add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | - add-Member -memberType noteProperty -name dbname -value $db.Name -passthru - } - } - - } #Select-Sqlschema - } - process - { - if ($_) - { - if ($_.GetType().Name -eq 'Database') - { Write-Verbose "Get-SqlSchema $($_.Name)" - Select-Sqlschema $_ -name $name } - else - { throw 'Get-SqlSchema:Param `$db must be a database object.' } - - } - } - end - { - if ($db) - { $db | Get-SqlSchema -name $name } - } - -} #Get-SqlSchema - -####################### -function Get-SqlProcess -{ - param($sqlserver=$(throw 'sqlserver is required'),$spid,$name,[switch]$excludeSystemProcesses) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw "Get-SqlProcess:Param '`$sqlserver' must be a String or Server object." } - } - - Write-Verbose "Get-SqlProcess $($server.Name)" - - if ($spid) - { $server.EnumProcesses($spid) } - elseif ($name) - { $server.EnumProcesses($name) } - else - { $server.EnumProcesses($($excludeSystemProcesses.IsPresent)) } - -} #Get-SqlProcess - -####################### -function Get-SqlTransaction -{ - param($sqlserver,$dbname=$(throw 'dbname is required')) - - switch ($dbname.GetType().Name) - { - 'String' { $db = Get-SqlDatabase $sqlserver $dbname } - 'Database' { $db = $dbname } - default { throw "Get-SqlTransaction:Param '`$dbname' must be a String or Database object." } - } - - Write-Verbose "Get-SqlTransaction $($db.Name)" - - $db.EnumTransactions() - -} #Get-SqlTransaction - -####################### -function Get-SqlErrorLog -{ - param($sqlserver=$(throw 'sqlserver is required'),$lognumber=0) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw "Get-SqlErrorLog:Param '`$sqlserver' must be a String or Server object." } - } - - Write-Verbose "Get-SqlErrorLog $($server.Name)" - $server.ReadErrorLog($lognumber) - -} #Get-SqlErrorLog - -####################### -function Get-SqlEdition -{ - param($sqlserver=$(throw 'Get-SqlEdition:`$sqlserver is required.')) - - switch ($sqlserver.GetType().Name) - { - 'String' { $server = Get-SqlServer $sqlserver } - 'Server' { $server = $sqlserver } - default { throw 'Get-SqlEdition:Param `$sqlserver must be a String or Server object.' } - } - - Write-Verbose "Get-SqlEdition $($server.Name)" - - $server.information | Select @{name='Server';Expression={$server.Name}}, Edition - -}#Get-SqlEdition - +# --------------------------------------------------------------------------- +### +# --------------------------------------------------------------------------- +[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") +$smoAssembly = [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") +if (!($smoVersion)) +{ Set-Variable -name SmoVersion -value $smoAssembly.GetName().Version.Major -Scope Global -Option Constant -Description "SQLPSX variable" } +[reflection.assembly]::LoadWithPartialName('Microsoft.SqlServer.SMOExtended') > $null + +$scriptRoot = Split-Path (Resolve-Path $myInvocation.MyCommand.Path) +. $scriptRoot\LibraryShowMbrs.ps1 + +Set-Alias Get-InvalidLogins $scriptRoot\Get-InvalidLogins.ps1 +Set-Alias Get-SessionTimeStamp $scriptRoot\Get-SessionTimeStamp.ps1 + +####################### +function Get-SqlConnection +{ + param([string]$sqlserver=$(Throw 'Get-SqlConnection:`$sqlserver is required.'),[string]$Username,[string]$Password) + + Write-Verbose "Get-SqlConnection $sqlserver" + + if($Username -and $Password) + { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver,$Username,$Password } + else + { $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver } + + $con.Connect() + + return $con + +} #Get-ServerConnection + +####################### +function Get-SqlServer +{ + param([string]$sqlserver=$(throw 'Get-SqlServer:`$sqlserver is required.'),[string]$Username,[string]$Password) + #When $sqlserver passed in from the SMO Name property, brackets + #are automatically inserted which then need to be removed + $sqlserver = $sqlserver -replace "\[|\]" + + Write-Verbose "Get-SqlServer $sqlserver" + + $con = Get-SqlConnection $sqlserver $Username $Password + + $server = new-object ("Microsoft.SqlServer.Management.Smo.Server") $con + $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.StoredProcedure], "IsSystemObject") + $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.Table], "IsSystemObject") + $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.View], "IsSystemObject") + $server.SetDefaultInitFields([Microsoft.SqlServer.Management.SMO.UserDefinedFunction], "IsSystemObject") + #trap { "Check $SqlServer Name"; continue} $server.ConnectionContext.Connect() + return $server + +} #Get-SqlServer + +####################### +function Get-SqlDatabase +{ + param($sqlserver=$(throw 'Get-SqlDatabase:`$sqlserver is required'),[string]$dbname) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlDatabase:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlDatabase $($server.Name) $dbname" + + if ($dbname) + { if (!$server.Databases.Contains("$dbname")) {throw 'Check $dbname Name.'} + else { + if ($server.Databases[$dbname].IsAccessible -eq $false) {throw "Database $dname not accessible."} + else {$server.Databases[$dbname]} + } + } + else + #Skip systems databases + { $server.Databases | where {$_.IsSystemObject -eq $false -and $_.IsAccessible -eq $true} } + +} # Get-SqlDatabase + +####################### +function Get-SqlData +{ + param($sqlserver,$dbname=$(throw 'Get-SqlData:`$dbname is required.'),[string]$qry=$(throw 'Get-SqlData:`$qry is required.')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Get-SqlData:Param '`$dbname' must be a String or Database object." } + } + + #Write-Verbose "Get-SqlData $($db.Parent.Name) $($db.Name) $qry" + Write-Verbose "Get-SqlData $($db.Parent.Name) $($db.Name)" + + $ds = $db.ExecuteWithResults("$qry") + $ds.Tables | foreach { $_.Rows} + +}# Get-SqlData + +####################### +function Set-SqlData +{ + param($sqlserver,$dbname=$(throw 'Set-SqlData:`$dbname is required.'),[string]$qry=$(throw 'Set-SqlData:`$qry is required.')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Set-SqlData:Param '`$dbname' must be a String or Database object." } + } + + #Write-Verbose "Set-SqlData $($db.Parent.Name) $($db.Name) $qry" + Write-Verbose "Set-SqlData $($db.Parent.Name) $($db.Name)" + + $db.ExecuteNonQuery("$qry") + +}# Set-SqlData + +####################### +function ConvertTo-MemberXml +{ + param($member) + + $xmlMember = $null + $member | foreach { $xmlMember += "$_"} + return $xmlMember + +}# ConvertTo-MemberXml + +####################### +function Get-SqlShowMbrs +{ + param($server,[string]$group=$(throw 'Get-SqlShowMbrs:`$group is required.')) + + if ($server.GetType().Name -ne 'Server') + { throw 'Get-SqlShowMbrs:Param `$server must be a Server object.' } + + Write-Verbose "Get-SqlShowMbrs $($server.Name) $group" + + New-ShowMbrs + + #The call to EnumWindowsGroupInfo will error out on groups which have been removed from AD or + #which have been renamed. We need to check for this condition when enumerating groups + #Individual logins may also be orphaned so we will skip orphaned and enumerate the renamed group + #for renamed groups. As a best practice you should run Get-InvalidLogins to identifiy logins/groups and drop + #orphaned logins or recreate renamed logins to maintain consistency with Active Directory + $invalidLogin = @() + Get-InvalidLogins $server.Name | foreach {$invalidLogin += $_.NTLogin} + $renamed = @{} + Get-InvalidLogins $server.Name | where {$_.IsRenamed -eq $true} | foreach {$renamed[$_.NTLogin] = $_.NewNTAccount} + + #if group is a valid login i.e. not in invalidLogin array then enumerate it + if (!($invalidLogin -contains $group )) + { + #EnumWindowsGroupInfo is somewhat unreliable, for instance MyServer\SQLServer2005MSSQLUser$MyServer$Myinstance + #will return null but using a WMI query will return group information. EnumWindowsGroupInfo does not work + #for groups which have not been granted access to the SQ instnace. since we are using a global session variable + #to store group user membership the Builtin group is not unique (all other group members should be i.e. a domain + #or computer cannot have duplicate group names). So Builtin needs to be handled specially + if ($group -eq 'BUILTIN\Administrators') + { + #if we've already enumerated Builtin perhaps for another server remove it and re-enumerate it + $__SQLPSXGroupUser.remove('BUILTIN\Administrators') + + if ($server.Information.IsClustered) + { $allNodes = Get-WmiObject -class MSCluster_Node -namespace "root\mscluster" -computername $($server.Information.NetName) | select name + foreach ($node in $allNodes) + { Get-GroupUser "$($node.name)\Administrators" 'BUILTIN\Administrators'}} + else + + { Get-GroupUser "$($server.Information.NetName)\Administrators" 'BUILTIN\Administrators'} + } + else + { Get-GroupUser $group } + } + #if the group is invalid but has been renamed in AD thus still has access to SQL Server enumerate the new group name + elseif ($renamed.Contains($group)) + { + Get-GroupUser $renamed[$group] + } + + return $__SQLPSXGroupUser[$group] + +} #Get-SqlShowMbrs + +####################### +function Get-SqlUser +{ + param($db) + begin + { + function Select-SqlUser ($db) + { + foreach ($user in $db.Users | where {$_.UserType.ToString() -ne 'Certificate'}) + { + $member = @() + + if ($user.HasDBAccess) + { + $member += @($(Get-SqlUserMember $user)) + $object = $null + + #Get objects owned by user, this part is slow with SQL 2000, In 2005 if user owns an object only the schema is listed + #as the owned object, so even though SQL 2000 does really doesn't have schemas, will just report they do. + if ($db.Parent.Information.Version.Major -ge 9) + { + foreach ($urn in $user.EnumOwnedObjects()) + { + $object += [string] "" + } + } + elseif ($user.EnumOwnedObjects() -ne $null) + { $object += [string] "" } + + #Return SqlUser Object + $user | add-Member -memberType noteProperty -name members -value $member -passthru | + add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name objects -value $object -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + + } + } + + } #Select-SqlUser + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlUser $($_.Name)" + Select-SqlUser $_ } + else + { throw 'Get-SqlUser:Param `$db must be a database object.' } + } + } + end + { + if ($db) + { $db | Get-SqlUser } + } + +} # Get-SqlUser + +####################### +function New-SqlUserMember +{ + Write-Verbose "New-SqlUserMember" + + #__SQLPSXUserMember is a session variable, so only create if it doesn't exist + if (!(Test-Path Variable:__SQLPSXUserMember)) + { Set-Variable __SQLPSXUserMember @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } + +} #New-SQLUserMember + +####################### +function Get-SqlUserMember +{ + param($user,$db) + + Write-Verbose "Get-SqlUserMember $($user.Name) $($db.Name)" + + New-SqlUserMember + + if ($user -and $user.GetType().Name -eq 'User') + { + $key = $null + $key = $user.parent.parent.name + "." + $user.parent.name + + if(!($__SQLPSXUserMember.$key.$($user.Name))) { + $member = @() + $tmpMember = $null + if ($user.LoginType -eq 1) + { + $tmpMember = Get-SqlShowMbrs $user.parent.parent $user.Login + if ($tmpMember -ne $null) + {$member += $tmpMember} + } + + #If Guest user i.e. UserType = NoLogin + if ($user.UserType.ToString() -eq 'NoLogin' -or $user.Name -eq 'guest') + { $member += $user.Name } + elseif ($member -notcontains $user.Login) + { $member += $user.Login } + #Add member to global hash + $__SQLPSXUserMember[$key] += @{$user.Name = $member} + #Return member array + Return $member + } + else + { $__SQLPSXUserMember.$key.$($user.Name) } + } + elseif ($db -and $db.GetType().Name -eq 'Database') + { + $key = $null + $key = $db.parent.name + "." + $db.name + if(!($__SQLPSXUserMember[$key])) { + Get-SqlUser $db > $null + #Return User Hash + $__SQLPSXUserMember[$key] + } + else + #Return Login Hash + { $__SQLPSXUserMember[$key] } + } + else + { throw 'Get-SqlUserMember:Param `$user or `$db missing or invalid type.' } + +} # Get-SqlUserMember + +####################### +function Get-SqlDatabaseRole +{ + param($db) + begin + { + function Select-SqlDatabaseRole ($db) + { + + foreach ($role in $db.Roles) + { + $member = @() + $member += @($(Get-SqlDatabaseRoleMember $role)) + + #Return DatabaseRole Object + $role | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name members -value $member -passthru | + add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + + } + + } # Select-SqlDatabaseRole + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlDatabaseRole $($_.Name)" + Select-SqlDatabaseRole $_ } + else + { throw 'Get-SqlDatabaseRole:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlDatabaseRole } + } + +} #Get-SqlDatabaseRole + +####################### +function New-SqlDatabaseRoleMember +{ + Write-Verbose "New-SqlDatabaseRoleMember" + + #__SQLPSXDatabaseRoleMember is a session variable, so only create if it doesn't exist + if (!(Test-Path Variable:__SQLPSXDatabaseRoleMember)) + { Set-Variable __SQLPSXDatabaseRoleMember @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } + +} #New-SqlDatabaseRoleMember + +####################### +function Get-SqlDatabaseRoleMember +{ + param($role,$db) + + Write-Verbose "Get-SqlDatabaseRoleMember $($role.Name) $($db.Name)" + + New-SqlDatabaseRoleMember + + if ($role -and $role.GetType().Name -eq 'DatabaseRole') + { + $key = $null + $key = $role.parent.parent.name + "." + $role.parent.name + + if(!($__SQLPSXDatabaseRoleMember.$key.$($role.Name))) { + $user = @{} + $user = Get-SqlUserMember -db $role.parent + + $member = @() + $tmpMember = @() + + #Although public is a role its members cannot be enumerated using EnumMembers() + if (!($role.Name -eq "public")) + { + #The EnumMembers() method will recursively (reports nested role members) enumerate role membership for you + #Thank You Microsoft SMO Developers! + #List only members that are Roles or valid users i.e. users which meet condition in get-sqluser, this will + #eliminate users that do not have access to the database (orphaned DB users) + $tmpMember = $role.EnumMembers() | where { $role.parent.Roles.Contains($_) -or $user.Contains($_) } + if ($tmpMember -ne $null) + {$member += $tmpMember} + $member += $role.Name + #Now let's re-enumerate and flatten out Windows group membership, adding the SqlUser Objects members array + #However we will ensure we only list an individual login once + $member | where { $user.Contains($_) } | foreach { $member += $user[$_] } + $member = $member | Sort-Object -unique + + } + #enumerate public role by extractng unique values from user hash + else + { + $user.values | foreach { $member += $_ } + $member += $role.Name + $member = $member | Sort-Object -unique + } + #Add member to global hash + $__SQLPSXDatabaseRoleMember[$key] += @{$role.Name = $member} + #Return member array + Return $member + } + else + { $__SQLPSXDatabaseRoleMember.$key.$($role.Name) } + } + elseif ($db -and $db.GetType().Name -eq 'Database') + { + $key = $null + $key = $db.parent.name + "." + $db.name + if(!($__SQLPSXDatabaseRoleMember[$key])) { + Get-SqlDatabaseRole $db > $null + #Return User Hash + $__SQLPSXDatabaseRoleMember[$key] + } + else + #Return Login Hash + { $__SQLPSXDatabaseRoleMember[$key] } + } + else + { throw 'Get-SqlDatabaseRoleMember:Param `$role or `$db missing or invalid type.' } + +} # Get-SqlDatabaseRoleMember + +####################### +function Get-SqlLogin +{ + param($sqlserver=$(throw 'Get-SqlLogin:`$sqlserver is required.')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlLogin:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlLogin $($server.Name)" + + foreach ($login in $server.Logins | where {$_.LoginType.ToString() -ne 'Certificate'}) + { + $member = @() + $member += @($(Get-SqlLoginMember $login)) + + #Return Login Object + $login | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name members -value $member -passthru | + add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-Member -memberType noteProperty -name Server -value $server.Name -passthru + + } + +} # Get-SqlLogin + +####################### +function Get-SqlLinkedServerLogin +{ + param($sqlserver=$(throw 'Get-SqlLogin:`$sqlserver is required.')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlLogin:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlLogin $($server.Name)" + + foreach ($linkedSrv in $server.LinkedServers) + { + #Some DataSources contains commas such as "myserver.mydomain.com,1433" + #This can cause problems when exporting to csv so replace , with ; + $dataSource = $linkedSrv.DataSource -replace ",",";" + + foreach ($linkedSrvLogin in $linkedSrv.LinkedServerLogins) + { + #Return linked Server Login Object + $linkedSrvLogin | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name LinkedServer -value $linkedSrv.Name -passthru | + add-Member -memberType noteProperty -name DataSource -value $dataSource -passthru | + add-Member -memberType noteProperty -name Server -value $server.Name -passthru + } + } +}# Get-SqlLinkedServerLogin + +####################### +function New-SqlLoginMember +{ + Write-Verbose "New-SqlLoginMember" + + #__SQLPSXLoginMember is a session variable, so only create if it doesn't exist + if (!(Test-Path Variable:__SQLPSXLoginMember)) + { Set-Variable __SQLPSXLoginMember @{} -Scope Global -Option AllScope -Description "SQLPSX variable" } + +} #New-SQLLoginMember + +####################### +function Get-SqlLoginMember +{ + param($login,$server) + + Write-Verbose "Get-SqlLoginMember $($login.Name) $($server.Name)" + + New-SqlLoginMember + + if ($login -and $login.GetType().Name -eq 'Login') + { + if(!($__SQLPSXLoginMember.$($login.parent.name).$($login.Name))) { + $member = @() + $tmpMember = $null + if ($login.LoginType -eq 1) + { + $tmpMember = Get-SqlShowMbrs $login.parent $login.Name + if ($tmpMember -ne $null) + {$member += $tmpMember} + } + + if ($member -notcontains $login.Name) + { $member += $login.Name } + #Add member to global hash + $__SQLPSXLoginMember[$login.parent.name] += @{$login.Name = $member} + #Return member array + Return $member + } + else + { $__SQLPSXLoginMember.$($login.parent.name).$($login.Name) } + + } + elseif ($server -and $server.GetType().Name -eq 'Server') + { + if(!($__SQLPSXLoginMember[$server.name])) { + Get-SqlLogin $server > $null + #Return Login Hash + $__SQLPSXLoginMember[$server.name] + } + else + #Return Login Hash + { $__SQLPSXLoginMember[$server.name] } + } + else + { throw 'Get-SqlLoginMember:Param `$login or `$server missing or invalid type.' } + +} # Get-SqlLoginMember + +####################### +function Get-SqlServerRole +{ + param($sqlserver=$(throw 'Get-SqlServerRole:`$sqlserver is required.')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlServerRole:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlServerRole $($server.Name)" + + $login = @{} + $login = Get-SqlLoginMember -server $server + + foreach ($svrole in $server.Roles) + { + $member = @() + + #Although public is a role its members cannot be enumerated using EnumServerRoleMembers() + if (!($svrole.Name -eq "public")) + { + #EnumMembers and flatten out Windows group membership, adding the Sqllogin Objects members array + #However we will ensure we only list an individual login once + $svrole.EnumServerRoleMembers() | foreach {$login.$_} | foreach {if (!($member -contains $_)) {$member += $_}} + } + #enumerate public role by extractng unique values from login hash + else + { + $login.values | foreach { $member += $_ } + $member = $member | Sort-Object -unique + } + + $member += $svrole.Name + + #Return ServerRole Object + $svrole | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name members -value $member -passthru | + add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-Member -memberType noteProperty -name Server -value $server.Name -passthru + } + +} #Get-SqlServerRole + +####################### +function Get-SqlServerPermission +{ + param($sqlserver=$(throw 'Get-SqlServerPermission:`$sqlserver is required.')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlServerPermission:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlServerPermission $($server.Name)" + + if ($server.Information.Version.Major -ge 9) + {$perm = Get-SqlServerPermission90 $server; $perm += Get-SqlDatabasePermission $(Get-SqlDatabase $server 'master'); $perm} + else {Get-SqlDatabasePermission $(Get-SqlDatabase $server 'master')} + +}# Get-SqlServerPermission + +####################### +function Get-SqlServerPermission90 +{ + param($server=$(throw 'Get-SqlServerPermission90:`$server is required.')) + + if ($server.GetType().Name -ne 'Server') + { throw 'Get-SqlServerPermission90:Param `$server must be a Server object.' } + + Write-Verbose "Get-SqlServerPermission90 $($server.Name)" + + #SQL 2000 Does not suppport the concept of Server Permissions. SQL Server 2000 relies on Server Roles to grant server level permissions + #There are only three grantable permissions in SQL 2000/2005 only applicable to the master database: CREATE DATABASE; BACKUP DATABASE; BACKUP LOG + #Although we may think Create Database, Backup and Backup Log are server level permissions the SQL development team apparently does not + #share the same opinion and EnumServerPermissions will not enumerate these permissions. + #since I think they should I'll create a custom object and append to accomplish this in Get-SqlServerPermission + + $principal = @{} + #Get-SqlLogin $server | foreach { $principal[$_.Name] = $_.members } + $principal = Get-SqlLoginMember -server $server + + #Apparently having a login to SQL Server is considered a ServePermission in SQL 2005, all logins have this permission + #I'd rather eliminate the CONNECT SQL permissionType from the output + foreach ($perm in $server.EnumServerPermissions() | where {$_.PermissionType.ToString() -ne 'CONNECT SQL'}) + { + $member = @() + $member = $principal["$($perm.Grantee)"] + #Return ServerPermission Object + $perm | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name members -value $member -passthru | + add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-Member -memberType noteProperty -name dbname 'master' -passthru | + add-Member -memberType noteProperty -name Server -value $server.Name -passthru + } +} #Get-SqlServerPermission90 + +####################### +function Get-Permission80 +{ +param($db=$(throw 'Get-Permission80:`$db is required.')) + +if ($db.GetType().Name -ne 'Database') +{ throw 'Get-Permission80:Param `$db must be a Database object.' } + +Write-Verbose "Get-Permission80 $($db.Name)" + +$qry = @" +SELECT +grantee_principal.name AS [Grantee], +grantor_principal.name AS [Grantor], +CASE prmssn.protecttype WHEN 204 THEN 'GRANT_W_GRANT' WHEN 205 THEN 'GRANT' WHEN 206 THEN 'DENY' END AS [PermissionState], +CASE prmssn.id WHEN 0 THEN 'Database' ELSE 'ObjectOrColumn' END AS [ObjectClass], +null AS [ColumnName], +CASE prmssn.id WHEN 0 THEN DB_NAME() ELSE object_name(prmssn.id) END AS [ObjectName], +user_name(prmssn.uid) AS [ObjectSchema], +CASE prmssn.id WHEN 0 THEN DB_ID() ELSE prmssn.id END AS [ObjectID], +CASE + WHEN 1 = grantee_principal.issqlrole THEN 'DatabaseRole' + WHEN 1 = grantee_principal.isapprole THEN 'ApplicationRole' + ELSE 'User' +END AS [GranteeType], +CASE + WHEN 1 = grantor_principal.issqlrole THEN 'DatabaseRole' + WHEN 1 = grantor_principal.isapprole THEN 'ApplicationRole' + ELSE 'User' +END AS [GrantorType], +CASE CAST(prmssn.action AS int) + WHEN 26 THEN 'REFERENCES' + WHEN 178 THEN 'CREATE FUNCTION' + WHEN 193 THEN 'SELECT' + WHEN 195 THEN 'INSERT' + WHEN 196 THEN 'DELETE' + WHEN 197 THEN 'UPDATE' + WHEN 198 THEN 'CREATE TABLE' + WHEN 203 THEN 'CREATE DATABASE' + WHEN 207 THEN 'CREATE VIEW' + WHEN 222 THEN 'CREATE PROCEDURE' + WHEN 224 THEN 'EXECUTE' + WHEN 228 THEN 'BACKUP DATABASE' + WHEN 233 THEN 'CREATE DEFAULT' + WHEN 235 THEN 'BACKUP LOG' + WHEN 236 THEN 'CREATE RULE' +END AS [PermissionType] +FROM +dbo.sysprotects AS prmssn +INNER JOIN sysusers AS grantee_principal ON grantee_principal.uid = prmssn.uid +INNER JOIN sysusers AS grantor_principal ON grantor_principal.uid = prmssn.grantor +WHERE (prmssn.id > 0 AND OBJECTPROPERTY(prmssn.id,'IsMSShipped') = 0) +OR prmssn.id = 0 +"@ + Get-SqlData -dbname $db -qry $qry + +}# Get-Permission80 + +# Note: From BOL "sp_helprotect does not return information about securables that are introduced in SQL Server 2005." +# The output of 90 and 80 versions of Get-SqlDatabasePermission and Get-SqlObjectPermissions will not match when +# run against a SQL 2005 or higher server +####################### +function Get-SqlDatabasePermission +{ + param($db) + begin + { + ####################### + function Select-SqlDatabasePermission90 ($db) + { + Write-Verbose "Get-SqlDatabasePermission90 $($db.Name)" + + $user = @{} + $role = @{} + $user = Get-SqlUserMember -db $db + $role = Get-SqlDatabaseRoleMember -db $db + #Unfortunately on case sensitive servers you can have a role and user with the same name. So instead of using a single hash called + #principal we will use two different hashes and use the GranteeType to determine which one to use for listing the effective members + #of the permission. + + foreach ($perm in $db.EnumDatabasePermissions() | where {$_.PermissionType.ToString() -ne 'CONNECT'}) + { + $member = @() + switch ($perm.GranteeType) + { + 'User' { $member = $user["$($perm.Grantee)"] } + 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } + } + + #Return DatabasePermission Object + $perm | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name members -value $member -passthru | + add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member aliasproperty dbname ObjectName -passthru + } + + }# Select-SqlDatabasePermission90 + + ####################### + function Select-SqlDatabasePermission80 ($db) + { + Write-Verbose "Get-SqlDatabasePermission80 $($db.Name)" + + $user = @{} + $role = @{} + $user = Get-SqlUserMember -db $db + $role = Get-SqlDatabaseRoleMember -db $db + + foreach ($perm in Get-Permission80 $db | where {$_.ObjectClass -eq 'Database'}) + { + $member = @() + switch ($perm.GranteeType) + { + 'User' { $member = $user["$($perm.Grantee)"] } + 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } + } + + #Return DatabasePermission Object + $perm | add-member -memberType NoteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-member -memberType NoteProperty -name members -value $member -passthru | + add-member -memberType NoteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-member -memberType NoteProperty -name Server -value $db.parent.Name -passthru | + add-member aliasproperty dbname ObjectName -passthru + } + + }# Select-SqlDatabasePermission80 + } + process + { + if ($_) { + if ($_.GetType().Name -eq 'Database') + { + Write-Verbose "Get-SqlDatabasePermission $($_.Name)" + if ($_.Parent.Information.Version.Major -ge 9) + { Select-SqlDatabasePermission90 $_ } + else { Select-SqlDatabasePermission80 $_ } + } + else { throw 'Get-SqlDatabasePermission:Param `$db must be a database object.' } + } + } + end + { + if ($db) + { $db | Get-SqlDatabasePermission } + } + +}# Get-SqlServerPermission + +####################### +function Get-Permission90 +{ +param($db=$(throw 'Get-Permission90:`$db is required.')) + +if ($db.GetType().Name -ne 'Database') +{ throw 'Get-Permission90:Param `$db must be a Database object.' } + +Write-Verbose "Get-Permission90 $($db.Name)" + +$qry = @" +SELECT +grantee_principal.name AS [Grantee], +grantor_principal.name AS [Grantor], +CASE prmssn.state WHEN 'W' THEN 'GRANT_W_GRANT' WHEN 'G' THEN 'GRANT' WHEN 'D' THEN 'DENY' WHEN 'R' THEN 'REVOKE'END AS [PermissionState], +'ObjectOrColumn' AS [ObjectClass], +COL_NAME(prmssn.major_id,prmssn.minor_id) AS [ColumnName], +obj.name AS [ObjectName], +schema_name(obj.schema_id) AS [ObjectSchema], +prmssn.major_id AS [ObjectID], +CASE grantee_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' +END AS [GranteeType], +CASE grantor_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' +END AS [GrantorType], +CASE prmssn.type +WHEN 'AL' THEN 'ALTER' +WHEN 'CL' THEN 'CONTROL' +WHEN 'DL' THEN 'DELETE' +WHEN 'EX' THEN 'EXECUTE' +WHEN 'IN' THEN 'INSERT' +WHEN 'RC' THEN 'RECEIVE' +WHEN 'RF' THEN 'REFERENCES' +WHEN 'SL' THEN 'SELECT' +WHEN 'TO' THEN 'TAKE OWNERSHIP' +WHEN 'UP' THEN 'UPDATE' +WHEN 'VW' THEN 'VIEW DEFINITION' +END AS [PermissionType] +FROM +sys.database_permissions AS prmssn +INNER JOIN sys.database_principals AS grantee_principal ON grantee_principal.principal_id = prmssn.grantee_principal_id +INNER JOIN sys.database_principals AS grantor_principal ON grantor_principal.principal_id = prmssn.grantor_principal_id +INNER JOIN sys.all_objects AS obj ON obj.object_id = prmssn.major_id and prmssn.class = 1 +WHERE prmssn.major_id > 0 +UNION +SELECT +grantee_principal.name AS [Grantee], +grantor_principal.name AS [Grantor], +CASE prmssn.state WHEN 'W' THEN 'GRANT_W_GRANT' WHEN 'G' THEN 'GRANT' WHEN 'D' THEN 'DENY' WHEN 'R' THEN 'REVOKE'END AS [PermissionState], +'Schema' AS [ObjectClass], +null AS [ColumnName], +obj.name AS [ObjectName], +null AS [ObjectSchema], +prmssn.major_id AS [ObjectID], +CASE grantee_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' +END AS [GranteeType], +CASE grantor_principal.type WHEN 'S' THEN 'User' WHEN 'U' THEN 'WindowsUser' WHEN 'G' THEN 'WindowsGroup' WHEN 'A' THEN 'ApplicationRole' WHEN 'R' THEN 'DatabaseRole' +END AS [GrantorType], +CASE prmssn.type +WHEN 'AL' THEN 'ALTER' +WHEN 'CL' THEN 'CONTROL' +WHEN 'DL' THEN 'DELETE' +WHEN 'EX' THEN 'EXECUTE' +WHEN 'IN' THEN 'INSERT' +WHEN 'RC' THEN 'RECEIVE' +WHEN 'RF' THEN 'REFERENCES' +WHEN 'SL' THEN 'SELECT' +WHEN 'TO' THEN 'TAKE OWNERSHIP' +WHEN 'UP' THEN 'UPDATE' +WHEN 'VW' THEN 'VIEW DEFINITION' +END AS [PermissionType] +FROM +sys.database_permissions AS prmssn +INNER JOIN sys.database_principals AS grantee_principal ON grantee_principal.principal_id = prmssn.grantee_principal_id +INNER JOIN sys.database_principals AS grantor_principal ON grantor_principal.principal_id = prmssn.grantor_principal_id +INNER JOIN sys.schemas AS obj ON obj.schema_id = prmssn.major_id and prmssn.class = 3 +"@ + + Get-SqlData -dbname $db -qry $qry + +}# Get-Permission90 + +####################### +function Get-SqlObjectPermission +{ + param($db) + begin + { + ####################### + function Select-SqlObjectPermission90 ($db) + { + Write-Verbose "Get-SqlObjectPermission90 $($db.Name)" + + $user = @{} + $role = @{} + $user = Get-SqlUserMember -db $db + $role = Get-SqlDatabaseRoleMember -db $db + + Write-Verbose "EnumObjectPermissions" + + #Skip object permissions for system objects i.e. ObjectID > 0 + #EnumObjectPermissions() will take a long time to return data for very large permission sets + #in my testing a database with over 57,000 permission will take 10 min. + #dtproperties is an annoying little MS table used for DB diagrams it shows up as user table and + #is automatically created when someone clicks on DB Diagrams in SSMS/EM, permissions default to public + foreach ($perm in $db.EnumObjectPermissions() | where {$_.ObjectID -gt 0 -and $_.ObjectName -ne 'dtproperties'}) + { + $member = @() + switch ($perm.GranteeType) + { + 'User' { $member = $user["$($perm.Grantee)"] } + 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } + } + + #Return ObjectPermission Object + $perm | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name members -value $member -passthru | + add-Member -memberType noteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + + } #Select-SqlObjectPermission90 + + ####################### + function Select-SqlObjectPermission80 ($db) + { + Write-Verbose "Get-SqlObjectPermission80 $($db.Name)" + + $user = @{} + $role = @{} + $user = Get-SqlUserMember -db $db + $role = Get-SqlDatabaseRoleMember -db $db + + foreach ($perm in Get-Permission80 $db | where {$_.ObjectClass -eq 'ObjectOrColumn' -and $_.ObjectID -gt 0 -and $_.ObjectName -ne 'dtproperties'}) + { + $member = @() + switch ($perm.GranteeType) + { + 'User' { $member = $user["$($perm.Grantee)"] } + 'DatabaseRole' { $member = $role["$($perm.Grantee)"] } + } + + #Return ObjectPermission Object + $perm | add-member -memberType NoteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-member -memberType NoteProperty -name members -value $member -passthru | + add-member -memberType NoteProperty -name Xmlmembers -value $(ConvertTo-MemberXml $member) -passthru | + add-member -memberType NoteProperty -name Server -value $db.parent.Name -passthru | + add-member -memberType NoteProperty -name dbname -value $db.name -passthru + } + + } #Select-SqlObjectPermission80 + } + process + { + if ($_) { + if ($_.GetType().Name -eq 'Database') + { + Write-Verbose "Get-SqlObjectPermission $($_.Name)" + if ($_.Parent.Information.Version.Major -ge 9) + { Select-SqlObjectPermission90 $_ } + else { Select-SqlObjectPermission80 $_ } + } + else { throw 'Get-SqlObjectPermission:Param `$db must be a database object.' } + } + } + end + { + if ($db) + { $db | Get-SqlObjectPermission } + } + +}# Get-SqlObjectPermission + +####################### +function Get-SqlTable +{ + param($db, $name="*") + begin + { + function Select-SqlTable ($db, $name="*") + { + + foreach ($table in $db.Tables) + { + if ($table.IsSystemObject -eq $false -and ($table.name -like "*$name*" -or $name.Contains($table.name))) + { + #Return Table Object + $table | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $table.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + } + + } # Select-SqlTable + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlTable $($_.Name)" + Select-SqlTable $_ -name $name } + else + { throw 'Get-SqlTable:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlTable -name $name } + } + +} #Get-SqlTable + +####################### +function Get-SqlStoredProcedure +{ + param($db, $name="*") + begin + { + function Select-SqlStoredProcedure ($db, $name="*") + { + + foreach ($storedProcedure in $db.StoredProcedures) + { + if ($storedProcedure.IsSystemObject -eq $false -and ($storedProcedure.name -like "*$name*" -or $name.Contains($storedProcedure.name))) + { + #Return StoredProcedure Object + $storedProcedure | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $storedProcedure.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + } + + } # Select-SqlStoredProcedure + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlStoredProcedure $($_.Name)" + Select-SqlStoredProcedure $_ -name $name } + else + { throw 'Get-SqlStoredProcedure:Param `$db must be a database object.' } + } + } + end + { + if ($db) + { $db | Get-SqlStoredProcedure -name $name } + } + +} #Get-SqlStoredProcedure + +####################### +function Get-SqlView +{ + param($db, $name="*") + begin + { + function Select-SqlView ($db, $name="*") + { + + foreach ($view in $db.Views) + { + if ($view.IsSystemObject -eq $false -and ($view.name -like "*$name*" -or $name.Contains($view.name))) + { + #Return View Object + $view | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $view.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + } + + } # Select-SqlView + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlView $($_.Name)" + Select-SqlView $_ -name $name } + else + { throw 'Get-SqlView:Param `$db must be a database object.' } + } + } + end + { + if ($db) + { $db | Get-SqlView -name $name } + } + +} #Get-SqlView + +####################### +function Get-SqlUserDefinedDataType +{ + param($db, $name="*") + begin + { + function Select-SqlUserDefinedDataType ($db, $name="*") + { + + foreach ($userDefinedDataType in $db.UserDefinedDataTypes) + { + if ($userDefinedDataType.IsSystemObject -eq $false -and ($userDefinedDataType.name -like "*$name*" -or $name.Contains($userDefinedDataType.name))) + { + #Return UserDefinedDataType Object + $userDefinedDataType | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $userDefinedDataType.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + } + + } # Select-SqlUserDefinedDataType + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlUserDefinedDataType $($_.Name)" + Select-SqlUserDefinedDataType $_ -name $name } + else + { throw 'Get-SqlUserDefinedDataType:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlUserDefinedDataType -name $name } + } + +} #Get-SqlUserDefinedDataType + +####################### +function Get-SqlUserDefinedFunction +{ + param($db, $name="*") + begin + { + function Select-SqlUserDefinedFunction ($db, $name="*") + { + + foreach ($userDefinedFunction in $db.UserDefinedFunctions) + { + if ($userDefinedFunction.IsSystemObject -eq $false -and ($userDefinedFunction.name -like "*$name*" -or $name.Contains($userDefinedFunction.name))) + { + #Return UserDefinedFunction Object + $userDefinedFunction | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $userDefinedFunction.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + } + + } #Select-SqlUserFunction + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlUserDefinedFunction $($_.Name)" + Select-SqlUserDefinedFunction $_ -name $name } + else + { throw 'Get-SqlUserDefinedFunction:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlUserDefinedFunction -name $name } + } + +} #Get-SqlUserDefinedFunction + +####################### +function Get-SqlSynonym +{ + param($db, $name="*") + begin + { + function Select-SqlSynonym ($db, $name="*") + { + + foreach ($synonym in $db.Synonyms) + { + if ($synonym.name -like "*$name*" -or $name.Contains($synonym.name)) + { + #Return Synonym Object + $synonym | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $synonym.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + } + + } # Select-SqlSynonym + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlSynonym $($_.Name)" + Select-SqlSynonym $_ -name $name } + else + { throw 'Get-SqlSynonym:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlSynonym -name $name } + } + +} #Get-SqlSynonym + +####################### +function Get-SqlTrigger +{ + param($smo, $name="*") + begin + { + function Select-SqlTrigger ($smo, $name="*") + { + + foreach ($trigger in $smo.Triggers) + { + if ($trigger.name -like "*$name*" -or $name.Contains($trigger.name)) + { + switch ($smo.GetType().Name) + { + 'Server' { $server = $smo.Name } + 'Database' { $server = $smo.parent.Name; $dbname = $smo.Name } + #Default is table or view + Default { $server = $smo.parent.parent.Name; $dbname = $smo.parent.Name; $schema = $smo.parent.schema; $tbl = $smo.Name } + } + #Return Trigger Object + if ($trigger -ne $null) + { + $trigger | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $triggr.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $server -passthru | + add-Member -memberType noteProperty -name dbname -value $dbname -passthru | + add-Member -memberType noteProperty -name Schema -value $schema -passthru | + add-Member -memberType noteProperty -name Table -value $tbl -passthru + } + } + } + + } #Select-SqlTrigger + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Server' -or $_.GetType().Name -eq 'Database' -or $_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') + { Write-Verbose "Get-SqlTrigger $($_.Name)" + Select-SqlTrigger $_ -name $name } + else + { throw 'Get-SqlTrigger:Param `$smo must be a server, database, table or view object.' } + + } + } + end + { + if ($smo) + { $smo | Get-SqlTrigger -name $name } + } + +} #Get-SqlTrigger + +####################### +function Get-SqlColumn +{ + param($table) + begin + { + function Select-SqlColumn ($table) + { + + foreach ($column in $table.Columns) + { + #Return Column Object + $column | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $column.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | + add-Member -memberType noteProperty -name Schema -value $table.schema -passthru | + add-Member -memberType noteProperty -name Table -value $table.Name -passthru + } + + } # Select-SqlColumn + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') + { Write-Verbose "Get-SqlColumn $($_.Name)" + Select-SqlColumn $_ } + else + { throw 'Get-SqlColumn:Param `$table must be a table or view object.' } + + } + } + end + { + if ($table) + { $table | Get-SqlColumn } + } + +} #Get-SqlColumn + +####################### +function Get-SqlIndex +{ + param($table) + begin + { + function Select-SqlIndex ($table) + { + + foreach ($index in $table.Indexes) + { + #Return Index Object + $index | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $index.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name XMLIndexedColumns -value $(ConvertTo-IndexedColumnXML $index.IndexedColumns) -passthru | + add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | + add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | + add-Member -memberType noteProperty -name Table -value $table.Name -passthru + } + + } #Select-SqlIndex + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') + { Write-Verbose "Get-SqlIndex $($_.Name)" + Select-SqlIndex $_ } + else + { throw 'Get-SqlIndex:Param `$table must be a table or view object.' } + + } + } + end + { + if ($table) + { $table | Get-SqlIndex } + } + +} #Get-SqlIndex + +####################### +function Get-SqlStatistic +{ + param($table) + begin + { + function Select-SqlStatistic ($table) + { + + foreach ($statistic in $table.Statistics) + { + #Only return statistics not associated with indexes + if ($statistic.IsFromIndexCreation -eq $false) + { + #Return Statistic Object + $statistic | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $statistic.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name XMLStatisticColumns -value $(ConvertTo-StatisticColumnXML $statistic.StatisticColumns) -passthru | + add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | + add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | + add-Member -memberType noteProperty -name Table -value $table.Name -passthru + } + } + + } #Select-SqlStatistic + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') + { Write-Verbose "Get-SqlStatistic $($_.Name)" + Select-SqlStatistic $_ } + else + { throw 'Get-SqlStatistic:Param `$table must be a table or view object.' } + + } + } + end + { + if ($table) + { $table | Get-SqlStatistic } + } + +} #Get-SqlStatistic + +####################### +function Get-SqlCheck +{ + param($table) + begin + { + function Select-SqlCheck ($table) + { + + foreach ($Check in $table.Checks) + { + #Return Check Object + $Check | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $check.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | + add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | + add-Member -memberType noteProperty -name Table -value $table.Name -passthru + } + + } #Select-SqlCheck + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') + { Write-Verbose "Get-SqlCheck $($_.Name)" + Select-SqlCheck $_ } + else + { throw 'Get-SqlCheck:Param `$table must be a table or view object.' } + + } + } + end + { + if ($table) + { $table | Get-SqlCheck } + } + +} #Get-SqlCheck + +####################### +function Get-SqlForeignKey +{ + param($table) + begin + { + function Select-SqlForeignKey ($table) + { + + foreach ($ForeignKey in $table.ForeignKeys) + { + #Return ForeignKey Object + $ForeignKey | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $ForeignKey.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $table.parent.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $table.parent.Name -passthru | + add-Member -memberType noteProperty -name Schema -value $table.Schema -passthru | + add-Member -memberType noteProperty -name Table -value $table.Name -passthru + } + + } #Select-SqlForeignKey + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Table' -or $_.GetType().Name -eq 'View') + { Write-Verbose "Get-SqlForeignKey $($_.Name)" + Select-SqlForeignKey $_ } + else + { throw 'Get-SqlForeignKey:Param `$table must be a table or view object.' } + + } + } + end + { + if ($table) + { $table | Get-SqlForeignKey } + } + +} #Get-SqlForeignKey + +####################### +function Set-SqlScriptingOptions +{ + param($optsFile="scriptopts.txt") + + #There 77 settable scripting options at the time of this writing, rather than set the options as parameters + #I've choosen to set them through a separate file. Modify the passed in file to set + #the various scriptingOptions to your liking. See the following MSDN link for a description of the settable options: + #http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions_members.aspx + Write-Verbose "Set-SqlScriptingOptions $optsFile" + + $ScriptingOptions = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions + if (test-path $scriptRoot\$optsFile) + { + $include = [System.IO.File]::ReadAllText("$scriptRoot\$optsFile") + invoke-expression $include + } + elseif (test-path $optsFile) + { + $include = [System.IO.File]::ReadAllText("$optsFile") + invoke-expression $include + } + + return $scriptingOptions + +} #Set-SqlScriptingOptions + +####################### +function Get-SqlScripter +{ + param($smo, $scriptingOptions=$(Set-SqlScriptingOptions)) + begin + { + function Select-SqlScripter ($smo, $scriptingOptions=$(Set-SqlScriptingOptions)) + { + $smo.Script($scriptingOptions) + + } #Select-SqlScripter + } + process + { + if ($_) + { + if ($_.GetType().Namespace -like "Microsoft.SqlServer.Management.Smo*") + { Write-Verbose "Get-SqlScripter $($_.Name)" + Select-SqlScripter $_ $scriptingOptions } + else + { throw 'Get-SqlScripter:Param `$smo must be an SMO object.' } + + } + } + end + { + if ($smo) + { $smo | Get-SqlScripter -scriptingOptions $scriptingOptions } + } + +} #Get-SqlScripter + +####################### +function Get-Information_Schema.Tables +{ + param($db,$name='%') + begin + { + function Select-Information_Schema.Tables ($db, $name='%') + { +$qry = @" +SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_TYPE = 'BASE TABLE' +AND OBJECTPROPERTY(OBJECT_ID('['+TABLE_SCHEMA+'].['+TABLE_NAME+']'),'IsMSShipped') = 0 +AND TABLE_NAME NOT IN ('dtproperties','sysdiagrams') +AND TABLE_NAME LIKE '%$name%' +"@ + Get-SqlData -dbname $db -qry $qry + } #Select-Information_Schema.Tables + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-Information_Schema.Tables $($_.Name)" + Select-Information_Schema.Tables $_ -name $name } + else + { throw 'Get-Information_Schema.Tables:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-Information_Schema.Tables -name $name } + } + +} #Get-Information_Schema.Tables + +####################### +function Get-Information_Schema.Columns +{ + param($db,$tblname='%',$colname='%') + begin + { + function Select-Information_Schema.Columns ($db,$tblname='%',$colname='%') + { +$qry = @" +SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_NAME NOT IN ('dtproperties','sysdiagrams') +AND OBJECTPROPERTY(OBJECT_ID('['+TABLE_SCHEMA+'].['+TABLE_NAME+']'),'IsMSShipped') = 0 +AND TABLE_NAME LIKE '%$tblname%' +AND COLUMN_NAME LIKE '%$colname%' +"@ + Get-SqlData -dbname $db -qry $qry + } #Select-Information_Schema.Columns + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-Information_Schema.Columns $($_.Name)" + Select-Information_Schema.Columns $_ -tblname $tblname -colname $colname } + else + { throw 'Get-Information_Schema.Columns:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-Information_Schema.Columns -tblname $tblname -colname $colname } + } + +} #Get-Information_Schema.Columns + +####################### +function Get-Information_Schema.Views +{ + param($db,$name='%') + begin + { + function Select-Information_Schema.Views ($db, $name='%') + { +$qry = @" +SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.VIEWS +WHERE TABLE_NAME like '%$name%' +AND OBJECTPROPERTY(OBJECT_ID('['+TABLE_SCHEMA+'].['+TABLE_NAME+']'),'IsMSShipped') = 0 +"@ + Get-SqlData -dbname $db -qry $qry + } #Select-Information_Schema.Views + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-Information_Schema.Views $($_.Name)" + Select-Information_Schema.Views $_ -name $name } + else + { throw 'Get-Information_Schema.Views:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-Information_Schema.Views -name $name } + } + +} #Get-Information_Schema.Views + +####################### +function Get-Information_Schema.Routines +{ + param($db,$name='%',$text='%') + begin + { + function Select-Information_Schema.Routines ($db, $name='%',$text='%') + { +$qry = @" +SELECT SERVERPROPERTY('ServerName') AS Server, * FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_NAME NOT LIKE 'sp_%diagram%' +AND OBJECTPROPERTY(OBJECT_ID('['+ROUTINE_SCHEMA+'].['+ROUTINE_NAME+']'),'IsMSShipped') = 0 +AND ROUTINE_NAME LIKE '%$name%' +AND ROUTINE_DEFINITION LIKE '%$text%' +"@ + Get-SqlData -dbname $db -qry $qry + } #Select-Information_Schema.Routines + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-Information_Schema.Routines $($_.Name)" + Select-Information_Schema.Routines $_ -name $name -text $text } + else + { throw 'Get-Information_Schema.Routines:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-Information_Schema.Routines -name $name -text $text } + } + +} #Get-Information_Schema.Routines + +####################### +function Get-SysDatabases +{ + param($sqlserver=$(throw 'Get-SysDatabases:`$sqlserver is required.'),$name='%') + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SysDatabases:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SysDatabases $($server.Name)" + + $db = Get-SqlDatabase $server 'master' +$qry = @" +SELECT SERVERPROPERTY('ServerName') AS Server, name FROM sysdatabases +WHERE name LIKE '%$name%' +"@ + Get-SqlData -dbname $db -qry $qry + +} #Get-SysDatabases + +####################### +function Get-SqlDataFile +{ + param($db) + begin + { + function Select-SqlDataFile ($db) + { + + foreach ($dataFile in $db.FileGroups | % {$_.Files}) + { + #Return DataFile Object + $dataFile | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name FileGroup -value $dataFile.parent.Name -passthru | + add-Member -memberType noteProperty -name FreeSpace -value $($dataFile.Size - $dataFile.UsedSpace) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + + } #Select-SqlDataFile + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlDataFile $($_.Name)" + Select-SqlDataFile $_ } + else + { throw 'Get-SqlDataFile:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlDataFile } + } + +} #Get-SqlDataFile + +####################### +function Get-SqlLogFile +{ + param($db) + begin + { + function Select-SqlLogFile ($db) + { + + foreach ($logFile in $db.LogFiles) + { + #Return LogFile Object + $logFile | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name FreeSpace -value $($logFile.Size - $logFile.UsedSpace) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + + } #Select-SqlLogFile + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlLogFile $($_.Name)" + Select-SqlLogFile $_ } + else + { throw 'Get-SqlLogFile:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlLogFile } + } + +} #Get-SqlLogFile + +####################### +function Get-SqlVersion +{ + param($sqlserver=$(throw 'Get-SqlVersion:`$sqlserver is required.')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlVersion:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlVersion $($server.Name)" + + $server.information | Select @{name='Server';Expression={$server.Name}}, Version + +}#Get-SqlVersion + +####################### +function Get-SqlPort +{ + param([string]$sqlserver=$(throw 'Get-SqlPort:`$sqlserver is required.')) + + #This can be done using Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer, + #but it has some severe limitations -- only support in 2005 or higher and must have a SQL + #instance installed locally, so back SQLDMO instead of SMO for this one + + $dmoServer = New-Object -comobject "SQLDMO.SQLServer" + $dmoServer.loginsecure = $true + $dmoServer.connect($sqlserver) + $tcpPort = $dmoServer.registry.tcpport + $dmoServer.close() + + new-object psobject | + add-member -pass NoteProperty Server $sqlserver | + add-member -pass NoteProperty TcpPort $tcpPort + +}#Get-SqlPort + +####################### +function ConvertTo-ExtendedPropertyXML +{ + param($extendedProperty=$(throw 'ConvertTo-SqlExtendedPropertyXML:`$extendedProperty is required.')) + + Write-Verbose "ConvertTo-SqlExtendedPropertyXML" + + foreach ($xp in $extendedProperty) + { + if ($xp.Name -ne $null -and $xp.Value -ne $null) + { $xpXML += [string] "" } + } + + Return $xpXML + +} #ConvertTo-ExtendedPropertyXML + +####################### +function Get-Sql +{ + param ($computer=$(throw 'Get-Sql:`$computer is required.')) + + if((get-wmiobject win32_pingstatus -Filter "address='$computer'").protocoladdress) + { + Get-WmiObject win32_service -computer $computer | +Where {($_.Name -Like "MSSQL*" -or $_.Name -Like "SQLAgent*" -or $_.Name -Like "SQLServer*" -or $_.Name -eq 'MSDTC') -and $_.Name -ne 'MSSQLServerADHelper'} | Select SystemName, Name, State, StartName | ft + } +} #Get-Sql + +####################### +function ConvertTo-StatisticColumnXML +{ + param($statisticColumn=$(throw 'ConvertTo-SqlStatisticColumnXML:`$statisticColumn is required.')) + + Write-Verbose "ConvertTo-SqlStatisticColumnXML" + + foreach ($wa in $statisticColumn) + { + $waXML += [string] "" + } + + Return $waXML + +} #ConvertTo-StatisticColumnXML + +####################### +function ConvertTo-IndexedColumnXML +{ + param($indexedColumn=$(throw 'ConvertTo-SqlIndexedColumnXML:`$indexedColumn is required.')) + + Write-Verbose "ConvertTo-SqlIndexedColumnXML" + + foreach ($ix in $indexedColumn) + { +$ixXML += [string] "" + } + + Return $ixXML + +} #ConvertTo-IndexedColumnXML + +####################### +function Invoke-SqlDatabaseCheck +{ + param($db) + + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { + Write-Verbose "Invoke-SqlDatabaseCheck $($_.Name)" + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $_.CheckTables('None') + } + else + { throw 'Invoke-SqlDatabaseCheck:Param db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Invoke-SqlDatabaseCheck } + } + +} #Invoke-SqlDatabaseCheck + +####################### +function Invoke-SqlIndexRebuild +{ + param($index) + + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Index') + { + Write-Verbose "Invoke-SqlIndexRebuild $($_.Name)" + Write-Host "Rebuilding Index $($_.Name)" + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $_.Rebuild() + } + else + { throw 'Invoke-SqlIndexRebuild:Param index must be a index object.' } + + } + } + end + { + if ($index) + { $index | Invoke-SqlIndexRebuild } + } + +} #Invoke-SqlIndexRebuild + +####################### +function Invoke-SqlIndexDefrag +{ + param($index) + + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Index') + { + Write-Verbose "Invoke-SqlIndexDefrag $($_.Name)" + Write-Host "Defraging Index $($_.Name)" + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $_.Reorganize() + } + else + { throw 'Invoke-SqlIndexDefrag:Param index must be a index object.' } + + } + } + end + { + if ($index) + { $index | Invoke-SqlIndexDefrag } + } + +} #Invoke-SqlIndexDefrag + +####################### +function Get-SqlIndexFragmentation +{ + param($index) + + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Index') + { Write-Verbose "Get-SqlIndexFragmentation $($_.Name)" + $_.EnumFragmentation() } + else + { throw 'Get-SqlIndexFragmentation:Param index must be a index object.' } + + } + } + end + { + if ($index) + { $index | Get-SqlIndexFragmentation } + } + +} #Get-SqlIndexFragmentation + +####################### +function Update-Statistic +{ + param($statistic, $scanType='Default', [int]$sampleValue, [switch]$recompute) + + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Statistic') + { + Write-Verbose "Update-Statistic $($_.Name)" + Write-Host "Updating statistic $($_.Name)" + + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + if ($sampleValue -and $recompute) + { $_.Update($scanType, $sampleValue, $true) } + elseif ($sampleValue) + { $_.Update($scanType, $sampleValue) } + else + { $_.Update($scanType) } + + } + else + { throw 'Update-Statistic:Param statistic must be a statistic object.' } + + } + } + end + { + if ($statistic) + { $statistic | Update-Statistic } + } + +} #Update-Statistic + +####################### +function Invoke-SqlBackup +{ + param($sqlserver=$(throw 'sqlserver required.'),$dbname=$(throw 'dbname required.'),$filepath=$(throw 'filepath required.') + ,$action='Database', $description='',$name='',[switch]$force,[switch]$incremental,[switch]$copyOnly) + + #action can be Database or Log + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Invoke-SqlBackup:Param sqlserver must be a String or Server object.' } + } + + Write-Verbose "Invoke-SqlBackup $($server.Name) $dbname" + + $backup = new-object ("Microsoft.SqlServer.Management.Smo.Backup") + $backupDevice = new-object ("Microsoft.SqlServer.Management.Smo.BackupDeviceItem") $filepath, 'File' + + $backup.Action = $action + $backup.BackupSetDescription = $description + $backup.BackupSetName = $name + if (!$server.Databases.Contains("$dbname")) {throw 'Database $dbname does not exist on $($server.Name).'} + $backup.Database = $dbname + $backup.Devices.Add($backupDevice) + $backup.Initialize = $($force.IsPresent) + $backup.Incremental = $($incremental.IsPresent) + if ($copyOnly) + { if ($server.Information.Version.Major -ge 9 -and $smoVersion -ge 10) + { $backup.CopyOnly = $true } + else + { throw 'CopyOnly is supported in SQL Server 2005(9.0) or higher with SMO version 10.0 or higher.' } + } + + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $backup.SqlBackup($server) + + if ($?) + { Write-Host "$action backup of $dbname to $filepath complete." } + else + { Write-Host "$action backup of $dbname to $filepath failed." } + +} #Invoke-SqlBackup + +####################### +function Invoke-SqlRestore +{ + param($sqlserver=$(throw 'sqlserver required.'),$dbname=$(throw 'dbname required.'),$filepath=$(throw 'filepath required.'), + $action='Database',$stopat,$relocatefiles,[switch]$force,[switch]$norecovery,[switch]$keepreplication) + + #action can be Database or Log + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Invoke-SqlRestore:Param sqlserver must be a String or Server object.' } + } + + Write-Verbose "Invoke-SqlRestore $($server.Name) $dbname" + + $restore = new-object ("Microsoft.SqlServer.Management.Smo.Restore") + $restoreDevice = new-object ("Microsoft.SqlServer.Management.Smo.BackupDeviceItem") $filepath, 'File' + + $restore.Action = $action + $restore.Database = $dbname + $restore.Devices.Add($restoreDevice) + $restore.ReplaceDatabase = $($force.IsPresent) + $restore.NoRecovery = $($norecovery.IsPresent) + $restore.KeepReplication = $($keepreplication.IsPresent) + + if ($stopat) + { $restore.ToPointInTime = $stopAt } + + if ($relocatefiles) + { + if ($relocateFiles.GetType().Name -ne 'Hashtable') + { throw 'Invoke-SqlRestore:Param relocateFile must be a hashtable' } + + $relocateFileAR = New-Object Collections.ArrayList + + foreach ($i in $relocatefiles.GetEnumerator()) + { + $logicalName = $($i.Key); $physicalName = $($i.Value); + $relocateFile = new-object ("Microsoft.SqlServer.Management.Smo.RelocateFile") $logicalName, $physicalName + [void]$relocateFileAR.Add($relocateFile) + } + + $restore.RelocateFiles = $relocateFileAR + + } + + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $restore.SqlRestore($server) + + if ($?) + { Write-Host "$action restore of $dbname from $filepath complete." } + else + { Write-Host "$action restore of $dbname from $filepath failed." } + +} #Invoke-SqlRestore + +####################### +function Remove-SqlDatabase +{ + + param($sqlserver,$dbname) + + $db = Get-SqlDatabase $sqlserver $dbname + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $db.Drop() + +} #Remove-SqlDatabase + +####################### +function Add-SqlFileGroup +{ + param($db=$(throw 'db is required.'), $name=$(throw 'name is required.')) + + $fileGroup = new-object ('Microsoft.SqlServer.Management.Smo.FileGroup') $db, $name + + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $db.FileGroups.Add($fileGroup) + + return $fileGroup + +} #Add-SqlFileGroup + +####################### +function Add-SqlDataFile +{ + param($filegroup=$(throw 'filegroup is required.'), $name=$(throw 'name is required.'), $filepath=$(throw 'filepath is required.') + ,$size, $growthType, $growth, $maxSize) + #GrowthType is KB, None, Percent + $dataFile = new-object ('Microsoft.SqlServer.Management.Smo.DataFile') $filegroup, $name + $dataFile.FileName = $filepath + if ($size) + { $dataFile.Size = $size } + if ($growthType) + { $dataFile.GrowthType = $growthType } + if ($growth) + { $dataFile.Growth = $growth } + if ($maxSize) + { $dataFile.MaxSize = $maxSize } + + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $filegroup.Files.Add($dataFile) + +} #Add-SqlDataFile + +####################### +function Add-SqlLogFile +{ + param($db=$(throw 'db is required.'), $name=$(throw 'name is required.'), $filepath=$(throw 'filepath is required.') + ,$size, $growthType, $growth, $maxSize) + #GrowthType is KB, None, Percent + $logFile = new-object ('Microsoft.SqlServer.Management.Smo.LogFile') $db, $name + $logFile.FileName = $filepath + if ($size) + { $logFile.Size = $size } + if ($growthType) + { $logFile.GrowthType = $growthType } + if ($growth) + { $logFile.Growth = $growth } + if ($maxSize) + { $logFile.MaxSize = $maxSize } + + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $db.LogFiles.Add($logFile) + +} #Add-SqlLogFile + +####################### +function Add-SqlDatabase +{ + param($sqlserver=$(throw 'sqlserver required.'),$dbname=$(throw 'dbname required.'), + $dataName, $dataFilePath, $dataSize, $dataGrowthType, $dataGrowth, $dataMaxSize, + $logName, $logFilePath, $logSize, $logGrowthType, $logGrowth, $logMaxSize) + #GrowthType is KB, None, Percent + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Add-SqlDatabase:Param sqlserver must be a String or Server object.' } + } + + Write-Verbose "Add-SqlDatabase $($server.Name) $dbname" + + if ($server.Databases.Contains("$dbname")) {throw 'Database $dbname already exists on $($server.Name).'} + + $db = new-object ('Microsoft.SqlServer.Management.Smo.Database') $server, $dbname + + #Need to implement overloaded method if migrated to compiled cmdlet + + if (!($logName)) + { $dataName = $dbname } + if (!($dataFilePath)) + { $dataFilePath = $(Get-SqlDefaultDir $server 'Data') + '\' + $dbname + '.mdf' } + if (!($logName)) + { $logName = $dbname + '_log' } + if (!($logFilePath)) + { $logFilePath = $(Get-SqlDefaultDir $server 'Log') + '\' + $dbname + '_log.ldf' } + + $fileGroup = Add-SqlFileGroup $db 'PRIMARY' +Add-SqlDataFile -filegroup $fileGroup -name $dataName -filepath $dataFilePath -size $dataSize -growthtype $dataGrowthType -growth $dataGrowth -maxsize $dataMaxSize + +Add-SqlLogFile -db $db -name $logName -filepath $logFilePath -size $logSize -growthtype $logGrowthType -growth $logGrowth -maxsize $logMaxSize + + trap { + $ex = $_.Exception + Write-Output $ex.message + $ex = $ex.InnerException + while ($ex.InnerException) + { + Write-Output $ex.InnerException.message + $ex = $ex.InnerException + }; + continue + } + $db.Create() + +} #Add-SqlDatabase + +####################### +function Get-SqlDefaultDir +{ + param ($sqlserver, $dirtype) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlDefaultDir:Param sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlDefaultDir $($server.Name)" + + #The DefaultFile and DefaultLog properties are only written to registry if you modify the properties in SSMS + #even setting the properties to same value will create the registry keys. + #If the properties have not been created used the InstallDataDirectory properties. This seems to recreate how + #SSMS works. I thought about adding this properties to the server object in Get-SqlServer, but felt it was important + #not to mask whether the default directories had been set or not. You should always set the default directories as + #a configuration task + switch ($dirtype) + { + 'Data' { if ($server.DefaultFile) { $server.DefaultFile } else { $server.InstallDataDirectory + '\' + 'Data' } } + 'Log' { if ($server.DefaultLog) { $server.DefaultLog } else { $server.InstallDataDirectory + '\' + 'Data' } } + default { throw 'Get-SqlDefaultDir:Param dirtype must be Data or Log.' } + } + +} #Get-SqlDefaultDir + +####################### +function Add-SqlUser +{ + param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required'),$login=$name,$defaultSchema='dbo') + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Add-SqlUser:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Add-SqlUser $($db.Name) $name" + + if($db.Users | where {$_.name -eq $name}) + { throw "User $name already exists in Database $dbname." } + else + { + $user = new-object ('Microsoft.SqlServer.Management.Smo.User') $db, $name + $user.Login = $login + $user.DefaultSchema = $defaultschema + $user.Create() + } + +} #Add-SqlUser + +####################### +function Remove-SqlUser +{ + param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Remove-SqlUser:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Remove-SqlUser $($db.Name) $name" + + $user = Get-SqlUser $db | where {$_.name -eq $name} + if ($user) + { $user.Drop() } + else + { throw "User $name does not exist in database $($db.Name)." } + +} #Remove-SqlUser + +####################### +function Add-SqlLogin +{ + param($sqlserver=$(throw 'sqlserver is required'),$name=$(throw 'name is required'),$password,$logintype, + $DefaultDatabase='master', [switch]$PasswordExpirationEnabled,[switch]$PasswordPolicyEnforced) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Add-SqlLogin:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlDatabase $($server.Name) $dbname" + + if($server.Logins | where {$_.name -eq $name}) + { throw "Login $name already exists on Server $($server.Name)." } + else + { + $login = new-object ('Microsoft.SqlServer.Management.Smo.Login') $server, $name + $login.DefaultDatabase = $defaultDatabase + + if ($logintype -eq 'SqlLogin') + { + $login.LoginType = $logintype + $login.PasswordExpirationEnabled = $($PasswordExpirationEnabled.IsPresent) + $login.PasswordPolicyEnforced = $($PasswordPolicyEnforced.IsPresent) + $login.Create($password) + } + elseif ($logintype -eq 'WindowsUser' -or $logintype -eq 'WindowsGroup') + { + $login.LoginType = $logintype + $login.Create() + } + else + { throw 'logintype must be SqlLogin, WindowsUser or WindowsGroup.' } + } + +} #Add-SqlLogin + +####################### +function Remove-SqlLogin +{ + + param($sqlserver=$(throw 'sqlserver is required'),$name=$(throw 'name is required')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Remove-SqlLogin:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Remove-SqlLogin $($server.Name) $name" + + $login = Get-SqlLogin $server | where {$_.name -eq $name} + if ($login) + { $login.Drop() } + else + { throw "Login $name does not exist on server $($server.Name)." } + +} #Remove-SqlLogin + +####################### +function Add-SqlServerRoleMember +{ + param($sqlserver=$(throw 'sqlserver is required'),$loginame=$(throw 'loginame is required'),$rolename=$(throw 'rolename is required')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Add-SqlServerRoleMember:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Add-SqlServerRoleMember $($server.Name) $name" + + if($server.Logins | where {$_.name -eq $loginame}) + { + $svrole = Get-SqlServerRole $server | where {$_.name -eq $rolename} + + if ($svrole) + { $svrole.AddMember($loginame) } + else + { throw "ServerRole $rolename does not exist on server $($server.Name)." } + } + else + { throw "Login $loginame does not exist on server $($server.Name)." } + +} #Add-SqlServerRoleMember + +####################### +function Remove-SqlServerRoleMember +{ + param($sqlserver=$(throw 'sqlserver is required'),$loginame=$(throw 'loginame is required'),$rolename=$(throw 'rolename is required')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Remove-SqlServerRoleMember:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Remove-SqlServerRoleMember $($server.Name) $name" + + if($server.Logins | where {$_.name -eq $loginame}) + { + $svrole = Get-SqlServerRole $server | where {$_.name -eq $rolename} + + if ($svrole) + { $svrole.DropMember($loginame) } + else + { throw "ServerRole $rolename does not exist on server $($server.Name)." } + } + else + { throw "Login $loginame does not exist on server $($server.Name)." } + +} #Remove-SqlServerRoleMember + +####################### +function Add-SqlDatabaseRole +{ + param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Add-SqlDatabaseRole:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Add-SqlDatabaseRole $($db.Name) $name" + + if($db.Roles | where {$_.name -eq $name}) + { throw "DatabaseRole $name already exists in Database $($db.Name)." } + else + { + $role = new-object ('Microsoft.SqlServer.Management.Smo.DatabaseRole') $db, $name + $role.Create() + } + +} #Add-SqlDatabaseRole + +####################### +function Remove-SqlDatabaseRole +{ + param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Remove-SqlDatabaseRole:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Remove-SqlDatabaseRole $($db.Name) $name" + + $role = Get-SqlDatabaseRole $db | where {$_.name -eq $name} + + if ($role) + { $role.Drop() } + else + { throw "DatabaseRole $name does not exist in database $($db.Name)." } + +} #Remove-SqlDatabaseRole + +####################### +function Add-SqlDatabaseRoleMember +{ + param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required'),$rolename=$(throw 'rolename is required')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Add-SqlDatabaseRoleMember:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Add-SqlDatabaseRoleMember $($db.Name) $name $rolename" + + if(($db.Users | where {$_.name -eq $name}) -or ($db.Roles | where {$_.name -eq $name})) + { + $role = Get-SqlDatabaseRole $db | where {$_.name -eq $rolename} + + if ($role) + { $role.AddMember($name) } + else + { throw "DatabaseRole $rolename does not exist in database $($db.Name)." } + } + else + { throw "Role or User $name does not exist in database $($db.Name)." } + +} #Add-SqlDatabaseRoleMember + +####################### +function Remove-SqlDatabaseRoleMember +{ + param($sqlserver,$dbname=$(throw 'dbname is required'),$name=$(throw 'name is required'),$rolename=$(throw 'rolename is required')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Remove-SqlDatabaseRoleMember:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Remove-SqlDatabaseRoleMember $($db.Name) $name $rolename" + + if(($db.Users | where {$_.name -eq $name}) -or ($db.Roles | where {$_.name -eq $name})) + { + $role = Get-SqlDatabaseRole $db | where {$_.name -eq $rolename} + + if ($role) + { $role.DropMember($name) } + else + { throw "DatabaseRole $rolename does not exist in database $($db.Name)." } + } + else + { throw "Role or User $name does not exist in database $($db.Name)." } + +} #Remove-SqlDatabaseRoleMember + +####################### +function Set-SqlServerPermission +{ + param($sqlserver=$(throw 'sqlserver is required'),$permission=$(throw 'permission is required'),$name=$(throw 'name is required'),$action=$(throw 'action is required')) + +#Valid serverpermissions: +#AdministerBulkOperations AlterAnyConnection AlterAnyCredential AlterAnyDatabase AlterAnyEndpoint AlterAnyEventNotification +#AlterAnyLinkedServer AlterAnyLogin AlterAnyServerAudit AlterResources AlterServerState AlterSettings AlterTrace AuthenticateServer +#ConnectSql ControlServer CreateAnyDatabase CreateDdlEventNotification CreateEndpoint CreateTraceEventNotification ExternalAccessAssembly +#UnsafeAssembly ViewAnyDatabase ViewAnyDefinition ViewServerState + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Set-SqlServerPermission:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Set-SqlServerPermission $($server.Name) $serverpermission $name $action" + + if($server.Logins | where {$_.name -eq $name}) + { + $perm = new-object ('Microsoft.SqlServer.Management.Smo.ServerPermissionSet') + $perm.$permission = $true + + switch ($action) + { + 'Grant' { $server.Grant($perm,$name) } + 'Deny' { $server.Deny($perm,$name) } + 'Revoke' { $server.Revoke($perm,$name) } + default { throw 'Set-SqlServerPermission:Param `$action must be Grant, Deny or Revoke.' } + } + } + else + { throw "Login $name does not exist on server $($server.Name)." } + +} #Set-SqlServerPermission + +####################### +function Set-SqlDatabasePermission +{ + param($sqlserver=$(throw 'sqlserver is required'),$dbname=$(throw 'dbname is required'),$permission=$(throw 'permission is required'),$name=$(throw 'name is required'),$action=$(throw 'action is required')) + +#Valid databasepermissions: +#Alter AlterAnyApplicationRole AlterAnyAssembly AlterAnyAsymmetricKey AlterAnyCertificate AlterAnyContract AlterAnyDatabaseAudit +#AlterAnyDatabaseDdlTrigger AlterAnyDatabaseEventNotification AlterAnyDataspace AlterAnyFulltextCatalog AlterAnyMessageType +#AlterAnyRemoteServiceBinding AlterAnyRole AlterAnyRoute AlterAnySchema AlterAnyService AlterAnySymmetricKey AlterAnyUser Authenticate +#BackupDatabase BackupLog Checkpoint Connect ConnectReplication Control CreateAggregate CreateAssembly CreateAsymmetricKey CreateCertificate +#CreateContract CreateDatabase CreateDatabaseDdlEventNotification CreateDefault CreateFulltextCatalog CreateFunction CreateMessageType +#CreateProcedure CreateQueue CreateRemoteServiceBinding CreateRole CreateRoute CreateRule CreateSchema CreateService CreateSymmetricKey +#CreateSynonym CreateTable CreateType CreateView CreateXmlSchemaCollection Delete Execute Insert References Select Showplan +#SubscribeQueryNotifications TakeOwnership Update ViewDatabaseState ViewDefinition + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Set-SqlDatabasePermission:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Set-SqlDatabasePermission $($db.Name) $name $permission $action" + + if(($db.Users | where {$_.name -eq $name}) -or ($db.Roles | where {$_.name -eq $name})) + { + $perm = new-object ('Microsoft.SqlServer.Management.Smo.DatabasePermissionSet') + $perm.$permission = $true + + switch ($action) + { + 'Grant' { $db.Grant($perm,$name) } + 'Deny' { $db.Deny($perm,$name) } + 'Revoke' { $db.Revoke($perm,$name) } + default { throw 'Set-SqlDatabasePermission:Param `$action must be Grant, Deny or Revoke.' } + } + } + else + { throw "Role or User $name does not exist in database $($db.Name)." } + +} #Set-SqlDatabasePermission + +####################### +function Set-SqlObjectPermission +{ + + param($permission=$(throw 'permission is required'),$name=$(throw 'name is required'),$action=$(throw 'action is required')) +#Alter Connect Control Delete Execute Impersonate Insert Receive References Select Send TakeOwnership Update ViewChangeTracking ViewDefinition +#Example: Get-SqlDatabase 'Z002\Sql1 pubs | get-sqlschema -name dbo | set-sqlobjectpermission -permission Select -name test5 -action Grant + process + { + $smo = $_ + if ($smo.GetType().Namespace -like "Microsoft.SqlServer.Management.Smo*") + { + Write-Verbose "Set-SqlObjectPermission $($smo.Name) $permission $name $action" + + if(($smo.Parent.Users | where {$_.name -eq $name}) -or ($_.Parent.Roles | where {$_.name -eq $name})) + { + $perm = new-object ('Microsoft.SqlServer.Management.Smo.ObjectPermissionSet') + $perm.$permission = $true + + switch ($action) + { + 'Grant' { $smo.Grant($perm,$name) } + 'Deny' { $smo.Deny($perm,$name) } + 'Revoke' { $smo.Revoke($perm,$name) } + default { throw 'Set-SqlObjectPermission:Param `$action must be Grant, Deny or Revoke.' } + } + } + else + { throw "Role or User $name does not exist in database $($db.Name)." } + } + else + { throw ' Set-SqlObjectPermission:Param smo must be an smo database object (schema, table, view, storedprocedure, UDF, or synonym).' } + } + +} #Set-SqlObjectPermission + +####################### +function Get-SqlSchema +{ + param($db, $name="*") + begin + { + function Select-SqlSchema ($db, $name="*") + { + + foreach ($schema in $db.Schemas) + { + if ($schema.name -like "*$name*" -or $name.Contains($schema.name)) + { + #Return schema Object + $schema | add-Member -memberType noteProperty -name timestamp -value $(Get-SessionTimeStamp) -passthru | + add-Member -memberType noteProperty -name XMLExtendedProperties -value $(ConvertTo-ExtendedPropertyXML $schema.ExtendedProperties) -passthru | + add-Member -memberType noteProperty -name Server -value $db.parent.Name -passthru | + add-Member -memberType noteProperty -name dbname -value $db.Name -passthru + } + } + + } #Select-Sqlschema + } + process + { + if ($_) + { + if ($_.GetType().Name -eq 'Database') + { Write-Verbose "Get-SqlSchema $($_.Name)" + Select-Sqlschema $_ -name $name } + else + { throw 'Get-SqlSchema:Param `$db must be a database object.' } + + } + } + end + { + if ($db) + { $db | Get-SqlSchema -name $name } + } + +} #Get-SqlSchema + +####################### +function Get-SqlProcess +{ + param($sqlserver=$(throw 'sqlserver is required'),$spid,$name,[switch]$excludeSystemProcesses) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw "Get-SqlProcess:Param '`$sqlserver' must be a String or Server object." } + } + + Write-Verbose "Get-SqlProcess $($server.Name)" + + if ($spid) + { $server.EnumProcesses($spid) } + elseif ($name) + { $server.EnumProcesses($name) } + else + { $server.EnumProcesses($($excludeSystemProcesses.IsPresent)) } + +} #Get-SqlProcess + +####################### +function Get-SqlTransaction +{ + param($sqlserver,$dbname=$(throw 'dbname is required')) + + switch ($dbname.GetType().Name) + { + 'String' { $db = Get-SqlDatabase $sqlserver $dbname } + 'Database' { $db = $dbname } + default { throw "Get-SqlTransaction:Param '`$dbname' must be a String or Database object." } + } + + Write-Verbose "Get-SqlTransaction $($db.Name)" + + $db.EnumTransactions() + +} #Get-SqlTransaction + +####################### +function Get-SqlErrorLog +{ + param($sqlserver=$(throw 'sqlserver is required'),$lognumber=0) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw "Get-SqlErrorLog:Param '`$sqlserver' must be a String or Server object." } + } + + Write-Verbose "Get-SqlErrorLog $($server.Name)" + $server.ReadErrorLog($lognumber) + +} #Get-SqlErrorLog + +####################### +function Get-SqlEdition +{ + param($sqlserver=$(throw 'Get-SqlEdition:`$sqlserver is required.')) + + switch ($sqlserver.GetType().Name) + { + 'String' { $server = Get-SqlServer $sqlserver } + 'Server' { $server = $sqlserver } + default { throw 'Get-SqlEdition:Param `$sqlserver must be a String or Server object.' } + } + + Write-Verbose "Get-SqlEdition $($server.Name)" + + $server.information | Select @{name='Server';Expression={$server.Name}}, Edition + +}#Get-SqlEdition + diff --git a/Modules/OracleClient/OracleBulkcopy.ps1 b/Deprecated/OracleClient/OracleBulkcopy.ps1 similarity index 97% rename from Modules/OracleClient/OracleBulkcopy.ps1 rename to Deprecated/OracleClient/OracleBulkcopy.ps1 index 88e85ee..2e38046 100644 --- a/Modules/OracleClient/OracleBulkcopy.ps1 +++ b/Deprecated/OracleClient/OracleBulkcopy.ps1 @@ -1,122 +1,122 @@ -<# - .SYNOPSIS - Uses the .NET OracleBulkCopy class to quickly copy rows into a destination table. - - .DESCRIPTION - - Also, the Invoke-OracleBulkcopy function allows you to pass a command object instead of a set of records in order to "stream" the records - into the destination in cases where there are a lot of records and you don't want to allocate memory to hold the entire result set. - - .PARAMETER records - Either a datatable (like one returned from invoke-query or invoke-storedprocedure) or - A sql command object (use new-sqlcommand) - - .PARAMETER TNS - The destination server TNS to connect to. - - .PARAMETER User - The sql user to use for the connection. If user is not passed, NT Authentication is used. - - .PARAMETER Password - The password for the sql user named by the User parameter. - - .PARAMETER Table - The destination table for the bulk copy operation. - - .PARAMETER dbaPrivilege - "DBA Privilege" for the connection - - .PARAMETER Mapping - A dictionary of column mappings of the form DestColumn=SourceColumn - - .PARAMETER BatchSize - The batch size for the bulk copy operation. - - .PARAMETER NotifyAfter - The number of rows to fire the notification event after transferring. 0 means don't notify. - Ex: 1000 means to fire the notify event after each 1000 rows are transferred. - - .PARAMETER NotifyFunction - A scriptblock to be executed after each $notifyAfter records has been copied. The second parameter ($param[1]) - is a SqlRowsCopiedEventArgs object, which has a RowsCopied property. The default value for this parameter echoes the - number of rows copied to the console - - .PARAMETER Options - An object containing special options to modify the bulk copy operation. - See http://download.oracle.com/docs/html/E10927_01/OracleBulkCopyOptionsEnumeration.htm#CHDEHFFF for values. - - - .EXAMPLE - PS C:\> $cmd=new-sqlcommand -server MyServer -sql "Select * from MyTable" - PS C:\> invoke-Oraclebulkcopy -records $cmd -tns MyOtherServer -user myuser -password topsecret -table CopyOfMyTable - - .EXAMPLE - PS C:\> $rows=invoke-query -server MyServer -sql "Select * from MyTable" - PS C:\> invoke-Oraclebulkcopy -records $rows -tns MyOtherServer -password topsecret -table CopyOfMyTable - - .INPUTS - None. - You cannot pipe objects to Invoke-OracleBulkcopy - - .OUTPUTS - None. - -#> -function Invoke-OracleBulkcopy{ - param([Parameter(Mandatory=$true)]$records, - [Parameter(Mandatory=$true)]$tns, - [string]$user, - [string]$password, - [Parameter(Mandatory=$true)][string]$table, - [string]$dbaPrivilege, - [hashtable]$mapping=@{}, - [int]$batchsize=0, - [int]$notifyAfter=0, - [scriptblock]$notifyFunction={Write-Host "$($args[1].RowsCopied) rows copied."} - #[Parameter(Position=10, Mandatory=$false)][Oracle.DataAccess.Client.OracleBulkCopyOptions ]$options=[Oracle.DataAccess.Client.OracleBulkCopyOptions ]::Default - ) - - # I#m not using existing "New-Oracle_connection" function to create a connection string. - # because I do not get back the password - - $ConnectionString = "Data Source=$tns;User ID=$user;Password=$password" - Write-host $ConnectionString - if ($dbaPrivilege) - { - $ConnectionString += ";DBA Privilege=$dbaPrivilege" - } - - if ($options) - { - $bulkCopy = new-object "Oracle.DataAccess.Client.OracleBulkCopy" $connectionString $options - } - else - { - $bulkCopy = new-object "Oracle.DataAccess.Client.OracleBulkCopy" $connectionString - } - - $bulkCopy.BatchSize = $batchSize - $bulkCopy.DestinationTableName = $table - $bulkCopy.BulkCopyTimeout = 10000000 - if ($notifyAfter -gt 0){ - $bulkCopy.NotifyAfter = $notifyafter - $bulkCopy.Add_OracleRowscopied($notifyFunction) - } - - #Add column mappings if they were supplied - foreach ($key in $mapping.Keys){ - $bulkCopy.ColumnMappings.Add($mapping[$key],$key) | out-null - } - - write-debug "Bulk copy starting at $(get-date)" - if ($records -is [System.Data.Common.DBCommand]){ - #if passed a command object (rather than a datatable), ask it for a datareader to stream the records - $bulkCopy.WriteToServer($records.ExecuteReader()) - } elsif ($records -is [System.Data.Common.DbDataReader]){ - #if passed a Datareader object use it to stream the records - $bulkCopy.WriteToServer($records) - } else { - $bulkCopy.WriteToServer($records) - } - write-debug "Bulk copy finished at $(get-date)" -} +<# + .SYNOPSIS + Uses the .NET OracleBulkCopy class to quickly copy rows into a destination table. + + .DESCRIPTION + + Also, the Invoke-OracleBulkcopy function allows you to pass a command object instead of a set of records in order to "stream" the records + into the destination in cases where there are a lot of records and you don't want to allocate memory to hold the entire result set. + + .PARAMETER records + Either a datatable (like one returned from invoke-query or invoke-storedprocedure) or + A sql command object (use new-sqlcommand) + + .PARAMETER TNS + The destination server TNS to connect to. + + .PARAMETER User + The sql user to use for the connection. If user is not passed, NT Authentication is used. + + .PARAMETER Password + The password for the sql user named by the User parameter. + + .PARAMETER Table + The destination table for the bulk copy operation. + + .PARAMETER dbaPrivilege + "DBA Privilege" for the connection + + .PARAMETER Mapping + A dictionary of column mappings of the form DestColumn=SourceColumn + + .PARAMETER BatchSize + The batch size for the bulk copy operation. + + .PARAMETER NotifyAfter + The number of rows to fire the notification event after transferring. 0 means don't notify. + Ex: 1000 means to fire the notify event after each 1000 rows are transferred. + + .PARAMETER NotifyFunction + A scriptblock to be executed after each $notifyAfter records has been copied. The second parameter ($param[1]) + is a SqlRowsCopiedEventArgs object, which has a RowsCopied property. The default value for this parameter echoes the + number of rows copied to the console + + .PARAMETER Options + An object containing special options to modify the bulk copy operation. + See http://download.oracle.com/docs/html/E10927_01/OracleBulkCopyOptionsEnumeration.htm#CHDEHFFF for values. + + + .EXAMPLE + PS C:\> $cmd=new-sqlcommand -server MyServer -sql "Select * from MyTable" + PS C:\> invoke-Oraclebulkcopy -records $cmd -tns MyOtherServer -user myuser -password topsecret -table CopyOfMyTable + + .EXAMPLE + PS C:\> $rows=invoke-query -server MyServer -sql "Select * from MyTable" + PS C:\> invoke-Oraclebulkcopy -records $rows -tns MyOtherServer -password topsecret -table CopyOfMyTable + + .INPUTS + None. + You cannot pipe objects to Invoke-OracleBulkcopy + + .OUTPUTS + None. + +#> +function Invoke-OracleBulkcopy{ + param([Parameter(Mandatory=$true)]$records, + [Parameter(Mandatory=$true)]$tns, + [string]$user, + [string]$password, + [Parameter(Mandatory=$true)][string]$table, + [string]$dbaPrivilege, + [hashtable]$mapping=@{}, + [int]$batchsize=0, + [int]$notifyAfter=0, + [scriptblock]$notifyFunction={Write-Host "$($args[1].RowsCopied) rows copied."} + #[Parameter(Position=10, Mandatory=$false)][Oracle.DataAccess.Client.OracleBulkCopyOptions ]$options=[Oracle.DataAccess.Client.OracleBulkCopyOptions ]::Default + ) + + # I#m not using existing "New-Oracle_connection" function to create a connection string. + # because I do not get back the password + + $ConnectionString = "Data Source=$tns;User ID=$user;Password=$password" + Write-host $ConnectionString + if ($dbaPrivilege) + { + $ConnectionString += ";DBA Privilege=$dbaPrivilege" + } + + if ($options) + { + $bulkCopy = new-object "Oracle.DataAccess.Client.OracleBulkCopy" $connectionString $options + } + else + { + $bulkCopy = new-object "Oracle.DataAccess.Client.OracleBulkCopy" $connectionString + } + + $bulkCopy.BatchSize = $batchSize + $bulkCopy.DestinationTableName = $table + $bulkCopy.BulkCopyTimeout = 10000000 + if ($notifyAfter -gt 0){ + $bulkCopy.NotifyAfter = $notifyafter + $bulkCopy.Add_OracleRowscopied($notifyFunction) + } + + #Add column mappings if they were supplied + foreach ($key in $mapping.Keys){ + $bulkCopy.ColumnMappings.Add($mapping[$key],$key) | out-null + } + + write-debug "Bulk copy starting at $(get-date)" + if ($records -is [System.Data.Common.DBCommand]){ + #if passed a command object (rather than a datatable), ask it for a datareader to stream the records + $bulkCopy.WriteToServer($records.ExecuteReader()) + } elsif ($records -is [System.Data.Common.DbDataReader]){ + #if passed a Datareader object use it to stream the records + $bulkCopy.WriteToServer($records) + } else { + $bulkCopy.WriteToServer($records) + } + write-debug "Bulk copy finished at $(get-date)" +} diff --git a/Modules/OracleClient/OracleClient.psm1 b/Deprecated/OracleClient/OracleClient.psm1 similarity index 97% rename from Modules/OracleClient/OracleClient.psm1 rename to Deprecated/OracleClient/OracleClient.psm1 index 74b0298..c135c11 100644 --- a/Modules/OracleClient/OracleClient.psm1 +++ b/Deprecated/OracleClient/OracleClient.psm1 @@ -1,28 +1,28 @@ -# --------------------------------------------------------------------------- -### -# --------------------------------------------------------------------------- - - -[System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess") -[System.Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient") - -. $psScriptRoot\new-connection.ps1 -. $psScriptRoot\invoke-query.ps1 -. $psScriptRoot\get-commandresults.ps1 -. $psScriptRoot\OracleBulkcopy.ps1 - - -export-modulemember new-oracle_connection -# export-modulemember -function invoke-sql -export-modulemember -function invoke-oracle_query, ConvertTo-oracleDataSource, Invoke-OracleBulkcopy -# export-modulemember -function invoke-storedprocedure +# --------------------------------------------------------------------------- +### +# --------------------------------------------------------------------------- + + +[System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess") +[System.Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient") + +. $psScriptRoot\new-connection.ps1 +. $psScriptRoot\invoke-query.ps1 +. $psScriptRoot\get-commandresults.ps1 +. $psScriptRoot\OracleBulkcopy.ps1 + + +export-modulemember new-oracle_connection +# export-modulemember -function invoke-sql +export-modulemember -function invoke-oracle_query, ConvertTo-oracleDataSource, Invoke-OracleBulkcopy +# export-modulemember -function invoke-storedprocedure diff --git a/Modules/OracleClient/get-commandresults.ps1 b/Deprecated/OracleClient/get-commandresults.ps1 similarity index 100% rename from Modules/OracleClient/get-commandresults.ps1 rename to Deprecated/OracleClient/get-commandresults.ps1 diff --git a/Modules/OracleClient/invoke-query.ps1 b/Deprecated/OracleClient/invoke-query.ps1 similarity index 100% rename from Modules/OracleClient/invoke-query.ps1 rename to Deprecated/OracleClient/invoke-query.ps1 diff --git a/Modules/OracleClient/new-connection.ps1 b/Deprecated/OracleClient/new-connection.ps1 similarity index 100% rename from Modules/OracleClient/new-connection.ps1 rename to Deprecated/OracleClient/new-connection.ps1 diff --git a/Modules/SQLIse/ConvertFrom-Xml.ps1 b/Deprecated/OracleIse/ConvertFrom-Xml.ps1 similarity index 96% rename from Modules/SQLIse/ConvertFrom-Xml.ps1 rename to Deprecated/OracleIse/ConvertFrom-Xml.ps1 index 65f71b9..581b898 100644 --- a/Modules/SQLIse/ConvertFrom-Xml.ps1 +++ b/Deprecated/OracleIse/ConvertFrom-Xml.ps1 @@ -1,10 +1,10 @@ -function ConvertFrom-Xml($XML) { - foreach ($Object in @($XML.Objects.Object)) { - $PSObject = New-Object PSObject - foreach ($Property in @($Object.Property)) { - $PSObject | Add-Member NoteProperty -Name $Property.Name -Value $Property.InnerText - } - $PSObject - } -} - +function ConvertFrom-Xml($XML) { + foreach ($Object in @($XML.Objects.Object)) { + $PSObject = New-Object PSObject + foreach ($Property in @($Object.Property)) { + $PSObject | Add-Member NoteProperty -Name $Property.Name -Value $Property.InnerText + } + $PSObject + } +} + diff --git a/Modules/SQLIse/ConvertTo-StringData.ps1 b/Deprecated/OracleIse/ConvertTo-StringData.ps1 similarity index 95% rename from Modules/SQLIse/ConvertTo-StringData.ps1 rename to Deprecated/OracleIse/ConvertTo-StringData.ps1 index 7a30554..6c9cb49 100644 --- a/Modules/SQLIse/ConvertTo-StringData.ps1 +++ b/Deprecated/OracleIse/ConvertTo-StringData.ps1 @@ -1,33 +1,33 @@ -function ConvertTo-StringData -{ - Begin - { - $string = "@{`n" - function Expand-Value - { - param($value) - - if ($value -ne $null) { - switch ($value.GetType().Name) - { - 'String' { "`"$value`"" } - 'Boolean' { "`$$value" } - default { $value } - } - } - else - { "`$null" } - - } - } - Process - { - $string += $_.GetEnumerator() | foreach {"{0} = {1}`n" -f $_.Name,(Expand-Value $_.Value)} - } - End - { - $string += "}" - Write-Output $string - } - -} #ConvertTo-StringData +function ConvertTo-StringData +{ + Begin + { + $string = "@{`n" + function Expand-Value + { + param($value) + + if ($value -ne $null) { + switch ($value.GetType().Name) + { + 'String' { "`"$value`"" } + 'Boolean' { "`$$value" } + default { $value } + } + } + else + { "`$null" } + + } + } + Process + { + $string += $_.GetEnumerator() | foreach {"{0} = {1}`n" -f $_.Name,(Expand-Value $_.Value)} + } + End + { + $string += "}" + Write-Output $string + } + +} #ConvertTo-StringData diff --git a/Modules/OracleIse/Expand-String.ps1 b/Deprecated/OracleIse/Expand-String.ps1 similarity index 97% rename from Modules/OracleIse/Expand-String.ps1 rename to Deprecated/OracleIse/Expand-String.ps1 index b6f5b4d..71fa6ce 100644 --- a/Modules/OracleIse/Expand-String.ps1 +++ b/Deprecated/OracleIse/Expand-String.ps1 @@ -1,13 +1,13 @@ - - param([String]$text) - - $returnedText = "" - foreach ( $line in $text -split [System.Environment]::NewLine ) { - if ( $line.length -gt 0) { - if ($line -match '(\$(\w+))') - #{ $line = $line -replace '(\$(\w+))',(get-variable $matches[2] -Scope Global -ValueOnly) } - { $line = $line -replace '(\$(\w+))',(get-variable $matches[2] -ValueOnly) } - } - $returnedText += "{0}{1}" -f $line, [System.Environment]::NewLine - } - $returnedText + + param([String]$text) + + $returnedText = "" + foreach ( $line in $text -split [System.Environment]::NewLine ) { + if ( $line.length -gt 0) { + if ($line -match '(\$(\w+))') + #{ $line = $line -replace '(\$(\w+))',(get-variable $matches[2] -Scope Global -ValueOnly) } + { $line = $line -replace '(\$(\w+))',(get-variable $matches[2] -ValueOnly) } + } + $returnedText += "{0}{1}" -f $line, [System.Environment]::NewLine + } + $returnedText diff --git a/Modules/OracleIse/Get-ConnectionInfo.ps1 b/Deprecated/OracleIse/Get-ConnectionInfo.ps1 similarity index 100% rename from Modules/OracleIse/Get-ConnectionInfo.ps1 rename to Deprecated/OracleIse/Get-ConnectionInfo.ps1 diff --git a/Modules/OracleIse/Library-UserStore.ps1 b/Deprecated/OracleIse/Library-UserStore.ps1 similarity index 96% rename from Modules/OracleIse/Library-UserStore.ps1 rename to Deprecated/OracleIse/Library-UserStore.ps1 index 6a85ee3..21bbd2f 100644 --- a/Modules/OracleIse/Library-UserStore.ps1 +++ b/Deprecated/OracleIse/Library-UserStore.ps1 @@ -1,133 +1,133 @@ -####################### -function Test-UserStore -{ - param([string]$fileName,[string]$dirName) - - $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() - - if ($userStore.GetDirectoryNames($dirName)) - { - if ($userStore.GetFileNames("$dirName\$fileName")) - { Write-Output $true } - else - { Write-Output $false } - } - else - { Write-Output $false } - -} #Test-UserStore - -####################### -function Initialize-UserStore -{ - param([string]$fileName,[string]$dirName,[string]$defaultFile) - - if (-not (Test-UserSTore $fileName $dirName)) - { - $defaults = &"$defaultFile" - Write-UserStore $fileName $dirName $defaults - } - -} #Initialize-UserStore - -####################### -function Write-UserStore -{ - param([string]$fileName,[string]$dirName,$object) - - $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() - - if (-not $userStore.GetDirectoryNames($dirName)) - { $userStore.CreateDirectory($dirName) } - - try { - #$file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::OpenOrCreate,$userStore) - if (Test-UserSTore $fileName $dirName) - { $file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::Truncate,$userStore) } - else - { $file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::OpenOrCreate,$userStore) } - - if ($object -is [Hashtable]) - { - $string = $object | ConvertTo-StringData - $sw = New-Object System.IO.StreamWriter($file) - $sw.Write($string) - $sw.Close() - } - else - { - $xml = $object | ConvertTo-Xml -noTypeInformation - $xml.Save($file) - } - } - finally { - $file.Close() - $userStore.Close() - } - - -} #Write-UserStore - -####################### -function Read-UserStore -{ - param([string]$fileName,[string]$dirName,[string]$typeName) - - $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() - - try { - $file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::Open,$userStore) - } - catch { - Write-Error "Cannot open file $dirName\$fileName" - break - } - - try { - - if ($typeName -eq "Hashtable") - { - $sr = New-Object System.IO.StreamReader($file) - $object = $sr.ReadToEnd() - $sr.Close() - Write-host $object - invoke-expression "$object" - } - else - { - $xmlReader = New-Object System.Xml.XmlTextReader($file) - $xml = New-Object System.Xml.XmlDocument - $xml.Load($xmlReader) - $object = ConvertFrom-Xml -xml $xml - Write-Output $object - } - } - finally { - $file.Close() - $userStore.Close() - } - -} #Read-UserStore - -####################### -function Remove-UserStore -{ - param([string]$fileName,[string]$dirName) - - $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() - $userStore.DeleteFile("$dirName\$fileName") - $userStore.DeleteDirectory("$dirName") - $userStore.Close() - -} #Remove-UserStore - -####################### -function New-UserStore -{ - param([string]$dirName) - - $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() - $userStore.CreateDirectory("$dirName") - $userStore.Close() - -} #New-UserStore +####################### +function Test-UserStore +{ + param([string]$fileName,[string]$dirName) + + $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() + + if ($userStore.GetDirectoryNames($dirName)) + { + if ($userStore.GetFileNames("$dirName\$fileName")) + { Write-Output $true } + else + { Write-Output $false } + } + else + { Write-Output $false } + +} #Test-UserStore + +####################### +function Initialize-UserStore +{ + param([string]$fileName,[string]$dirName,[string]$defaultFile) + + if (-not (Test-UserSTore $fileName $dirName)) + { + $defaults = &"$defaultFile" + Write-UserStore $fileName $dirName $defaults + } + +} #Initialize-UserStore + +####################### +function Write-UserStore +{ + param([string]$fileName,[string]$dirName,$object) + + $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() + + if (-not $userStore.GetDirectoryNames($dirName)) + { $userStore.CreateDirectory($dirName) } + + try { + #$file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::OpenOrCreate,$userStore) + if (Test-UserSTore $fileName $dirName) + { $file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::Truncate,$userStore) } + else + { $file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::OpenOrCreate,$userStore) } + + if ($object -is [Hashtable]) + { + $string = $object | ConvertTo-StringData + $sw = New-Object System.IO.StreamWriter($file) + $sw.Write($string) + $sw.Close() + } + else + { + $xml = $object | ConvertTo-Xml -noTypeInformation + $xml.Save($file) + } + } + finally { + $file.Close() + $userStore.Close() + } + + +} #Write-UserStore + +####################### +function Read-UserStore +{ + param([string]$fileName,[string]$dirName,[string]$typeName) + + $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() + + try { + $file = New-Object System.IO.IsolatedStorage.IsolatedStorageFileStream("$dirName\$fileName",[System.IO.FileMode]::Open,$userStore) + } + catch { + Write-Error "Cannot open file $dirName\$fileName" + break + } + + try { + + if ($typeName -eq "Hashtable") + { + $sr = New-Object System.IO.StreamReader($file) + $object = $sr.ReadToEnd() + $sr.Close() + Write-host $object + invoke-expression "$object" + } + else + { + $xmlReader = New-Object System.Xml.XmlTextReader($file) + $xml = New-Object System.Xml.XmlDocument + $xml.Load($xmlReader) + $object = ConvertFrom-Xml -xml $xml + Write-Output $object + } + } + finally { + $file.Close() + $userStore.Close() + } + +} #Read-UserStore + +####################### +function Remove-UserStore +{ + param([string]$fileName,[string]$dirName) + + $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() + $userStore.DeleteFile("$dirName\$fileName") + $userStore.DeleteDirectory("$dirName") + $userStore.Close() + +} #Remove-UserStore + +####################### +function New-UserStore +{ + param([string]$dirName) + + $userStore = [System.IO.IsolatedStorage.IsolatedStorageFile]::GetUserStoreForAssembly() + $userStore.CreateDirectory("$dirName") + $userStore.Close() + +} #New-UserStore diff --git a/Modules/OracleIse/OracleIse.psm1 b/Deprecated/OracleIse/OracleIse.psm1 similarity index 100% rename from Modules/OracleIse/OracleIse.psm1 rename to Deprecated/OracleIse/OracleIse.psm1 diff --git a/Modules/OracleIse/SQLPSX.PNG b/Deprecated/OracleIse/SQLPSX.PNG similarity index 100% rename from Modules/OracleIse/SQLPSX.PNG rename to Deprecated/OracleIse/SQLPSX.PNG diff --git a/Modules/OracleIse/Set-Options.ps1 b/Deprecated/OracleIse/Set-Options.ps1 similarity index 100% rename from Modules/OracleIse/Set-Options.ps1 rename to Deprecated/OracleIse/Set-Options.ps1 diff --git a/Modules/OracleIse/Switch-CommentOrText.ps1 b/Deprecated/OracleIse/Switch-CommentOrText.ps1 similarity index 100% rename from Modules/OracleIse/Switch-CommentOrText.ps1 rename to Deprecated/OracleIse/Switch-CommentOrText.ps1 diff --git a/Modules/OracleIse/Switch-SelectedCommentOrText.ps1 b/Deprecated/OracleIse/Switch-SelectedCommentOrText.ps1 similarity index 100% rename from Modules/OracleIse/Switch-SelectedCommentOrText.ps1 rename to Deprecated/OracleIse/Switch-SelectedCommentOrText.ps1 diff --git a/Modules/OracleIse/defaultopts.ps1 b/Deprecated/OracleIse/defaultopts.ps1 similarity index 97% rename from Modules/OracleIse/defaultopts.ps1 rename to Deprecated/OracleIse/defaultopts.ps1 index b04b0e8..ccb9fe8 100644 --- a/Modules/OracleIse/defaultopts.ps1 +++ b/Deprecated/OracleIse/defaultopts.ps1 @@ -1,41 +1,41 @@ -# --------------------------------------------------------------------------- -### -# --------------------------------------------------------------------------- -@{ -# MultilineWherePredicatesList = $true -# NewLineBeforeGroupByClause = $true -# NewLineBeforeHavingClause = $true -PoshMode = $true -# IndentViewBody = $false -# AlignColumnDefinitionFields = $false -# NewLineBeforeOutputClause = $true -# AlignClauseBodies = $false -# AlignSetClauseItem = $false -# AsKeywordOnOwnLine = $false -# IncludeSemicolons = $false -# NewLineBeforeOpenParenthesisInMultilineList = $true -# MultilineInsertSourcesList = $true -# MultilineSelectElementsList = $true -# QuotedIdentifierOff = $false -Results = "To Grid" -# OutputVariable = $null -# NewLineBeforeCloseParenthesisInMultilineList = $true -# NewLineBeforeWhereClause = $true -# NewLineBeforeFromClause = $true -# MultilineSetClauseItems = $true -# MultilineInsertTargetsList = $true -# NewLineBeforeJoinClause = $true -# NewLineBeforeOrderByClause = $true -# KeywordCasing = "Uppercase" -# IndentationSize = 4 -# IndentSetClause = $false -# SqlVersion = "Sql100" -# MultilineViewColumnsList = $true -} +# --------------------------------------------------------------------------- +### +# --------------------------------------------------------------------------- +@{ +# MultilineWherePredicatesList = $true +# NewLineBeforeGroupByClause = $true +# NewLineBeforeHavingClause = $true +PoshMode = $true +# IndentViewBody = $false +# AlignColumnDefinitionFields = $false +# NewLineBeforeOutputClause = $true +# AlignClauseBodies = $false +# AlignSetClauseItem = $false +# AsKeywordOnOwnLine = $false +# IncludeSemicolons = $false +# NewLineBeforeOpenParenthesisInMultilineList = $true +# MultilineInsertSourcesList = $true +# MultilineSelectElementsList = $true +# QuotedIdentifierOff = $false +Results = "To Grid" +# OutputVariable = $null +# NewLineBeforeCloseParenthesisInMultilineList = $true +# NewLineBeforeWhereClause = $true +# NewLineBeforeFromClause = $true +# MultilineSetClauseItems = $true +# MultilineInsertTargetsList = $true +# NewLineBeforeJoinClause = $true +# NewLineBeforeOrderByClause = $true +# KeywordCasing = "Uppercase" +# IndentationSize = 4 +# IndentSetClause = $false +# SqlVersion = "Sql100" +# MultilineViewColumnsList = $true +} diff --git a/Reports/PBM/FailedPolicyReport.rdl b/Deprecated/Reports/PBM/FailedPolicyReport.rdl similarity index 97% rename from Reports/PBM/FailedPolicyReport.rdl rename to Deprecated/Reports/PBM/FailedPolicyReport.rdl index cf4deef..3bba99a 100644 --- a/Reports/PBM/FailedPolicyReport.rdl +++ b/Deprecated/Reports/PBM/FailedPolicyReport.rdl @@ -1,460 +1,460 @@ - - - - - - - - - 7.86458in - - - - - 0.25in - - - - - true - true - - - - - Faild Sever\Instance\Database - - - - - - - - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.25in - - - - - true - true - - - - - =Fields!EvalObject.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - After - - - - - - - true - true - true - true - DataSet1 - 0.06944in - 0.27792in - 0.5in - 7.86458in - - - - - - 2in - - - 8.54167in - - - 1.53834in - true - true - - - true - true - - - - - Failed Policy Report - - - - - - - 0.25708in - 0.27792in - 0.29167in - 7.84375in - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Configuration Group: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ConfigGroup.Value - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Policy Evaluated: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!PolicyName.Value - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Report Date: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Globals!ExecutionTime - - - - 0.61819in - 2.12167in - 0.25in - 4.46875in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Return to DashBoard - - - - - - - Textbox2 - - - - - PBMDashBoard - - - - - 0.6182in - 6.7675in - 0.25in - 1.35417in - 7 - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - White - - - 1in - 1in - 1in - 1in - + + + + + + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.25in + + + + + true + true + + + + + =Fields!EvalObject.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + After + + + + + + + true + true + true + true + DataSet1 + 0.06944in + 0.27792in + 0.5in + 7.86458in + + + + + + 2in + + + 8.54167in + + + 1.53834in + true + true + + + true + true + + + + + Failed Policy Report + + + + + + + 0.25708in + 0.27792in + 0.29167in + 7.84375in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Configuration Group: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ConfigGroup.Value + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Policy Evaluated: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!PolicyName.Value + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Report Date: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + 0.61819in + 2.12167in + 0.25in + 4.46875in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Return to DashBoard + + + + + + + Textbox2 + + + + + PBMDashBoard + + + + + 0.6182in + 6.7675in + 0.25in + 1.35417in + 7 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + White + + + 1in + 1in + 1in + 1in + - - 0pt - 0pt - External - - - true - true - RoundedWithWideIndentation - 33 - - TaperedWithRoundedPoint - - - White - DiagonalLeft - =IIf(Int(SUM((Fields!Pass.Value/Fields!Total.Value)*100))>Int(89),"Green","Maroon") - None - 1pt - - - =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") - 1 - - - 0pt - 0pt - External - - - 25 - Wedge - Inside - 15 - - - - - - - Maroon - DiagonalLeft - Maroon - None - 0pt - - None - 0 - - =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") - 1 - - - 100 - 1 - - 30 - 30 - Cross - - - - - #00ffffff - DiagonalLeft - Green - None - 0pt - - -14 - - 1 - 1 - - - =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") - 1 - - 15 - 30 - Inside - - - - - Green - None - White - None - 0pt - - NaN - NaN - - 100 - 1 - - - 0 - 1 - - - NaN - NaN - - - DimGray - - Cross - - External - - - 18 - 2 - - - NaN - NaN - - - DimGray - - Cross - - External - - - 8 - 1 - - - - - 0 - - - - WhiteSmoke - - Cross - - External - - - 6 - 6 - Circle - - - - - 0 - - - - WhiteSmoke - - Cross - - External - - - 6 - 6 - Circle - - - - NaN - NaN - 0 - true - true - true - - 0 - - - - - - BurlyWood - DiagonalLeft - Gainsboro - None - 0pt - - Edged - CustomCircular2 - - - - - External - - - - true - - External - - - 1 - 100 - 100 - - - true - - - - Gainsboro - DiagonalLeft - Gray - None - 0pt - - - - - - External - - - - - External - - - GaugeData - 0.45152in - 3.20151in - 1.7in - 2.18404in - - - White - - - - true - true - - - - - Total Policy Evaluations: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Successful Evaluations: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Sum(Fields!PassDetail.Value, "GetEvalData") - - - - - - - 0.77097in - 2.4183in - 0.25in - 0.71377in - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Failed Evaluations: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Sum(Fields!FailDetail.Value, "GetEvalData") - - - - - - - 1.07653in - 2.4183in - 0.25in - 0.71377in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Sum(Fields!TotalDetail.Value, "GetEvalData") - - - - - - - 0.45153in - 2.4183in - 0.25in - 0.71377in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Success Rate - - - - - =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") - - - - % - - - - - - - 0.16333in - 3.20151in - 0.21875in - 2.18404in - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 0.75in - - - 1.3626in - - - 0.52728in - - - 4.07885in - - - 0.5in - - - 0.5in - - - 0.5in - - - - - 0.25in - - - - - true - true - - - - - Eval Date - - - - - - - - 2pt - - - - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Policy Category Filter - - - - - - - - 2pt - - - - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Config Group - - - - - - - - 2pt - - - - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Eval Policy - - - - - - - - 2pt - - - - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Pass - - - - - - - - 2pt - - - - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fail - - - - - - - - 2pt - - - - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Total - - - - - - - - 2pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.25in - - - - - true - true - - - - - =Fields!EvalDateDetail.Value - - - - EvalDateDetail - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PolicyCategoryFilterDetail.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ConfigurationGroupDetail.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!EvalPolicyDetail.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - true - - - - - - true - true - - - - - =Fields!PassDetail.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!FailDetail.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!TotalDetail.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - true - true - true - true - GetEvalData - 2.27792in - 0.23626in - 0.5in - 8.21873in - 8 - - - - - - - - - - - =Fields!ConfigurationGroupDetail.Value - - - - - - - - - - - - - - - - - - - - - - - =Sum(Fields!PassDetail.Value) - - - - - - - - - - - - - False - - - - - - - - - 0.5 - - NaN - NaN - NaN - - - - Axis Title - - - - False - - - - - - - - - 0.5 - - NaN - Opposite - NaN - NaN - - - - - - - - - - - - - - - - 0.5 - - NaN - NaN - NaN - - - - Axis Title - - - - - - - - - - - - 0.5 - - NaN - Opposite - NaN - NaN - - - - - - - Success Rate per Configuration Group - - - - BrightPastel - - - - - No Data Available - - - GetEvalData - 0.16333in - 5.45499in - 2in - 3in - 9 - - - White - None - - - - 5.39583in - - - 8.69458in - - - 1in - true - true - - - true - true - - - - - PBM Dashboard - - - - - - - 0.19458in - 0.23625in - 0.59375in - 8.21874in - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - White - - - 1in - 1in - 1in - 1in - + + 0pt + 0pt + External + + + true + true + RoundedWithWideIndentation + 33 + + TaperedWithRoundedPoint + + + White + DiagonalLeft + =IIf(Int(SUM((Fields!Pass.Value/Fields!Total.Value)*100))>Int(89),"Green","Maroon") + None + 1pt + + + =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") + 1 + + + 0pt + 0pt + External + + + 25 + Wedge + Inside + 15 + + + + + + + Maroon + DiagonalLeft + Maroon + None + 0pt + + None + 0 + + =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") + 1 + + + 100 + 1 + + 30 + 30 + Cross + + + + + #00ffffff + DiagonalLeft + Green + None + 0pt + + -14 + + 1 + 1 + + + =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") + 1 + + 15 + 30 + Inside + + + + + Green + None + White + None + 0pt + + NaN + NaN + + 100 + 1 + + + 0 + 1 + + + NaN + NaN + + + DimGray + + Cross + + External + + + 18 + 2 + + + NaN + NaN + + + DimGray + + Cross + + External + + + 8 + 1 + + + + + 0 + + + + WhiteSmoke + + Cross + + External + + + 6 + 6 + Circle + + + + + 0 + + + + WhiteSmoke + + Cross + + External + + + 6 + 6 + Circle + + + + NaN + NaN + 0 + true + true + true + + 0 + + + + + + BurlyWood + DiagonalLeft + Gainsboro + None + 0pt + + Edged + CustomCircular2 + + + + + External + + + + true + + External + + + 1 + 100 + 100 + + + true + + + + Gainsboro + DiagonalLeft + Gray + None + 0pt + + + + + + External + + + + + External + + + GaugeData + 0.45152in + 3.20151in + 1.7in + 2.18404in + + + White + + + + true + true + + + + + Total Policy Evaluations: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Successful Evaluations: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!PassDetail.Value, "GetEvalData") + + + + + + + 0.77097in + 2.4183in + 0.25in + 0.71377in + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Failed Evaluations: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!FailDetail.Value, "GetEvalData") + + + + + + + 1.07653in + 2.4183in + 0.25in + 0.71377in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!TotalDetail.Value, "GetEvalData") + + + + + + + 0.45153in + 2.4183in + 0.25in + 0.71377in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Success Rate + + + + + =Sum(((Fields!Pass.Value/Fields!Total.Value)*100), "GaugeData") + + + + % + + + + + + + 0.16333in + 3.20151in + 0.21875in + 2.18404in + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.75in + + + 1.3626in + + + 0.52728in + + + 4.07885in + + + 0.5in + + + 0.5in + + + 0.5in + + + + + 0.25in + + + + + true + true + + + + + Eval Date + + + + + + + + 2pt + + + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Policy Category Filter + + + + + + + + 2pt + + + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Config Group + + + + + + + + 2pt + + + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Eval Policy + + + + + + + + 2pt + + + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Pass + + + + + + + + 2pt + + + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fail + + + + + + + + 2pt + + + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.25in + + + + + true + true + + + + + =Fields!EvalDateDetail.Value + + + + EvalDateDetail + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PolicyCategoryFilterDetail.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ConfigurationGroupDetail.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EvalPolicyDetail.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + true + + + + + + true + true + + + + + =Fields!PassDetail.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FailDetail.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!TotalDetail.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + true + true + true + true + GetEvalData + 2.27792in + 0.23626in + 0.5in + 8.21873in + 8 + + + + + + + + + + + =Fields!ConfigurationGroupDetail.Value + + + + + + + + + + + + + + + + + + + + + + + =Sum(Fields!PassDetail.Value) + + + + + + + + + + + + + False + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + Axis Title + + + + False + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + + + + + + + + + + 0.5 + + NaN + NaN + NaN + + + + Axis Title + + + + + + + + + + + + 0.5 + + NaN + Opposite + NaN + NaN + + + + + + + Success Rate per Configuration Group + + + + BrightPastel + + + + + No Data Available + + + GetEvalData + 0.16333in + 5.45499in + 2in + 3in + 9 + + + White + None + + + + 5.39583in + + + 8.69458in + + + 1in + true + true + + + true + true + + + + + PBM Dashboard + + + + + + + 0.19458in + 0.23625in + 0.59375in + 8.21874in + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + White + + + 1in + 1in + 1in + 1in + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8.5in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!firstDT.Value - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8.5in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!firstDT.Value + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.625in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.625in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.125in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.125in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionState.Value - - true - - - - - Permission State - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - PermissionType - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectSchema.Value - - true - - - - - Object Schema - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ColumnName.Value - - true - - - - - Column Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectSchema.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ColumnName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 10in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionState.Value + + true + + + + + Permission State + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + PermissionType + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectSchema.Value + + true + + + + + Object Schema + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ColumnName.Value + + true + + + + + Column Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectSchema.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ColumnName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 10in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionState.Value - - true - - - - - Permission State - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionState.Value + + true + + + + + Permission State + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.875in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.875in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8.375in - - - - - - - - - - - - - textbox9 - 0.06944in - 7.0625in - 0.25in - 0.375in - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - textbox10 - 0.06944in - 7.5in - 0.25in - 0.25in - 1 - - - - true - true - - - - - Of - - - - - - - textbox11 - 0.06944in - 7.8125in - 0.25in - 0.25in - 2 - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - textbox12 - 0.06944in - 8.125in - 0.25in - 0.25in - 3 - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8.375in + + + + + + + + + + + + + textbox9 + 0.06944in + 7.0625in + 0.25in + 0.375in + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + textbox10 + 0.06944in + 7.5in + 0.25in + 0.25in + 1 + + + + true + true + + + + + Of + + + + + + + textbox11 + 0.06944in + 7.8125in + 0.25in + 0.25in + 2 + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + textbox12 + 0.06944in + 8.125in + 0.25in + 0.25in + 3 + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!IsFixedRole.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.3in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!IsFixedRole.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.3in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!LinkedServer.Value - - true - - - - - Linked Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!DataSource.Value - - true - - - - - Data Source - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Impersonate.Value - - true - - - - - Impersonate - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!RemoteUser.Value - - true - - - - - Remote User - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!LinkedServer.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!DataSource.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Impersonate.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!RemoteUser.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8.125in - - - - - - - - - - - - - true - true - - - - - Capture Date: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!LinkedServer.Value + + true + + + + + Linked Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!DataSource.Value + + true + + + + + Data Source + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Impersonate.Value + + true + + + + + Impersonate + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!RemoteUser.Value + + true + + + + + Remote User + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!LinkedServer.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DataSource.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Impersonate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!RemoteUser.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8.125in + + + + + + + + + + + + + true + true + + + + + Capture Date: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!LoginType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.5in - - - - - - - - - - - - - textbox9 - 0.06944in - 7.125in - 0.25in - 0.375in - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - textbox10 - 0.06944in - 7.5625in - 0.25in - 0.25in - 1 - - - - true - true - - - - - Of - - - - - - - textbox11 - 0.06944in - 7.875in - 0.25in - 0.25in - 2 - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - textbox12 - 0.06944in - 8.1875in - 0.25in - 0.25in - 3 - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!LoginType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.5in + + + + + + + + + + + + + textbox9 + 0.06944in + 7.125in + 0.25in + 0.375in + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + textbox10 + 0.06944in + 7.5625in + 0.25in + 0.25in + 1 + + + + true + true + + + + + Of + + + + + + + textbox11 + 0.06944in + 7.875in + 0.25in + 0.25in + 2 + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + textbox12 + 0.06944in + 8.1875in + 0.25in + 0.25in + 3 + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - - - - - - - - - true - true - - - - - =max(Code.SetHT(Fields!member.Value, Fields!Server.Value), "table1_Group1") - - - - - - - - - - - 0.25in - - - - - true - true - - - - - =Fields!member.Value - - - - - - - - - - - true - true - - - - - =Code.GetHT(Fields!member.Value) - - - - - - - - - - - - - - - - - - After - true - true - - - - - =Fields!member.Value - - - - - - Detail - - - - - true - - - - Detail_Collection - Output - true - - - Before - true - - - - - - SQLPSX - 0.68in - 10.5in - - - - - - - - - - - - - textbox9 - 0.125in - 7.125in - 0.25in - 0.375in - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - textbox10 - 0.125in - 7.5625in - 0.25in - 0.25in - 1 - - - - true - true - - - - - Of - - - - - - - textbox11 - 0.125in - 7.875in - 0.25in - 0.25in - 2 - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - textbox12 - 0.125in - 8.1875in - 0.25in - 0.25in - 3 - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + + + + + + + + + true + true + + + + + =max(Code.SetHT(Fields!member.Value, Fields!Server.Value), "table1_Group1") + + + + + + + + + + + 0.25in + + + + + true + true + + + + + =Fields!member.Value + + + + + + + + + + + true + true + + + + + =Code.GetHT(Fields!member.Value) + + + + + + + + + + + + + + + + + + After + true + true + + + + + =Fields!member.Value + + + + + + Detail + + + + + true + + + + Detail_Collection + Output + true + + + Before + true + + + + + + SQLPSX + 0.68in + 10.5in + + + + + + + + + + + + + textbox9 + 0.125in + 7.125in + 0.25in + 0.375in + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + textbox10 + 0.125in + 7.5625in + 0.25in + 0.25in + 1 + + + + true + true + + + + + Of + + + + + + + textbox11 + 0.125in + 7.875in + 0.25in + 0.25in + 2 + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + textbox12 + 0.125in + 8.1875in + 0.25in + 0.25in + 3 + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ColumnName.Value - - true - - - - - Column Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionState.Value - - true - - - - - Permission State - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectSchema.Value - - true - - - - - Object Schema - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!ObjectClass.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ColumnName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectSchema.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 10.625in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ColumnName.Value + + true + + + + + Column Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionState.Value + + true + + + + + Permission State + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectSchema.Value + + true + + + + + Object Schema + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!ObjectClass.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ColumnName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectSchema.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 10.625in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.175in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.175in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.33334in - - - - - - - - - - - - - true - true - - - - - Capture Date: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.33334in + + + + + + + + + + + + + true + true + + + + + Capture Date: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!LoginType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.75in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!LoginType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.75in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Server.dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - - - - - - - - - true - true - - - - - =max(Code.SetHT(Fields!member.Value, Fields!Server.Value & "." & Fields!dbname.Value), "table1_Group1") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.25in - - - - - true - true - - - - - =Fields!member.Value - - - - - - - - true - true - - - - - =Code.GetHT(Fields!member.Value) - - - - - - - - - - - - - - - - - - After - true - - - - - =Fields!member.Value - - - - - =Fields!member.Value - - - - - - Detail - - - - - true - - - - Detail_Collection - Output - true - - - Before - true - - - - - - SQLPSX - 0.71in - 10.875in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Server.dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + + + + + + + + + true + true + + + + + =max(Code.SetHT(Fields!member.Value, Fields!Server.Value & "." & Fields!dbname.Value), "table1_Group1") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.25in + + + + + true + true + + + + + =Fields!member.Value + + + + + + + + true + true + + + + + =Code.GetHT(Fields!member.Value) + + + + + + + + + + + + + + + + + + After + true + + + + + =Fields!member.Value + + + + + =Fields!member.Value + + + + + + Detail + + + + + true + + + + Detail_Collection + Output + true + + + Before + true + + + + + + SQLPSX + 0.71in + 10.875in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectType.Value - - true - - - - - Object Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!LoginType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.95832in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectType.Value + + true + + + + + Object Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!LoginType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.95832in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8.5in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!firstDT.Value - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8.5in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!firstDT.Value + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.625in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.625in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.125in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.125in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionState.Value - - true - - - - - Permission State - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - PermissionType - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectSchema.Value - - true - - - - - Object Schema - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ColumnName.Value - - true - - - - - Column Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectSchema.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ColumnName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 10in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionState.Value + + true + + + + + Permission State + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + PermissionType + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectSchema.Value + + true + + + + + Object Schema + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ColumnName.Value + + true + + + + + Column Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectSchema.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ColumnName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 10in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionState.Value - - true - - - - - Permission State - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionState.Value + + true + + + + + Permission State + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.875in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.875in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ChangeType.Value - - true - - - - - Change Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ChangeType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7in - - - - - - - - - - - - - true - true - - - - - Changes From: - - - - - - - true - true - - - - - =Parameters!secondDT.Value - - - - - - - true - true - - - - - To: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ChangeType.Value + + true + + + + + Change Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ChangeType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7in + + + + + + + + + + + + + true + true + + + + + Changes From: + + + + + + + true + true + + + + + =Parameters!secondDT.Value + + + + + + + true + true + + + + + To: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8.375in - - - - - - - - - - - - - textbox9 - 0.06944in - 7.0625in - 0.25in - 0.375in - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - textbox10 - 0.06944in - 7.5in - 0.25in - 0.25in - 1 - - - - true - true - - - - - Of - - - - - - - textbox11 - 0.06944in - 7.8125in - 0.25in - 0.25in - 2 - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - textbox12 - 0.06944in - 8.125in - 0.25in - 0.25in - 3 - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8.375in + + + + + + + + + + + + + textbox9 + 0.06944in + 7.0625in + 0.25in + 0.375in + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + textbox10 + 0.06944in + 7.5in + 0.25in + 0.25in + 1 + + + + true + true + + + + + Of + + + + + + + textbox11 + 0.06944in + 7.8125in + 0.25in + 0.25in + 2 + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + textbox12 + 0.06944in + 8.125in + 0.25in + 0.25in + 3 + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!IsFixedRole.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.3in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!IsFixedRole.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.3in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!LinkedServer.Value - - true - - - - - Linked Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!DataSource.Value - - true - - - - - Data Source - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Impersonate.Value - - true - - - - - Impersonate - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!RemoteUser.Value - - true - - - - - Remote User - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!LinkedServer.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!DataSource.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Impersonate.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!RemoteUser.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 8.125in - - - - - - - - - - - - - true - true - - - - - Capture Date: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!LinkedServer.Value + + true + + + + + Linked Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!DataSource.Value + + true + + + + + Data Source + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Impersonate.Value + + true + + + + + Impersonate + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!RemoteUser.Value + + true + + + + + Remote User + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!LinkedServer.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DataSource.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Impersonate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!RemoteUser.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 8.125in + + + + + + + + + + + + + true + true + + + + + Capture Date: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!LoginType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.5in - - - - - - - - - - - - - textbox9 - 0.06944in - 7.125in - 0.25in - 0.375in - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - textbox10 - 0.06944in - 7.5625in - 0.25in - 0.25in - 1 - - - - true - true - - - - - Of - - - - - - - textbox11 - 0.06944in - 7.875in - 0.25in - 0.25in - 2 - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - textbox12 - 0.06944in - 8.1875in - 0.25in - 0.25in - 3 - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!LoginType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.5in + + + + + + + + + + + + + textbox9 + 0.06944in + 7.125in + 0.25in + 0.375in + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + textbox10 + 0.06944in + 7.5625in + 0.25in + 0.25in + 1 + + + + true + true + + + + + Of + + + + + + + textbox11 + 0.06944in + 7.875in + 0.25in + 0.25in + 2 + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + textbox12 + 0.06944in + 8.1875in + 0.25in + 0.25in + 3 + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - - - - - - - - - true - true - - - - - =max(Code.SetHT(Fields!member.Value, Fields!Server.Value), "table1_Group1") - - - - - - - - - - - 0.25in - - - - - true - true - - - - - =Fields!member.Value - - - - - - - - - - - true - true - - - - - =Code.GetHT(Fields!member.Value) - - - - - - - - - - - - - - - - - - After - true - true - - - - - =Fields!member.Value - - - - - - Detail - - - - - true - - - - Detail_Collection - Output - true - - - Before - true - - - - - - SQLPSX - 0.68in - 10.5in - - - - - - - - - - - - - textbox9 - 0.125in - 7.125in - 0.25in - 0.375in - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - textbox10 - 0.125in - 7.5625in - 0.25in - 0.25in - 1 - - - - true - true - - - - - Of - - - - - - - textbox11 - 0.125in - 7.875in - 0.25in - 0.25in - 2 - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - textbox12 - 0.125in - 8.1875in - 0.25in - 0.25in - 3 - - - - true - true - - - - - =Parameters!Timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + + + + + + + + + true + true + + + + + =max(Code.SetHT(Fields!member.Value, Fields!Server.Value), "table1_Group1") + + + + + + + + + + + 0.25in + + + + + true + true + + + + + =Fields!member.Value + + + + + + + + + + + true + true + + + + + =Code.GetHT(Fields!member.Value) + + + + + + + + + + + + + + + + + + After + true + true + + + + + =Fields!member.Value + + + + + + Detail + + + + + true + + + + Detail_Collection + Output + true + + + Before + true + + + + + + SQLPSX + 0.68in + 10.5in + + + + + + + + + + + + + textbox9 + 0.125in + 7.125in + 0.25in + 0.375in + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + textbox10 + 0.125in + 7.5625in + 0.25in + 0.25in + 1 + + + + true + true + + + + + Of + + + + + + + textbox11 + 0.125in + 7.875in + 0.25in + 0.25in + 2 + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + textbox12 + 0.125in + 8.1875in + 0.25in + 0.25in + 3 + + + + true + true + + + + + =Parameters!Timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ColumnName.Value - - true - - - - - Column Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionState.Value - - true - - - - - Permission State - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectSchema.Value - - true - - - - - Object Schema - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!ObjectClass.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ColumnName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectSchema.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 10.625in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ColumnName.Value + + true + + + + + Column Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionState.Value + + true + + + + + Permission State + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectSchema.Value + + true + + + + + Object Schema + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!ObjectClass.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ColumnName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectSchema.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 10.625in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Grantee.Value - - true - - - - - Grantee - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!PermissionType.Value - - true - - - - - Permission Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!PermissionState.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Grantee.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PermissionType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.175in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Grantee.Value + + true + + + + + Grantee + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!PermissionType.Value + + true + + + + + Permission Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!PermissionState.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Grantee.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PermissionType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.175in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Name.Value - - true - - - - - Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Name.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.33334in - - - - - - - - - - - - - true - true - - - - - Capture Date: - - - - - - - true - true - - - - - Page - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Name.Value + + true + + + + + Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.33334in + + + + + + + + + + + + + true + true + + + + + Capture Date: + + + + + + + true + true + + + + + Page + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!member.Value - - true - - - - - member - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!LoginType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!member.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 6.75in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!member.Value + + true + + + + + member + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!LoginType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!member.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 6.75in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Server.dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - - - - - - - - - true - true - - - - - =max(Code.SetHT(Fields!member.Value, Fields!Server.Value & "." & Fields!dbname.Value), "table1_Group1") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.25in - - - - - true - true - - - - - =Fields!member.Value - - - - - - - - true - true - - - - - =Code.GetHT(Fields!member.Value) - - - - - - - - - - - - - - - - - - After - true - - - - - =Fields!member.Value - - - - - =Fields!member.Value - - - - - - Detail - - - - - true - - - - Detail_Collection - Output - true - - - Before - true - - - - - - SQLPSX - 0.71in - 10.875in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Server.dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + + + + + + + + + true + true + + + + + =max(Code.SetHT(Fields!member.Value, Fields!Server.Value & "." & Fields!dbname.Value), "table1_Group1") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.25in + + + + + true + true + + + + + =Fields!member.Value + + + + + + + + true + true + + + + + =Code.GetHT(Fields!member.Value) + + + + + + + + + + + + + + + + + + After + true + + + + + =Fields!member.Value + + + + + =Fields!member.Value + + + + + + Detail + + + + + true + + + + Detail_Collection + Output + true + + + Before + true + + + + + + SQLPSX + 0.71in + 10.875in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + + - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Server.Value - - true - - - - - Server - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!dbname.Value - - true - - - - - dbname - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!Login.Value - - true - - - - - Login - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectType.Value - - true - - - - - Object Type - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - =Fields!ObjectName.Value - - true - - - - - Object Name - - - - - - SteelBlue - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.21in - - - - - true - true - - - - - =Fields!LoginType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Server.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!dbname.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Login.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectType.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ObjectName.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - true - true - - - - Detail - - - - - Detail_Collection - Output - true - - - - SQLPSX - 0.43in - 7.95832in - - - - - - - - - - - - - true - true - - - - - =Globals!PageNumber - - - - - - - - true - true - - - - - Of - - - - - - - true - true - - - - - =Globals!TotalPages - - - - - - - - true - true - - - - - =Parameters!timestamp.Value - - - - - - - true - true - - - - - Capture Date: - - - - - - - + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Server.Value + + true + + + + + Server + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!dbname.Value + + true + + + + + dbname + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!Login.Value + + true + + + + + Login + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectType.Value + + true + + + + + Object Type + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!ObjectName.Value + + true + + + + + Object Name + + + + + + SteelBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.21in + + + + + true + true + + + + + =Fields!LoginType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Server.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!dbname.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Login.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectType.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ObjectName.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + true + true + + + + Detail + + + + + Detail_Collection + Output + true + + + + SQLPSX + 0.43in + 7.95832in + + + + + + + + + + + + + true + true + + + + + =Globals!PageNumber + + + + + + + + true + true + + + + + Of + + + + + + + true + true + + + + + =Globals!TotalPages + + + + + + + + true + true + + + + + =Parameters!timestamp.Value + + + + + + + true + true + + + + + Capture Date: + + + + + + +