Initialize-ASMonitoringSqlDatabase

Initialize-ASMonitoringSqlDatabase

Adds the monitoring database objects to an SQL database, and creates the database if it does not already exist.

Syntax

Parameter Set: DatabaseNameAndServerName
Initialize-ASMonitoringSqlDatabase -Database <String> [-Admins <String> ] [-Force] [-Readers <String> ] [-Server <String> ] [-Writers <String> ] [ <CommonParameters>]

Parameters

-Admins<String>

Windows User(s) or Group(s) that will be assigned to the MonitoringDbAdmin role. This will be the AS_Administrators Windows security group.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-ConnectionString<String>

SQL Server connection string.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Database<String>

Name of the SQL database.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Force

Forces the command to execute without asking for user confirmation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-Readers<String>

Windows User(s) or Group(s) that will be assigned to the MonitoringDbReader role. This will be the AS_Observers Windows security group.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-Server<String>

SQL Instance Name (e.g. MachineA or MachineA/SQLEXPRESS).

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Writers<String>

Windows User(s) or Group(s) that will be assigned to the MonitoringDbWriter role. This will be the AS_Administrators Windows security group.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • DatabaseInfo

Examples

Example 1

Running the Initialize-ASMonitoringSqlDatabase cmdlet creates a new monitoring database named MyServiceStore. It initializes the store to receive monitoring information. The AS_Observers Windows security group is added to the MonitoringDbReader role, while the AS_Administrators Windows security group is added to both the MonitoringDBWriter and MonitoringDBAdmin roles. The NT AUTHORITY\LOCAL SERVICE account is also added to the MonitoringDBAdmin role for use with the Event Collection service and Workflow Management service.

PS C:\Windows\system32> Initialize-ASMonitoringSqlDatabase -Database "MyServiceStore" -Admins "AS_Administrators" -Readers "AS_Observers" -Writers "AS_Administrators"Server : MICROSO-XNMDH06Database : MyServiceStoreConnectionString : Data Source=MICROSO-XNMDH06;Initial Catalog=OrderService_PS;Integrated Security=True