martes, 18 de agosto de 2015

Controlar el tiempo que lleva una aplicación activa con Powershell

Powershell

http://rlbisbe.net/2013/01/31/controlar-el-tiempo-que-lleva-una-aplicacion-activa-con-powershell/



Powershell es una herramienta muy versátil para desarrolladores y administradores de sistema, ya que, al igual que la shell de unix, permite automatizar tareas repetitivas con facilidad. Una de estas tareas puede ser controlar un proceso, aplicación o programa, cuanto tiempo lleva activo, y el uso de recursos que está haciendo.
En este artículo se verá cómo obtener el tiempo de un proceso en Powershell, el uso de CPU y RAM, así como enviar un e-mail con esa información de manera periódica.

Obteniendo la información del programa

Powershell recopila toda la información posible de un programa en el comando:
Get-Process Nombre_del_ejecutable (por ejemplo iexplore)
Este comando devuelve toda la información del mismo, desde la fecha de inicio, hasta los consumos actuales de CPU o RAM.

lunes, 11 de mayo de 2015

Performance Dashboard Reports in SQL Server 2014

SQL Server

http://www.sqlshack.com/performance-dashboard-reports-sql-server-2014/









Performance Dashboard Reports in SQL Server 2014

by 

SQL Server Management Studio provides a set of standard reports that show basic performance information. These reports are available out of the box, no previous installation and configuration is needed. There are more than 20 reports that show usually required monitoring and troubleshooting information at the SQL Server instance level. 

As these reports don’t provide enough information for SQL Server performance monitoring and troubleshooting, Microsoft has created a set of performance dashboard reports that provide more insight into what’s going on with your SQL Server.
Although there are still no Performance Dashboard Reports for SQL Server 2014, we used the reports for SQL Server 2012 and tested them on SQL Server 2014.

Getting started with Performance Dashboard Reports

SQL Server Performance Dashboard Reports are custom reports made to make performance monitoring easier. Keep in mind that these are ready to use reports and SQL Server Reporting Services don’t have to be installed on the SQL Server where you will use them.
Similar to standard reports, these reports help with identifying CPU usage, IO activity, blocks, bottlenecks, missing indexes, etc. As the values for the reports are mostly obtained from dynamic management views, such as sys.dm_os_performance_counters, sys. dm_os_memory_clerks, sys.dm_exec_requests, etc. no overhead is added to monitor the performance. To be able to query these views, the SQL Server login must have the VIEW SERVER STATE server permission.

sábado, 17 de enero de 2015

Windows 8 Administrative Shares: 'Access is Denied'

SQL Server

http://www.computerperformance.co.uk/win8/windows8-administrative-shares.htm



Windows 8 Administrative Shares: 'Access is Denied'Windows 8 Access is Denied Administrative Shares

For security reasons the built-in admin$ family of hidden shares has been disabled in Windows 8.

Windows 8 Administrative Shares


Windows 8 Administrative Shares Access Denied

The situation: you try to connect to a network machine via a hidden share such as c$ or admin$ (\\MachineName\c$), and receive an error messages:
  • Access is denied.
  • The specified username is invalid.
  • You may not have permission to use this network share.

Solutions for Access is Denied to Administrative Shares

  1. One solution may be to accept the situation and abandon your attempt to connect via C$.  You could try remote desktop instead.  I say this not because the challenge is too difficult, but because the default is the securest configuration for remote user account control (UAC).  Once you enable these hidden admin$ shares then your machine can be attacked by hackers.  Indeed, that is why Microsoft removed this capability, even though it was popular with XP and Windows 98 users.

viernes, 9 de enero de 2015

PowerShell


http://ss64.com/ps/




Arrays - http://ss64.com/ps/syntax-arrays.html

A PowerShell array holds a list of data items.
The data elements of a PowerShell array need not be of the same type, unless the data type is declared (strongly typed).

Creating Arrays
To create an Array just separate the elements with commas.

Create an array named $myArray containing elements with a mix of data types:

$myArray = 1,"Hello",3.5,"World"

or using explicit syntax:
$myArray = @(1,"Hello",3.5,"World")

To distribute the values back into individual variables:
$var1,$var2,$var3,$var4=$myArray

Create an array containing several numeric (int) values:

miércoles, 7 de enero de 2015

SQL Server Error Messages - Msg 306 - The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

SQL Server

http://www.sql-server-helper.com/error-messages/msg-306.aspx



Error Message

Server: Msg 306, Level 16, State 1, Line 1
The text, ntext, and image data types cannot be compared
or sorted, except when using IS NULL or LIKE operator.

Causes

NTEXT data types are used for variable-length of Unicode data, TEXT data types are used for variable-length non-Unicode data while IMAGE data types are used for variable-length binary data.
One way of getting this error is when including a column of TEXT, NTEXT or IMAGE data type in the ORDER BY clause. To illustrate, here’s a script that will generate this error message:

CREATE TABLE [dbo].[BookSummary] (
    [BookSummaryID]     INT NOT NULL IDENTITY(1, 1),
    [BookName]          NVARCHAR(200),
    [Author]            NVARCHAR(100),
    [Summary]           NTEXT
)

SELECT * FROM [dbo].[BookSummary]
ORDER BY [Summary]

Msg 306, Level 16, State 2, Line 2
The text, ntext, and image data types cannot be compared or sorted,
except when using IS NULL or LIKE operator.

Another way of getting this error is including a column of TEXT, NTEXT or IMAGE data type as part of a GROUP BY clause, as can be seen in the following script: