Microsoft
70-433 · Question #139
You have a server named Contoso with multiple databases. You have been tasked to write a PowerShell script to determine which databases on the server are larger than 100GB. You open PowerShell from…
The correct answer is A. $Server.Databases | Where-Object{($_.Size * $MultipleOfGB) -gt 100GB\}. See the full explanation below for the reasoning.
Question
You have a server named Contoso with multiple databases. You have been tasked to write a PowerShell script to determine which databases on the server are larger than 100GB. You open PowerShell from SQL Server Management Studio. You create two variables as follows:
PS SQLSERVER:\SQL\Contoso> $MultipleOfGB = 1024 * 1024 PS SQLSERVER:\SQL\Contoso> $Server = Get-Item You need to determine which script will produce the desired list of databases. What script should you use?
Options
- A$Server.Databases | Where-Object{($_.Size * $MultipleOfGB) -gt 100GB}
- B$Server | Where-Object{($_.DatabaseSize * $MultipleOfGB) -match 100GB}
- C$Server | Where-Object{($_.DatabaseSize * $MultipleOfGB) -gt 100GB}
- D$Server.Databases | Where-Object{($_.Size * $MultipleOfGB) -match 100GB}
How the community answered
(37 responses)- A84% (31)
- B3% (1)
- C3% (1)
- D11% (4)
Community Discussion
No community discussion yet for this question.