bin/dbatools-index.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
[
    {
        "CommandName":  "Add-DbaComputerCertificate",
        "Description":  "Adds a computer certificate from a local or remote computer.",
        "Tags":  "Certificate",
        "Synopsis":  "Adds a computer certificate - useful for older systems.",
        "Name":  "Add-DbaComputerCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eAdd-DbaComputerCertificate -ComputerName Server1 -Path C:\\temp\\cert.cer\r\n\r\nAdds the local C:\\temp\\cer.cer to the remote server Server1 in LocalMachine\\My (Personal).\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eAdd-DbaComputerCertificate -Path C:\\temp\\cert.cer\r\n\r\nAdds the local C:\\temp\\cer.cer to the local computer\u0027s LocalMachine\\My (Personal) certificate store.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Backup-DbaDatabase",
        "Description":  "Performs a backup of a specified type of 1 or more databases on a SQL Server Instance. These backups may be Full, Differential or Transaction log backups.",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup",
                     "Restore"
                 ],
        "Synopsis":  "Backup one or more SQL Sever databases from a SQL Server SqlInstance.",
        "Name":  "Backup-DbaDatabase",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabase -SqlInstance Server1 -Database HR, Finance\r\n\r\nThis will perform a full database backup on the databases HR and Finance on SQL Server Instance Server1 to Server1\u0027s \r\ndefault backup directory.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabase -SqlInstance sql2016 -BackupDirectory C:\\temp -Database AdventureWorks2014 -Type Full\r\n\r\nBacks up AdventureWorks2014 to sql2016\u0027s C:\\temp folder.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabase -SqlInstance sql2016 -AzureBaseUrl https://dbatoolsaz.blob.core.windows.net/azbackups/ \r\n-AzureCredential dbatoolscred -Type Full -CreateFolder\r\n\r\nPerforms a full backup of all databases on the sql2016 instance to their own containers under the \r\nhttps://dbatoolsaz.blob.core.windows.net/azbackups/ container on Azure blog storage using the sql credential \r\n\"dbatoolscred\" registered on the sql2016 instance.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Backup-DbaDatabaseCertificate",
        "Description":  "Exports database certificates from SQL Server using SMO and outputs the .cer and .pvk files.",
        "Tags":  [
                     "Migration",
                     "Certificate"
                 ],
        "Synopsis":  "Exports database certificates from SQL Server using SMO.",
        "Name":  "Backup-DbaDatabaseCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseCertificate -SqlInstance Server1\r\n\r\nExports all the certificates on the specified SQL Server to the default data path for the instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$cred = Get-Credential sqladmin\r\n\r\nBackup-DbaDatabaseCertificate -SqlInstance Server1 -SqlCredential $cred\r\n\r\nConnects using sqladmin credential and exports all the certificates on the specified SQL Server to the default data \r\npath for the instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseCertificate -SqlInstance Server1 -Certificate Certificate1\r\n\r\nExports only the certificate named Certificate1 on the specified SQL Server to the default data path for the instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseCertificate -SqlInstance Server1 -Database AdventureWorks\r\n\r\nExports only the certificates for AdventureWorks on the specified SQL Server to the default data path for the instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseCertificate -SqlInstance Server1 -ExcludeDatabase AdventureWorks\r\n\r\nExports all certificates except those for AdventureWorks on the specified SQL Server to the default data path for the \r\ninstance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseCertificate -SqlInstance Server1 -Path \\\\Server1\\Certificates -EncryptionPassword \r\n(ConvertTo-SecureString -force -AsPlainText GoodPass1234!!)\r\n\r\nExports all the certificates and private keys on the specified SQL Server.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003e$EncryptionPassword = ConvertTo-SecureString -AsPlainText \"GoodPass1234!!\" -force\r\n\r\n$DecryptionPassword = ConvertTo-SecureString -AsPlainText \"Password4567!!\" -force\r\nBackup-DbaDatabaseCertificate -SqlInstance Server1 -EncryptionPassword $EncryptionPassword -DecryptionPassword \r\n$DecryptionPassword\r\nExports all the certificates on the specified SQL Server using the supplied DecryptionPassword, since an \r\nEncryptionPassword is specified private keys are also exported.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseCertificate -SqlInstance Server1 -Path \\\\Server1\\Certificates\r\n\r\nExports all certificates on the specified SQL Server to the specified path.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 9 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseCertificate -SqlInstance Server1 -Suffix DbaTools\r\n\r\nExports all certificates on the specified SQL Server to the specified path, appends DbaTools to the end of the \r\nfilenames.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 10 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseCertificate -SqlInstance sql2016 | Backup-DbaDatabaseCertificate\r\n\r\nExports all certificates found on sql2016 to the default data directory.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Backup-DbaDatabaseMasterKey",
        "Description":  "Backs up specified database master key.",
        "Tags":  [
                     "Certificate",
                     "Databases"
                 ],
        "Synopsis":  "Backs up specified database master key.",
        "Name":  "Backup-DbaDatabaseMasterKey",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseMasterKey -SqlInstance server1\\sql2016\r\n\r\nPrompts for export password, then logs into server1\\sql2016 with Windows credentials then backs up all database keys to \r\nthe default backup directory.\r\n\t\r\nComputerName : SERVER1\r\nInstanceName : SQL2016\r\nSqlInstance : SERVER1\\SQL2016\r\nDatabase : master\r\nFilename : E:\\MSSQL13.SQL2016\\MSSQL\\Backup\\server1$sql2016-master-20170614162311.key\r\nStatus : Success\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eBackup-DbaDatabaseMasterKey -SqlInstance Server1 -Database db1 -Path \\\\nas\\sqlbackups\\keys\r\n\r\nLogs into sql2016 with Windows credentials then backs up db1\u0027s keys to the \\\\nas\\sqlbackups\\keys directory.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Clear-DbaSqlConnectionPool",
        "Description":  "This command resets (or empties) the connection pool.\n\nIf there are connections in use at the time of the call, they are marked appropriately and will be discarded (instead of being returned to the pool) when Close() is called on them.\n\nRef: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.clearallpools(v=vs.110).aspx",
        "Tags":  "Connection",
        "Synopsis":  "Resets (or empties) the connection pool.",
        "Name":  "Clear-DbaSqlConnectionPool",
        "Links":  "https://dbatools.io/Clear-DbaSqlConnectionPool",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eClear-DbaSqlConnectionPool\r\n\r\nClears all local connection pools.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eClear-DbaSqlConnectionPool -ComputerName workstation27\r\n\r\nClears all connection pools on workstation27.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Connect-DbaSqlServer",
        "Description":  "This command is robust because it initializes properties that do not cause enumeration by default. It also supports both Windows and SQL Server authentication methods, and detects which to use based upon the provided credentials. \n\nBy default, this command also sets the connection\u0027s ApplicationName property to \"dbatools PowerShell module - dbatools.io - custom connection\". If you\u0027re doing anything that requires profiling, you can look for this client name.\n\nAlternatively, you can pass in whichever client name you\u0027d like using the -ClientName parameter. There are a ton of other parameters for you to explore as well.\n \nSee https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx\nand https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx,\nand https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx\n\nTo execute SQL commands, you can use $server.ConnectionContext.ExecuteReader($sql) or $server.Databases[\u0027master\u0027].ExecuteNonQuery($sql)",
        "Synopsis":  "Creates a robust SMO SQL Server object.",
        "Name":  "Connect-DbaSqlServer",
        "Links":  "https://dbatools.io/Connect-DbaSqlServer",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eConnect-DbaSqlServer -SqlInstance sql2014\r\n\r\nCreates an SMO Server object that connects using Windows Authentication\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$wincred = Get-Credential ad\\sqladmin\r\n\r\nConnect-DbaSqlServer -SqlInstance sql2014 -Credential $wincred\r\n\r\nCreates an SMO Server object that connects using alternative Windows credentials\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$sqlcred = Get-Credential sqladmin\r\n\r\n$server = Connect-DbaSqlServer -SqlInstance sql2014 -Credential $sqlcred\r\n\r\nLogin to sql2014 as SQL login sqladmin.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$server = Connect-DbaSqlServer -SqlInstance sql2014 -ClientName \"my connection\"\r\n\r\nCreates an SMO Server object that connects using Windows Authentication and uses the client name \"my connection\". So \r\nwhen you open up profiler or use extended events, you can search for \"my connection\".\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e$server = Connect-DbaSqlServer -SqlInstance sql2014 -AppendConnectionString \"Packet \r\nSize=4096;AttachDbFilename=C:\\MyFolder\\MyDataFile.mdf;User Instance=true;\"\r\n\r\nCreates an SMO Server object that connects to sql2014 using Windows Authentication, then it sets the packet size (this \r\ncan also be done via -PacketSize) and other connection attributes.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003e$server = Connect-DbaSqlServer -SqlInstance sql2014 -NetworkProtocol TcpIp -MultiSubnetFailover\r\n\r\nCreates an SMO Server object that connects using Windows Authentication that uses TCP/IP and has MultiSubnetFailover \r\nenabled.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003e$server = Connect-DbaSqlServer sql2016 -ApplicationIntent ReadOnly\r\n\r\nConnects with ReadOnly ApplicationIntent.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaAgentAlert",
        "Description":  "By default, all alerts are copied. The -Alert parameter is auto-populated for command-line completion and can be used to copy only specific alerts.\n\nIf the alert already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "Agent"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaAgentAlert migrates alerts from one SQL Server to another.",
        "Name":  "Copy-DbaAgentAlert",
        "Links":  "https://dbatools.io/Copy-DbaAgentAlert",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentAlert -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all alerts from sqlserver2014a to sqlcluster using Windows credentials. If alerts with the same name exist on \r\nsqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentAlert -Source sqlserver2014a -Destination sqlcluster -Alert PSAlert -SourceSqlCredential $cred \r\n-Force\r\n\r\nCopies a only the alert named PSAlert from sqlserver2014a to sqlcluster using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster. If a alert with the same name exists on sqlcluster, it will be dropped and \r\nrecreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentAlert -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaAgentCategory",
        "Description":  "By default, all SQL Agent categories for Jobs, Operators and Alerts are copied.\n\nThe -OperatorCategories parameter is auto-populated for command-line completion and can be used to copy only specific operator categories.\nThe -AgentCategories parameter is auto-populated for command-line completion and can be used to copy only specific agent categories.\nThe -JobCategories parameter is auto-populated for command-line completion and can be used to copy only specific job categories.\n\nIf the category already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "Agent"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaAgentCategory migrates SQL Agent categories from one SQL Server to another. This is similar to sp_add_category.\n\nhttps://msdn.microsoft.com/en-us/library/ms181597.aspx",
        "Name":  "Copy-DbaAgentCategory",
        "Links":  "https://dbatools.io/Copy-DbaAgentCategory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentCategory -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all operator categories from sqlserver2014a to sqlcluster, using Windows credentials. If operator categories \r\nwith the same name exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentCategory -Source sqlserver2014a -Destination sqlcluster -OperatorCategory PSOperator \r\n-SourceSqlCredential $cred -Force\r\n\r\nCopies a single operator category, the PSOperator operator category from sqlserver2014a to sqlcluster, using SQL \r\ncredentials for sqlserver2014a and Windows credentials for sqlcluster. If a operator category with the same name exists \r\non sqlcluster, it will be dropped and recreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentCategory -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaAgentJob",
        "Description":  "By default, all jobs are copied. The -Job parameter is auto-populated for command-line completion and can be used to copy only specific jobs.\n\nIf the job already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "Agent",
                     "Job"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaAgentJob migrates jobs from one SQL Server to another.",
        "Name":  "Copy-DbaAgentJob",
        "Links":  "https://dbatools.io/Copy-DbaAgentJob",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentJob -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all jobs from sqlserver2014a to sqlcluster, using Windows credentials. If jobs with the same name exist on \r\nsqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentJob -Source sqlserver2014a -Destination sqlcluster -Job PSJob -SourceSqlCredential $cred -Force\r\n\r\nCopies a single job, the PSJob job from sqlserver2014a to sqlcluster, using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster. If a job with the same name exists on sqlcluster, it will be dropped and recreated \r\nbecause -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentJob -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaAgentOperator",
        "Description":  "By default, all operators are copied. The -Operators parameter is auto-populated for command-line completion and can be used to copy only specific operators.\n\nIf the associated credentials for the operator do not exist on the destination, it will be skipped. If the operator already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "Agent",
                     "Operator"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaAgentOperator migrates operators from one SQL Server to another.",
        "Name":  "Copy-DbaAgentOperator",
        "Links":  "https://dbatools.io/Copy-DbaAgentOperator",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentOperator -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all operators from sqlserver2014a to sqlcluster using Windows credentials. If operators with the same name exist \r\non sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentOperator -Source sqlserver2014a -Destination sqlcluster -Operator PSOperator -SourceSqlCredential \r\n$cred -Force\r\n\r\nCopies only the PSOperator operator from sqlserver2014a to sqlcluster using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster. If an operator with the same name exists on sqlcluster, it will be dropped and \r\nrecreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentOperator -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaAgentProxyAccount",
        "Description":  "By default, all proxy accounts are copied. The -ProxyAccounts parameter is auto-populated for command-line completion and can be used to copy only specific proxy accounts.\n\nIf the associated credential for the account does not exist on the destination, it will be skipped. If the proxy account already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "Agent"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaAgentProxyAccount migrates proxy accounts from one SQL Server to another.",
        "Name":  "Copy-DbaAgentProxyAccount",
        "Links":  "https://dbatools.io/Copy-DbaAgentProxyAccount",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentProxyAccount -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all proxy accounts from sqlserver2014a to sqlcluster using Windows credentials. If proxy accounts with the same \r\nname exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentProxyAccount -Source sqlserver2014a -Destination sqlcluster -ProxyAccount PSProxy \r\n-SourceSqlCredential $cred -Force\r\n\r\nCopies only the PSProxy proxy account from sqlserver2014a to sqlcluster using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster. If a proxy account with the same name exists on sqlcluster, it will be dropped and \r\nrecreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentProxyAccount -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaAgentSharedSchedule",
        "Description":  "All shared job schedules are copied.\n\nIf the associated credential for the account does not exist on the destination, it will be skipped. If the shared job schedule already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "Agent"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaAgentSharedSchedule migrates shared job schedules from one SQL Server to another.",
        "Name":  "Copy-DbaAgentSharedSchedule",
        "Links":  "https://dbatools.io/Copy-DbaAgentSharedSchedule",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentSharedSchedule -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all shared job schedules from sqlserver2014a to sqlcluster using Windows credentials. If shared job schedules \r\nwith the same name exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaAgentSharedSchedule -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaBackupDevice",
        "Description":  "Backups are migrated using Admin shares. If the destination directory does not exist, SQL Server\u0027s default backup directory will be used.\n\nIf a backup device with same name exists on destination, it will not be dropped and recreated unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "DisasterRecovery",
                     "Backup"
                 ],
        "Synopsis":  "Copies backup devices one by one. Copies both SQL code and the backup file itself.",
        "Name":  "Copy-DbaBackupDevice",
        "Links":  "https://dbatools.io/Copy-DbaBackupDevice",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaBackupDevice -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all server backup devices from sqlserver2014a to sqlcluster using Windows credentials. If backup devices with \r\nthe same name exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaBackupDevice -Source sqlserver2014a -Destination sqlcluster -BackupDevice backup01 -SourceSqlCredential \r\n$cred -Force\r\n\r\nCopies only the backup device named backup01 from sqlserver2014a to sqlcluster using SQL credentials for sqlserver2014a\t\r\nand Windows credentials for sqlcluster. If a backup device with the same name exists on sqlcluster, it will be dropped \r\nand recreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaBackupDevice -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaCentralManagementServer",
        "Description":  "Copy-DbaCentralManagementServer copies all groups, subgroups, and server instances from one SQL Server to another.",
        "Tags":  "Migration",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Migrates SQL Server Central Management groups and server instances from one SQL Server to another.",
        "Name":  "Copy-DbaCentralManagementServer",
        "Links":  "https://dbatools.io/Copy-DbaCentralManagementServer",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCentralManagementServer -Source sqlserver2014a -Destination sqlcluster\r\n\r\nAll groups, subgroups, and server instances are copied from sqlserver\u0027s Central Management Server to sqlcluster\u0027s \r\nCentral Management Server.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCentralManagementServer -Source sqlserver2014a -Destination sqlcluster -ServerGroup Group1,Group3\r\n\r\nTop-level groups Group1 and Group3 along with their subgroups and server instances are copied from sqlserver to \r\nsqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCentralManagementServer -Source sqlserver2014a -Destination sqlcluster -ServerGroup Group1,Group3 \r\n-SwitchServerName -SourceSqlCredential $SourceSqlCredential -DestinationSqlCredential $DestinationSqlCredential\r\n\r\nTop-level groups Group1 and Group3 along with their subgroups and server instances are copied from sqlserver to \r\nsqlcluster. When adding sql instances to sqlcluster, if the server name of the migrating instance is \"sqlcluster\", it \r\nwill be switched to \"sqlserver\".\r\n\r\nIf SwitchServerName is not specified, \"sqlcluster\" will be skipped.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaCredential",
        "Description":  "By using password decryption techniques provided by Antti Rantasaari (NetSPI, 2014), this script migrates SQL Server Credentials from one server to another while maintaining username and password.\n\nCredit: https://blog.netspi.com/decrypting-mssql-database-link-server-passwords/ \nLicense: BSD 3-Clause http://opensource.org/licenses/BSD-3-Clause",
        "Tags":  [
                     "WSMan",
                     "Migration"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaCredential migrates SQL Server Credentials from one SQL Server to another while maintaining Credential passwords.",
        "Name":  "Copy-DbaCredential",
        "Links":  "https://dbatools.io/Copy-DbaCredential",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCredential -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all SQL Server Credentials on sqlserver2014a to sqlcluster. If Credentials exist on destination, they will be \r\nskipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCredential -Source sqlserver2014a -Destination sqlcluster -CredentialIdentity \"PowerShell Proxy Account\" \r\n-Force\r\n\r\nCopies over one SQL Server Credential (PowerShell Proxy Account) from sqlserver to sqlcluster. If the Credential \r\nalready exists on the destination, it will be dropped and recreated.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaCustomError",
        "Description":  "By default, all custom errors are copied. The -CustomError parameter is auto-populated for command-line completion and can be used to copy only specific custom errors.\n\nIf the custom error already exists on the destination, it will be skipped unless -Force is used. The us_english version must be created first. If you drop the us_english version, all the other languages will be dropped for that specific ID as well.",
        "Tags":  [
                     "Migration",
                     "CustomError"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaCustomError migrates custom errors (user defined messages), by the custom error ID, from one SQL Server to another.",
        "Name":  "Copy-DbaCustomError",
        "Links":  "https://dbatools.io/Copy-DbaCustomError",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCustomError -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all server custom errors from sqlserver2014a to sqlcluster using Windows credentials. If custom errors with the \r\nsame name exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCustomError -Source sqlserver2014a -SourceSqlCredential $scred -Destination sqlcluster \r\n-DestinationSqlCredential $dcred -CustomError 60000 -Force\r\n\r\nCopies only the custom error with ID number 60000 from sqlserver2014a to sqlcluster using SQL credentials for \r\nsqlserver2014a and Windows credentials for sqlcluster. If a custom error with the same name exists on sqlcluster, it \r\nwill be updated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCustomError -Source sqlserver2014a -Destination sqlcluster -ExcludeCustomError 60000 -Force\r\n\r\nCopies all the custom errors found on sqlserver2014a except the custom error with ID number 60000 to sqlcluster. If a \r\ncustom error with the same name exists on sqlcluster, it will be updated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaCustomError -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaDatabase",
        "Description":  "This script provides the ability to migrate databases using detach/copy/attach or backup/restore. This script works with named instances, clusters and SQL Server Express Edition.\n\nBy default, databases will be migrated to the destination SQL Server\u0027s default data and log directories. You can override this by specifying -ReuseSourceFolderStructure. Filestreams and filegroups are also migrated. Safety is emphasized.",
        "Tags":  [
                     "Migration",
                     "DisasterRecovery",
                     "Backup",
                     "Restore"
                 ],
        "Synopsis":  "Migrates SQL Server databases from one SQL Server to another.",
        "Name":  "Copy-DbaDatabase",
        "Links":  "https://dbatools.io/Copy-DbaDatabase",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabase -Source sqlserver2014a -Destination sqlserver2014b -Database TestDB -BackupRestore \r\n-NetworkShare \\\\fileshare\\sql\\migration\r\n\r\nMigrates a single user database TestDB using Backup and restore from instance sqlserver2014a to sqlserver2014b. Backup \r\nfiles are stored in \\\\fileshare\\sql\\migration.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabase -Source sqlserver2014a -Destination sqlcluster -DetachAttach -Reattach\r\n\r\nDatabases will be migrated from sqlserver2014a to sqlcluster using the detach/copy files/attach method.The following \r\nwill be performed: kick all users out of the database, detach all data/log files, move files across the network over an \r\nadmin share (\\\\SqlSERVER\\M$\\MSSql...), attach file on destination server, reattach at source. If the database files \r\n(*.mdf, *.ndf, *.ldf) on *destination* exist and aren\u0027t in use, they will be overwritten.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabase -Source sqlserver2014a -Destination sqlcluster -ExcludeDatabase Northwind, pubs \r\n-IncludeSupportDbs -Force -BackupRestore -NetworkShare \\\\fileshare\\sql\\migration\r\n\r\nMigrates all user databases except for Northwind and pubs by using backup/restore (copy-only). Backup files are stored \r\nin \\\\fileshare\\sql\\migration. If the database exists on the destination, it will be dropped prior to attach.\r\n\r\nIt also includes the support databases (ReportServer, ReportServerTempDb, distribution).\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaDatabaseAssembly",
        "Description":  "By default, all assemblies are copied. \n\nIf the assembly already exists on the destination, it will be skipped unless -Force is used.\n\nThis script does not yet copy dependencies or dependent objects.",
        "Tags":  [
                     "Migration",
                     "Assembly"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaDatabaseAssembly migrates assemblies from one SQL Server to another.",
        "Name":  "Copy-DbaDatabaseAssembly",
        "Links":  "http://dbatools.io/Get-SqlDatabaseAssembly",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabaseAssembly -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all assemblies from sqlserver2014a to sqlcluster using Windows credentials. If assemblies with the same name \r\nexist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabaseAssembly -Source sqlserver2014a -Destination sqlcluster -Assembly dbname.assemblyname, \r\ndbname3.anotherassembly -SourceSqlCredential $cred -Force\r\n\r\nCopies two assemblies, the dbname.assemblyname and dbname3.anotherassembly from sqlserver2014a to sqlcluster using SQL \r\ncredentials for sqlserver2014a and Windows credentials for sqlcluster. If an assembly with the same name exists on \r\nsqlcluster, it will be dropped and recreated because -Force was used.\r\n\r\nIn this example, anotherassembly will be copied to the dbname3 database on the server sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaThing -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaDatabaseMail",
        "Description":  "By default, all mail configurations for Profiles, Accounts, Mail Servers and Configs are copied.",
        "Tags":  [
                     "Migration",
                     "Mail"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Migrates Mail Profiles, Accounts, Mail Servers and Mail Server Configs from one SQL Server to another.",
        "Name":  "Copy-DbaDatabaseMail",
        "Links":  "https://dbatools.io/Copy-DbaDatabaseMail",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabaseMail -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all database mail objects from sqlserver2014a to sqlcluster using Windows credentials. If database mail objects \r\nwith the same name exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabaseMail -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred\r\n\r\nCopies all database mail objects from sqlserver2014a to sqlcluster using SQL credentials for sqlserver2014a and Windows \r\ncredentials for sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabaseMail -Source sqlserver2014a -Destination sqlcluster -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaDatabaseMail -Source sqlserver2014a -Destination sqlcluster -Silent:$true\r\n\r\nPerforms execution of function, but disables output of all messages\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaEndpoint",
        "Description":  "By default, all endpoints are copied.\n\nIf the endpoint already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "Endpoint"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaEndpoint migrates server endpoints from one SQL Server to another.",
        "Name":  "Copy-DbaEndpoint",
        "Links":  "https://dbatools.io/Copy-DbaEndpoint",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaEndpoint -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all server endpoints from sqlserver2014a to sqlcluster, using Windows credentials. If endpoints with the same \r\nname exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaEndpoint -Source sqlserver2014a -SourceSqlCredential $cred -Destination sqlcluster -Endpoint tg_noDbDrop \r\n-Force\r\n\r\nCopies only the tg_noDbDrop endpoint from sqlserver2014a to sqlcluster using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster. If an endpoint with the same name exists on sqlcluster, it will be dropped and \r\nrecreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaEndpoint -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaExtendedEvent",
        "Description":  "Migrates SQL Extended Event Sessions except the two default sessions, AlwaysOn_health and system_health.\n\nBy default, all non-system Extended Events are migrated.",
        "Tags":  [
                     "Migration",
                     "ExtendedEvent",
                     "XEvent"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Migrates SQL Extended Event Sessions except the two default sessions, AlwaysOn_health and system_health.",
        "Name":  "Copy-DbaExtendedEvent",
        "Links":  "https://dbatools.io/Copy-DbaExtendedEvent",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaExtendedEvent -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all Extended Event sessions from sqlserver2014a to sqlcluster using Windows credentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaExtendedEvent -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred\r\n\r\nCopies all Extended Event sessions from sqlserver2014a to sqlcluster using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaExtendedEvent -Source sqlserver2014a -Destination sqlcluster -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaExtendedEvent -Source sqlserver2014a -Destination sqlcluster -XeSession CheckQueries, \r\nMonitorUserDefinedException\r\n\r\nCopies only the Extended Events named CheckQueries and MonitorUserDefinedException from sqlserver2014a to sqlcluster.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaLinkedServer",
        "Description":  "By using password decryption techniques provided by Antti Rantasaari (NetSPI, 2014), this script migrates SQL Server Linked Servers from one server to another, while maintaining username and password.\n\nCredit: https://blog.netspi.com/decrypting-mssql-database-link-server-passwords/\nLicense: BSD 3-Clause http://opensource.org/licenses/BSD-3-Clause",
        "Tags":  [
                     "WSMan",
                     "Migration",
                     "LinkedServer"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaLinkedServer migrates Linked Servers from one SQL Server to another. Linked Server logins and passwords are migrated as well.",
        "Name":  "Copy-DbaLinkedServer",
        "Links":  "https://dbatools.io/Copy-DbaLinkedServer",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLinkedServer -Source sqlserver2014a -Destination sqlcluster\r\n\r\nDescription\r\nCopies all SQL Server Linked Servers on sqlserver2014a to sqlcluster. If Linked Server exists on destination, it will \r\nbe skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLinkedServer -Source sqlserver2014a -Destination sqlcluster -LinkedServer SQL2K5,SQL2k -Force\r\n\r\nDescription\r\nCopies over two SQL Server Linked Servers (SQL2K and SQL2K2) from sqlserver to sqlcluster. If the credential already \r\nexists on the destination, it will be dropped.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaLogin",
        "Description":  "SQL Server 2000: Migrates logins with SIDs, passwords, server roles and database roles.\n\nSQL Server 2005 \u0026 newer: Migrates logins with SIDs, passwords, defaultdb, server roles \u0026 securables, database permissions \u0026 securables, login attributes (enforce password policy, expiration, etc.)\n\nThe login hash algorithm changed in SQL Server 2012, and is not backwards compatible with previous SQL Server versions. This means that while SQL Server 2000 logins can be migrated to SQL Server 2012, logins created in SQL Server 2012 can only be migrated to SQL Server 2012 and above.",
        "Tags":  [
                     "Migration",
                     "Login"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Migrates logins from source to destination SQL Servers. Supports SQL Server versions 2000 and newer.",
        "Name":  "Copy-DbaLogin",
        "Links":  "https://dbatools.io/Copy-DbaLogin",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLogin -Source sqlserver2014a -Destination sqlcluster -Force\r\n\r\nCopies all logins from Source Destination. If a SQL Login on Source exists on the Destination, the Login on Destination \r\nwill be dropped and recreated.\r\n\r\nIf active connections are found for a login, the copy of that Login will fail as it cannot be dropped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLogin -Source sqlserver2014a -Destination sqlcluster -Force -KillActiveConnection\r\n\r\nCopies all logins from Source Destination. If a SQL Login on Source exists on the Destination, the Login on Destination \r\nwill be dropped and recreated.\r\n\r\nIf any active connections are found they will be killed.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLogin -Source sqlserver2014a -Destination sqlcluster -Exclude realcajun -SourceSqlCredential $scred \r\n-DestinationSqlCredential $dcred\r\n\r\nCopies all Logins from Source to Destination except for realcajun using SQL Authentication to connect to both instances.\r\n\r\nIf a Login already exists on the destination, it will not be migrated.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLogin -Source sqlserver2014a -Destination sqlcluster -Login realcajun, netnerds -force\r\n\r\nCopies ONLY Logins netnerds and realcajun. If Login realcajun or netnerds exists on Destination, the existing Login(s) \r\nwill be dropped and recreated.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLogin -Source sqlserver2014a -Destination sqlcluster -SyncOnly\r\n\r\nSyncs only SQL Server login permissions, roles, etc. Does not add or drop logins or users.\r\n\r\nIf a matching Login does not exist on Destination, the Login will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaLogin -LoginRenameHashtable @{ \"OldUser\" =\"newlogin\" } -Source $Sql01 -Destination Localhost \r\n-SourceSqlCredential $sqlcred\r\n\r\nCopies OldUser and then renames it to newlogin.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaQueryStoreConfig",
        "Description":  "Copies the configuration of a Query Store enabled database and sets the copied configuration on other databases.",
        "Tags":  "QueryStore",
        "Author":  "Enrico van de Laar ( @evdlaar )",
        "Synopsis":  "Copies the configuration of a Query Store enabled database and sets the copied configuration on other databases.",
        "Name":  "Copy-DbaQueryStoreConfig",
        "Links":  "https://dbatools.io/Copy-QueryStoreConfig",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaQueryStoreConfig -Source ServerA\\SQL -SourceDatabase AdventureWorks -Destination ServerB\\SQL \r\n-AllDatabases\r\n\r\nCopy the Query Store configuration of the AdventureWorks database in the ServerA\\SQL Instance and apply it on all user \r\ndatabases in the ServerB\\SQL Instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaQueryStoreConfig -Source ServerA\\SQL -SourceDatabase AdventureWorks -Destination ServerB\\SQL \r\n-DestinationDatabase WorldWideTraders\r\n\r\nCopy the Query Store configuration of the AdventureWorks database in the ServerA\\SQL Instance and apply it to the \r\nWorldWideTraders database in the ServerB\\SQL Instance.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaResourceGovernor",
        "Description":  "By default, all non-system resource pools are migrated. If the pool already exists on the destination, it will be skipped unless -Force is used.\n\nThe -ResourcePool parameter is auto-populated for command-line completion and can be used to copy only specific objects.",
        "Tags":  [
                     "Migration",
                     "ResourceGovernor"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Migrates Resource Pools",
        "Name":  "Copy-DbaResourceGovernor",
        "Links":  "https://dbatools.io/Copy-DbaResourceGovernor",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaResourceGovernor -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all extended event policies from sqlserver2014a to sqlcluster, using Windows credentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaResourceGovernor -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred\r\n\r\nCopies all extended event policies from sqlserver2014a to sqlcluster, using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaResourceGovernor -Source sqlserver2014a -Destination sqlcluster -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaServerAudit",
        "Description":  "By default, all audits are copied. The -Audit parameter is auto-populated for command-line completion and can be used to copy only specific audits.\n\nIf the audit already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  "Migration",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaServerAudit migrates server audits from one SQL Server to another.",
        "Name":  "Copy-DbaServerAudit",
        "Links":  "https://dbatools.io/Copy-DbaServerAudit",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerAudit -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all server audits from sqlserver2014a to sqlcluster, using Windows credentials. If audits with the same name \r\nexist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerAudit -Source sqlserver2014a -Destination sqlcluster -Audit tg_noDbDrop -SourceSqlCredential $cred \r\n-Force\r\n\r\nCopies a single audit, the tg_noDbDrop audit from sqlserver2014a to sqlcluster, using SQL credentials for \r\nsqlserver2014a and Windows credentials for sqlcluster. If an audit with the same name exists on sqlcluster, it will be \r\ndropped and recreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerAudit -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaServerAuditSpecification",
        "Description":  "By default, all audits are copied. The -AuditSpecification parameter is auto-populated for command-line completion and can be used to copy only specific audits.\n\nIf the audit specification already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  [
                     "Migration",
                     "ServerAudit",
                     "AuditSpecification"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaServerAuditSpecification migrates server audit specifications from one SQL Server to another.",
        "Name":  "Copy-DbaServerAuditSpecification",
        "Links":  "https://dbatools.io/Copy-DbaServerAuditSpecification",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerAuditSpecification -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all server audits from sqlserver2014a to sqlcluster, using Windows credentials. If audits with the same name \r\nexist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerAuditSpecification -Source sqlserver2014a -Destination sqlcluster -ServerAuditSpecification \r\ntg_noDbDrop -SourceSqlCredential $cred -Force\r\n\r\nCopies a single audit, the tg_noDbDrop audit from sqlserver2014a to sqlcluster, using SQL credentials for \r\nsqlserver2014a and Windows credentials for sqlcluster. If an audit with the same name exists on sqlcluster, it will be \r\ndropped and recreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerAuditSpecification -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaServerTrigger",
        "Description":  "By default, all triggers are copied. The -ServerTrigger parameter is auto-populated for command-line completion and can be used to copy only specific triggers.\n\nIf the trigger already exists on the destination, it will be skipped unless -Force is used.",
        "Tags":  "Migration",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaServerTrigger migrates server triggers from one SQL Server to another.",
        "Name":  "Copy-DbaServerTrigger",
        "Links":  "https://dbatools.io/Copy-DbaServerTrigger",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerTrigger -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all server triggers from sqlserver2014a to sqlcluster, using Windows credentials. If triggers with the same name \r\nexist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerTrigger -Source sqlserver2014a -Destination sqlcluster -ServerTrigger tg_noDbDrop \r\n-SourceSqlCredential $cred -Force\r\n\r\nCopies a single trigger, the tg_noDbDrop trigger from sqlserver2014a to sqlcluster, using SQL credentials for \r\nsqlserver2014a and Windows credentials for sqlcluster. If a trigger with the same name exists on sqlcluster, it will be \r\ndropped and recreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaServerTrigger -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaSpConfigure",
        "Description":  "By default, all configuration values are copied. The -ConfigName parameter is auto-populated for command-line completion and can be used to copy only specific configs.",
        "Tags":  [
                     "Migration",
                     "Configure",
                     "SpConfigure"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy-DbaSpConfigure migrates configuration values from one SQL Server to another.",
        "Name":  "Copy-DbaSpConfigure",
        "Links":  "https://dbatools.io/Copy-DbaSpConfigure",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSpConfigure -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all sp_configure settings from sqlserver2014a to sqlcluster\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSpConfigure -Source sqlserver2014a -Destination sqlcluster -ConfigName DefaultBackupCompression, \r\nIsSqlClrEnabled -SourceSqlCredential $cred -Force\r\n\r\nUpdates the values for two configs, the IsSqlClrEnabled and DefaultBackupCompression, from sqlserver2014a to \r\nsqlcluster, using SQL credentials for sqlserver2014a and Windows credentials for sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSpConfigure -Source sqlserver2014a -Destination sqlcluster -ExcludeConfigName DefaultBackupCompression, \r\nIsSqlClrEnabled\r\n\r\nUpdates all configs except for IsSqlClrEnabled and DefaultBackupCompression, from sqlserver2014a to sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSpConfigure -Source sqlserver2014a -Destination sqlcluster -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaSqlDataCollector",
        "Description":  "By default, all data collector objects are migrated. If the object already exists on the destination, it will be skipped unless -Force is used.\n\nThe -CollectionSet parameter is auto-populated for command-line completion and can be used to copy only specific objects.",
        "Tags":  [
                     "Migration",
                     "DataCollection"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Migrates user SQL Data Collector collection sets. SQL Data Collector configuration is on the agenda, but it\u0027s hard.",
        "Name":  "Copy-DbaSqlDataCollector",
        "Links":  "https://dbatools.io/Copy-DbaSqlDataCollector",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlDataCollector -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all Data Collector Objects and Configurations from sqlserver2014a to sqlcluster, using Windows credentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlDataCollector -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred\r\n\r\nCopies all Data Collector Objects and Configurations from sqlserver2014a to sqlcluster, using SQL credentials for \r\nsqlserver2014a and Windows credentials for sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlDataCollector -Source sqlserver2014a -Destination sqlcluster -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlDataCollector -Source sqlserver2014a -Destination sqlcluster -CollectionSet \u0027Server Activity\u0027, \u0027Table \r\nUsage Analysis\u0027\r\n\r\nCopies two Collection Sets, Server Activity and Table Usage Analysis, from sqlserver2014a to sqlcluster.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaSqlPolicyManagement",
        "Description":  "By default, all policies and conditions are copied. If an object already exist on the destination, it will be skipped unless -Force is used.\n\nThe -Policy and -Condition parameters are auto-populated for command-line completion and can be used to copy only specific objects.",
        "Tags":  "Migration",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Migrates SQL Policy Based Management Objects, including both policies and conditions.",
        "Name":  "Copy-DbaSqlPolicyManagement",
        "Links":  "https://dbatools.io/Copy-DbaSqlPolicyManagement",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlPolicyManagement -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all policies and conditions from sqlserver2014a to sqlcluster, using Windows credentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlPolicyManagement -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred\r\n\r\nCopies all policies and conditions from sqlserver2014a to sqlcluster, using SQL credentials for sqlserver2014a and \r\nWindows credentials for sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlPolicyManagement -Source sqlserver2014a -Destination sqlcluster -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlPolicyManagement -Source sqlserver2014a -Destination sqlcluster -Policy \u0027xp_cmdshell must be disabled\u0027\r\n\r\nCopies only one policy, \u0027xp_cmdshell must be disabled\u0027 from sqlserver2014a to sqlcluster. No conditions are migrated.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaSqlServerAgent",
        "Description":  "A wrapper function that calls the associated Copy command for the objects under SQL Server Agent in SSMS.\nAs well as the SQL Agent properties (job history max rows, DBMail profile name, etc.).\n\nCopies *all of it*.\n\nYou must have sysadmin access and server version must be SQL Server version 2000 or greater.",
        "Tags":  [
                     "Migration",
                     "SqlServerAgent",
                     "SqlAgent"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Copy SQL Server Agent from one server to another.",
        "Name":  "Copy-DbaSqlServerAgent",
        "Links":  "https://dbatools.io/Copy-DbaSqlServerAgent",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlServerAgent -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all job server objects from sqlserver2014a to sqlcluster, using Windows credentials. If job objects with the \r\nsame name exist on sqlcluster, they will be skipped.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlServerrAgent -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred\r\n\r\nCopies all job objects from sqlserver2014a to sqlcluster, using SQL credentials for sqlserver2014a and Windows \r\ncredentials for sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSqlServerAgent -Source sqlserver2014a -Destination sqlcluster -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaSsisCatalog",
        "Description":  "By default, all folders, projects, and environments are copied. \nThe -Project parameter can be specified to copy only one project, if desired.\nThe parameters get more granular from the Folder level. i.e. specifying folder will only deploy projects/environments from within that folder.",
        "Tags":  [
                     "Migration",
                     "SSIS"
                 ],
        "Synopsis":  "Copy-DbaSsisCatalog migrates Folders, SSIS projects, and environments from one SQL Server to another.",
        "Name":  "Copy-DbaSsisCatalog",
        "Links":  "https://dbatools.io/Copy-DbaSsisCatalog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSsisCatalog -Source sqlserver2014a -Destination sqlcluster\r\n\r\nCopies all folders, environments and all ssis Projects from sqlserver2014a to sqlcluster, using Windows credentials. If \r\nfolders with the same name exist on the destination they will be skipped, but projects will be redeployed.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSsisCatalog -Source sqlserver2014a -Destination sqlcluster -Project Archive_Tables -SourceSqlCredential \r\n$cred -Force\r\n\r\nCopies a single Project, the Archive_Tables Project from sqlserver2014a to sqlcluster, using SQL credentials for \r\nsqlserver2014a\r\nand Windows credentials for sqlcluster. If a Project with the same name exists on sqlcluster, it will be deleted and \r\nrecreated because -Force was used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSsisCatalog -Source sqlserver2014a -Destination sqlcluster -WhatIf -Force\r\n\r\nShows what would happen if the command were executed using force.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$SecurePW = Read-Host \"Enter password\" -AsSecureString\r\n\r\nCopy-DbaSsisCatalog -Source sqlserver2014a -Destination sqlcluster -CreateCatalogPassword $SecurePW\r\n\r\nDeploy entire SSIS catalog to an instance without a destination catalog. Passing -CreateCatalogPassword will bypass \r\nany user prompts for creating the destination catalog.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Copy-DbaSysDbUserObject",
        "Description":  "Imports *all* user objects found in source SQL Server\u0027s master, msdb and model databases to the destination. This is useful because many DBA\u0027s store backup/maintenance procs/tables/triggers/etc (among other things) in master or msdb.\n\nIt is also useful for migrating objects within the model database.",
        "Tags":  [
                     "Migration",
                     "SystemDatabase",
                     "UserObject"
                 ],
        "Synopsis":  "Imports *all* user objects found in source SQL Server\u0027s master, msdb and model databases to the destination.",
        "Name":  "Copy-DbaSysDbUserObject",
        "Links":  "https://dbatools.io/Copy-DbaSysDbUserObject",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eCopy-DbaSysDbUserObject $sourceServer $destserve\r\n\r\nCopies user objects from source to destination\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Disable-DbaForceNetworkEncryption",
        "Description":  "Disables Force Encryption for a SQL Server instance. Note that this requires access to the Windows Server, not the SQL instance itself.\n\nThis setting is found in Configuration Manager.",
        "Tags":  "Certificate",
        "Synopsis":  "Disables Force Encryption for a SQL Server instance",
        "Name":  "Disable-DbaForceNetworkEncryption",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eDisable-DbaForceNetworkEncryption\r\n\r\nDisables Force Encryption on the default (MSSQLSERVER) instance on localhost - requires (and checks for) RunAs admin.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eDisable-DbaForceNetworkEncryption -SqlInstance sql01\\SQL2008R2SP2\r\n\r\nDisables Force Network Encryption for the SQL2008R2SP2 on sql01. Uses Windows Credentials to both login and modify the \r\nregistry.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eDisable-DbaForceNetworkEncryption -SqlInstance sql01\\SQL2008R2SP2 -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Dismount-DbaDatabase",
        "Description":  "This command detaches one or more SQL Server databases. If necessary, -Force can be used to break mirrors and remove databases from availability groups prior to detaching.",
        "Tags":  "Database",
        "Synopsis":  "Detach a SQL Server Database.",
        "Name":  "Dismount-DbaDatabase",
        "Links":  "https://dbatools.io/Dismount-DbaDatabase",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eDetach-DbaDatabase -SqlInstance sql2016b -Database SharePoint_Config, WSS_Logging\r\n\r\nDetaches SharePoint_Config and WSS_Logging from sql2016b\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance sql2016b -Database \u0027PerformancePoint Service \r\nApplication_10032db0fa0041df8f913f558a5dc0d4\u0027 | Detach-DbaDatabase -Force\r\n\r\nDetaches \u0027PerformancePoint Service Application_10032db0fa0041df8f913f558a5dc0d4\u0027 from sql2016b. Since Force was \r\nspecified, if the database is part of mirror, the mirror will be broken prior to detaching.\r\n\r\nIf the database is part of an Availability Group, it will first be dropped prior to detachment.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance sql2016b -Database WSS_Logging | Detach-DbaDatabase -Force -WhatIf\r\n\r\nShows what would happen if the command were to execute (without actually executing the detach/break/remove commands).\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Enable-DbaForceNetworkEncryption",
        "Description":  "Enables Force Encryption for a SQL Server instance. Note that this requires access to the Windows Server, not the SQL instance itself.\n\nThis setting is found in Configuration Manager.",
        "Tags":  "Certificate",
        "Synopsis":  "Enables Force Encryption for a SQL Server instance.",
        "Name":  "Enable-DbaForceNetworkEncryption",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eEnable-DbaForceNetworkEncryption\r\n\r\nEnables Force Encryption on the default (MSSQLSERVER) instance on localhost. Requires (and checks for) RunAs admin.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eEnable-DbaForceNetworkEncryption -SqlInstance sql01\\SQL2008R2SP2\r\n\r\nEnables Force Network Encryption for the SQL2008R2SP2 on sql01. Uses Windows Credentials to both connect and modify the \r\nregistry.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eEnable-DbaForceNetworkEncryption -SqlInstance sql01\\SQL2008R2SP2 -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Expand-DbaTLogResponsibly",
        "Description":  "As you may already know, having a transaction log file with too many Virtual Log Files (VLFs) can hurt your database performance in many ways.\n\nExample:\n Too many VLFs can cause transaction log backups to slow down and can also slow down database recovery and, in extreme cases, even impact insert/update/delete performance.\n\n References:\n http://www.sqlskills.com/blogs/kimberly/transaction-log-vlfs-too-many-or-too-few/\n http://blogs.msdn.com/b/saponsqlserver/archive/2012/02/22/too-many-virtual-log-files-vlfs-can-cause-slow-database-recovery.aspx\n http://www.brentozar.com/blitz/high-virtual-log-file-vlf-count/\n \n In order to get rid of this fragmentation we need to grow the file taking the following into consideration:\n - How many VLFs are created when we perform a grow operation or when an auto-grow is invoked?\n \n Note: In SQL Server 2014 this algorithm has changed (http://www.sqlskills.com/blogs/paul/important-change-vlf-creation-algorithm-sql-server-2014/)\n\nAttention:\n We are growing in MB instead of GB because of known issue prior to SQL 2012:\n More detail here: \n http://www.sqlskills.com/BLOGS/PAUL/post/Bug-log-file-growth-broken-for-multiples-of-4GB.aspx\n and \n http://connect.microsoft.com/SqlInstance/feedback/details/481594/log-growth-not-working-properly-with-specific-growth-sizes-vlfs-also-not-created-appropriately\n or \n https://connect.microsoft.com/SqlInstance/feedback/details/357502/transaction-log-file-size-will-not-grow-exactly-4gb-when-filegrowth-4gb\n\nUnderstanding related problems:\n http://www.sqlskills.com/blogs/kimberly/transaction-log-vlfs-too-many-or-too-few/\n http://blogs.msdn.com/b/saponsqlserver/archive/2012/02/22/too-many-virtual-log-files-vlfs-can-cause-slow-database-recovery.aspx\n http://www.brentozar.com/blitz/high-virtual-log-file-vlf-count/\n \nKnown bug before SQL Server 2012\n http://www.sqlskills.com/BLOGS/PAUL/post/Bug-log-file-growth-broken-for-multiples-of-4GB.aspx\n http://connect.microsoft.com/SqlInstance/feedback/details/481594/log-growth-not-working-properly-with-specific-growth-sizes-vlfs-also-not-created-appropriately\n https://connect.microsoft.com/SqlInstance/feedback/details/357502/transaction-log-file-size-will-not-grow-exactly-4gb-when-filegrowth-4gb\n\nHow it works?\n The transaction log will grow in chunks until it reaches the desired size. \n Example: If you have a log file with 8192MB and you say that the target size is 81920MB (80GB) it will grow in chunks of 8192MB until it reaches 81920MB. 8192 -\u003e 16384 -\u003e 24576 ... 73728 -\u003e 81920",
        "Tags":  [
                     "Storage",
                     "Backup"
                 ],
        "Synopsis":  "This command will help you to automatically grow your transaction log file in a responsible way (preventing the generation of too many VLFs).",
        "Name":  "Expand-DbaTLogResponsibly",
        "Links":  "https://dbatools.io/Expand-DbaTLogResponsibly",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eExpand-DbaTLogResponsibly -SqlInstance sqlcluster -Database db1 -TargetLogSizeMB 50000\r\n\r\nGrows the transaction log for database db1 on sqlcluster to 50000 MB and calculates the increment size.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eExpand-DbaTLogResponsibly -SqlInstance sqlcluster -Database db1, db2 -TargetLogSizeMB 10000 -IncrementSizeMB 200\r\n\r\nGrows the transaction logs for databases db1 and db2 on sqlcluster to 1000MB and sets the growth increment to 200MB.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eExpand-DbaTLogResponsibly -SqlInstance sqlcluster -Database db1 -TargetLogSizeMB 10000 -LogFileId 9\r\n\r\nGrows the transaction log file with FileId 9 of the db1 database on sqlcluster instance to 10000MB.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eExpand-DbaTLogResponsibly -SqlInstance sqlcluster -Database (Get-Content D:\\DBs.txt) -TargetLogSizeMB 50000\r\n\r\nGrows the transaction log of the databases specified in the file \u0027D:\\DBs.txt\u0027 on sqlcluster instance to 50000MB.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eExpand-DbaTLogResponsibly -SqlInstance SqlInstance -Database db1,db2 -TargetLogSizeMB 100 -IncrementSizeMB 10 \r\n-ShrinkLogFile -ShrinkSizeMB 10 -BackupDirectory R:\\MSSQL\\Backup\r\n\r\nGrows the transaction logs for databases db1 and db2 on SQL server SQLInstance to 100MB, sets the incremental growth to \r\n10MB, shrinks the transaction log to 10MB and uses the directory R:\\MSSQL\\Backup for the required backups.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Export-DbaAvailabilityGroup",
        "Description":  "Exports SQL Server Availability Groups creation scripts to a T-SQL file. This is a function that is not available in SSMS.",
        "Author":  "Chris Sommer (@cjsommer), cjsommmer.com",
        "Synopsis":  "Exports SQL Server Availability Groups to a T-SQL file.",
        "Name":  "Export-DbaAvailabilityGroup",
        "Links":  "https://dbatools.io/Export-DbaAvailabilityGroup",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaAvailabilityGroup -SqlInstance sql2012\r\n\r\nExports all Availability Groups from SQL server \"sql2012\". Output scripts are written to the Documents\\SqlAgExports \r\ndirectory by default.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaAvailabilityGroup -SqlInstance sql2012 -FilePath C:\\temp\\availability_group_exports\r\n\r\nExports all Availability Groups from SQL server \"sql2012\". Output scripts are written to the \r\nC:\\temp\\availability_group_exports directory.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaAvailabilityGroup -SqlInstance sql2012 -FilePath \u0027C:\\dir with spaces\\availability_group_exports\u0027 \r\n-AvailabilityGroups AG1,AG2\r\n\r\nExports Availability Groups AG1 and AG2 from SQL server \"sql2012\". Output scripts are written to the C:\\dir with \r\nspaces\\availability_group_exports directory.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaAvailabilityGroup -SqlInstance sql2014 -FilePath C:\\temp\\availability_group_exports -NoClobber\r\n\r\nExports all Availability Groups from SQL server \"sql2014\". Output scripts are written to the \r\nC:\\temp\\availability_group_exports directory. If the export file already exists it will not be overwritten.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Export-DbaDiagnosticQuery",
        "Description":  "The default output format of Invoke-DbaDiagnosticQuery is a custom object. It can also output to CSV and Excel. \nHowever, CSV output can generate a lot of files and Excel output depends on the ImportExcel module by Doug Fike (https://github.com/dfinke/ImportExcel)\nExport-DbaDiagnosticQuery can be used to convert from the default export type to the other available export types.",
        "Tags":  "Query",
        "Synopsis":  "Export-DbaDiagnosticQuery can convert ouput generated by Invoke-DbaDiagnosticQuery to CSV or Excel",
        "Name":  "Export-DbaDiagnosticQuery",
        "Links":  "https://dbatools.io/Export-DbaDiagnosticQuery",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDiagnosticQuery -SqlInstance sql2016 | Export-DbaDiagnosticQuery -Path c:\\temp\r\n\r\nConverts output from Invoke-DbaDiagnosticQuery to multiple CSV files\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$output = Invoke-DbaDiagnosticQuery -SqlInstance sql2016\r\n\r\nExport-DbaDiagnosticQuery -InputObject $output -ConvertTo Excel\r\n\r\nConverts output from Invoke-DbaDiagnosticQuery to Excel worksheet(s) in the Documents folder\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Export-DbaExecutionPlan",
        "Description":  "Exports execution plans to disk. Can pipe from Export-DbaExecutionPlan \n\t\nThanks to \n\thttps://www.simple-talk.com/sql/t-sql-programming/dmvs-for-query-plan-metadata/\n\tand\n\thttp://www.scarydba.com/2017/02/13/export-plans-cache-sqlplan-file/\nfor the idea and query.",
        "Tags":  "Performance",
        "Synopsis":  "Exports execution plans to disk.",
        "Name":  "Export-DbaExecutionPlan",
        "Links":  "https://dbatools.io/Export-DbaExecutionPlan",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaExecutionPlan -SqlInstance sqlserver2014a\r\n\r\nExports all execution plans for sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaExecutionPlan -SqlInstance sqlserver2014a -Database db1, db2 -SinceLastExecution \u00277/1/2016 10:47:00\u0027\r\n\r\nExports all execution plans for databases db1 and db2 on sqlserve2014a since July 1, 2016 at 10:47 AM.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Export-DbaLogin",
        "Description":  "Exports Windows and SQL Logins to a T-SQL file. Export includes login, SID, password, default database, default language, server permissions, server roles, db permissions, db roles.",
        "Tags":  [
                     "Export",
                     "Login"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Exports Windows and SQL Logins to a T-SQL file. Export includes login, SID, password, default database, default language, server permissions, server roles, db permissions, db roles.",
        "Name":  "Export-DbaLogin",
        "Links":  "https://dbatools.io/Export-DbaLogin",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaLogin -SqlInstance sql2005 -FilePath C:\\temp\\sql2005-logins.sql\r\n\r\nExports SQL for the logins in server \"sql2005\" and writes them to the file \"C:\\temp\\sql2005-logins.sql\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaLogin -SqlInstance sqlserver2014a -Exclude realcajun -SqlCredential $scred -FilePath \r\nC:\\temp\\logins.sql -Append\r\n\r\nAuthenticates to sqlserver2014a using SQL Authentication. Exports all logins except for realcajun to \r\nC:\\temp\\logins.sql, and appends to the file if it exists. If not, the file will be created.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaLogin -SqlInstance sqlserver2014a -Login realcajun, netnerds -FilePath C:\\temp\\logins.sql\r\n\r\nExports ONLY logins netnerds and realcajun FROM sqlsever2014a to the file C:\\temp\\logins.sql\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaLogin -SqlInstance sqlserver2014a -Login realcajun, netnerds -Database HR, Accounting\r\n\r\nExports ONLY logins netnerds and realcajun FROM sqlsever2014a with the permissions on databases HR and Accounting\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Export-DbaScript",
        "Description":  "Exports scripts from SQL Management Objects",
        "Tags":  [
                     "Migration",
                     "Backup",
                     "Export"
                 ],
        "Synopsis":  "Exports scripts from SQL Management Objects (SMO)",
        "Name":  "Export-DbaScript",
        "Links":  "https://dbatools.io/Export-DbaScript",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance sql2016 | Export-DbaScript\r\n\r\nExports all jobs on the SQL Server sql2016 instance using a trusted connection - automatically determines filename as \r\n.\\sql2016-Job-Export-date.sql\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance sql2016 | Export-DbaScript -Path C:\\temp\\export.sql -Append\r\n\r\nExports all jobs on the SQL Server sql2016 instance using a trusted connection - Will append the output to the file \r\nC:\\temp\\export.sql if it already exists\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance sql2016 -Job syspolicy_purge_history, \u0027Hourly Log Backups\u0027 -SqlCredential \r\n(Get-Credential sqladmin) | Export-DbaScript -Path C:\\temp\\export.sql\r\n\r\nExports only syspolicy_purge_history and \u0027Hourly Log Backups\u0027 to C:temp\\export.sql and uses the SQL login \"sqladmin\" to \r\nlogin to sql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance sql2014 | Export-DbaJob -Passthru | ForEach-Object { \r\n$_.Replace(\u0027sql2014\u0027,\u0027sql2016\u0027) } | Set-Content -Path C:\\temp\\export.sql\r\n\r\nExports jobs and replaces all instances of the servername \"sql2014\" with \"sql2016\" then writes to C:\\temp\\export.sql\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e$options = New-DbaScriptingOption\r\n\r\n$options.ScriptDrops = $false\r\n$options.WithDependencies = $true\r\nGet-DbaAgentJob -SqlInstance sql2016 | Export-DbaScript -ScriptingOptionsObject $options\r\n\r\nExports Agent Jobs with the Scripting Options ScriptDrops set to $false and WithDependencies set to $true.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Export-DbaSpConfigure",
        "Description":  "Exports advanced sp_configure global configuration options to sql file.",
        "Synopsis":  "Exports advanced sp_configure global configuration options to sql file.",
        "Name":  "Export-DbaSpConfigure",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaSpConfigure $sourceserver -Path C:\\temp\\sp_configure.sql\r\n\r\nExports the SPConfigure on sourceserver to the file C:\\temp\\sp_configure.sql\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Export-DbaUser",
        "Description":  "Exports users creation and its permissions to a T-SQL file or host. Export includes user, create and add to role(s), database level permissions, object level permissions.",
        "Tags":  [
                     "User",
                     "Export"
                 ],
        "Synopsis":  "Exports users creation and its permissions to a T-SQL file or host.",
        "Name":  "Export-DbaUser",
        "Links":  "https://dbatools.io/Export-DbaUser",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaUser -SqlInstance sql2005 -FilePath C:\\temp\\sql2005-users.sql\r\n\r\nExports SQL for the users in server \"sql2005\" and writes them to the file \"C:\\temp\\sql2005-users.sql\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaUser -SqlInstance sqlserver2014a $scred -FilePath C:\\temp\\users.sql -Append\r\n\r\nAuthenticates to sqlserver2014a using SQL Authentication. Exports all users to C:\\temp\\users.sql, and appends to the \r\nfile if it exists. If not, the file will be created.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaUser -SqlInstance sqlserver2014a -User User1, User2 -FilePath C:\\temp\\users.sql\r\n\r\nExports ONLY users User1 and User2 fron sqlsever2014a to the file C:\\temp\\users.sql\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaUser -SqlInstance sqlserver2008 -User User1 -FilePath C:\\temp\\users.sql -DestinationVersion \r\nSQLServer2016\r\n\r\nExports user User1 fron sqlsever2008 to the file C:\\temp\\users.sql with sintax to run on SQL Server 2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eExport-DbaUser -SqlInstance sqlserver2008 -Database db1,db2 -FilePath C:\\temp\\users.sql\r\n\r\nExpors ONLY users from db1 and db2 database on sqlserver2008 server, to the C:\\temp\\users.sql file.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaAgentJob",
        "Description":  "This command filters SQL Agent jobs giving the DBA a list of jobs that may need attention or could possibly be options for removal.",
        "Tags":  [
                     "Agent",
                     "Job"
                 ],
        "Author":  "Stephen Bennett (https://sqlnotesfromtheunderground.wordpress.com/)",
        "Synopsis":  "Find-DbaAgentJob finds agent job/s that fit certain search filters.",
        "Name":  "Find-DbaAgentJob",
        "Links":  "https://dbatools.io/Find-DbaAgentJob",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaAgentJob -SqlInstance Dev01 -Name backup\r\n\r\nReturns all agent job(s) that have backup in the name\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaAgentJob -SqlInstance Dev01 -LastUsed 10\r\n\r\nReturns all agent job(s) that have not ran in 10 days\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaAgentJob -SqlInstance Dev01 -Disabled -NoEmailNotification -NoSchedule\r\n\r\nReturns all agent job(s) that are either disabled, have no email notification or dont have a schedule. returned with \r\ndetail\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaAgentJob -SqlInstance Dev01 -LastUsed 10 -Exclude \"Yearly - RollUp Workload\", \"SMS - Notification\"\r\n\r\nReturns all agent jobs that havent ran in the last 10 ignoring jobs \"Yearly - RollUp Workload\" and \"SMS - Notification\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaAgentJob -SqlInstance Dev01 -Category \"REPL-Distribution\", \"REPL-Snapshot\" -Detailed | Format-Table \r\n-AutoSize -Wrap\r\n\r\nReturns all job/s on Dev01 that are in either category \"REPL-Distribution\" or \"REPL-Snapshot\" with detailed output\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaAgentJob -SqlInstance Dev01, Dev02 -Failed -Since \u00277/1/2016 10:47:00\u0027\r\n\r\nReturns all agent job(s) that have failed since July of 2016 (and still have history in msdb)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance CMSServer -Group Production | Find-DbaAgentJob -Disabled -NoSchedule \r\n-Detailed | Format-Table -AutoSize -Wrap\r\n\r\nQueries CMS server to return all SQL instances in the Production folder and then list out all agent jobs that have \r\neither been disabled or have no schedule.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaAgentJob -SqlInstance Dev01, Dev02 -Name Mybackup -Exact\r\n\r\nReturns all agent job(s) that are named exactly Mybackup\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaCommand",
        "Description":  "Finds dbatools commands searching through the inline help text, building a consolidated json index and querying it because Get-Help is too slow",
        "Tags":  [
                     "Find",
                     "Help",
                     "Command"
                 ],
        "Synopsis":  "Finds dbatools commands searching through the inline help text",
        "Name":  "Find-DbaCommand",
        "Links":  "https://dbatools.io/Find-DbaCommand",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaCommand \"snapshot\"\r\n\r\nFor lazy typers: finds all commands searching the entire help for \"snapshot\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaCommand -Pattern \"snapshot\"\r\n\r\nFor rigorous typers: finds all commands searching the entire help for \"snapshot\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaCommand -Tag copy\r\n\r\nFinds all commands tagged with \"copy\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaCommand -Tag copy,user\r\n\r\nFinds all commands tagged with BOTH \"copy\" and \"user\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaCommand -Author chrissy\r\n\r\nFinds every command whose author contains our beloved \"chrissy\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaCommand -Author chrissy -Tag copy\r\n\r\nFinds every command whose author contains our beloved \"chrissy\" and it tagged as \"copy\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaCommand -Pattern snapshot -Rebuild\r\n\r\nFinds all commands searching the entire help for \"snapshot\", rebuilding the index (good for developers)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaDatabase",
        "Description":  "Allows you to search SQL Server instances for database that have either the same name, owner or service broker guid.\n\nThere a several reasons for the service broker guid not matching on a restored database primarily using alter database new broker. or turn off broker to return a guid of 0000-0000-0000-0000.",
        "Tags":  "DisasterRecovery",
        "Author":  "Stephen Bennett: https://sqlnotesfromtheunderground.wordpress.com/",
        "Synopsis":  "Find database/s on multiple servers that match critea you input",
        "Name":  "Find-DbaDatabase",
        "Links":  "https://dbatools.io/Find-DbaDatabase",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Pattern Report\r\n\r\nReturns all database from the SqlInstances that have a database with Report in the name\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Pattern TestDB -Exact \r\n-Detailed\r\n\r\nReturns all database from the SqlInstances that have a database named TestDB with a detailed output.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDatabase -SqlInstance \"DEV01\", \"DEV02\", \"UAT01\", \"UAT02\", \"PROD01\", \"PROD02\" -Property ServiceBrokerGuid \r\n-Pattern \u0027-faeb-495a-9898-f25a782835f5\u0027 -Detailed\r\n\r\nReturns all database from the SqlInstances that have the same Service Broker GUID with a deatiled output\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaDatabaseGrowthEvent",
        "Description":  "Finds any database AutoGrow events in the Default Trace.",
        "Tags":  "AutoGrow",
        "Synopsis":  "Finds any database AutoGrow events in the Default Trace.",
        "Name":  "Find-DbaDatabaseGrowthEvent",
        "Links":  "https://dbatools.io/Find-DbaDatabaseGrowthEvent",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DBADatabaseGrowthEvent -SqlInstance localhost\r\n\r\nReturns any database AutoGrow events in the Default Trace for every database on the localhost instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DBADatabaseGrowthEvent -SqlInstance ServerA\\SQL2016, ServerA\\SQL2014\r\n\r\nReturns any database AutoGrow events in the Default Traces for every database on ServerA\\sql2016 \u0026 ServerA\\SQL2014.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DBADatabaseGrowthEvent -SqlInstance ServerA\\SQL2016 | Format-Table -AutoSize -Wrap\r\n\r\nReturns any database AutoGrow events in the Default Trace for every database on the ServerA\\SQL2016 instance in a table \r\nformat.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaDuplicateIndex",
        "Description":  "This command will help you to find duplicate and overlapping indexes on a database or a list of databases\n\nWhen 2008+ filtered property also come to comparison\nAlso tells how much space you can save by dropping the index.\nWe show the type of compression so you can make a more considered decision.\nFor now only supported for CLUSTERED and NONCLUSTERED indexes\n\nYou can select the indexes you want to drop on the gridview and by click OK the drop statement will be generated.\n\nOutput:\n\tTableName\n\tIndexName\n\tKeyCols\n\tIncludedCols\n\tIndexSizeMB\n\tIndexType\n\tCompressionDesc (When 2008+)\n\tNumberRows\n\tIsDisabled\n\tIsFiltered (When 2008+)",
        "Synopsis":  "Find duplicate and overlapping indexes",
        "Name":  "Find-DbaDuplicateIndex",
        "Links":  "https://dbatools.io/Find-DbaDuplicateIndex",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDuplicateIndex -SqlInstance sql2005 -FilePath C:\\temp\\sql2005-DuplicateIndexes.sql\r\n\r\nExports SQL for the duplicate indexes in server \"sql2005\" chosen on grid-view and writes them to the file \r\n\"C:\\temp\\sql2005-DuplicateIndexes.sql\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDuplicateIndex -SqlInstance sql2005 -FilePath C:\\temp\\sql2005-DuplicateIndexes.sql -Append\r\n\r\nExports SQL for the duplicate indexes in server \"sql2005\" chosen on grid-view and writes/appends them to the file \r\n\"C:\\temp\\sql2005-DuplicateIndexes.sql\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDuplicateIndex -SqlInstance sqlserver2014a -SqlCredential $cred\r\n\r\nWill find exact duplicate indexes on all user databases present on sqlserver2014a will be verified using SQL \r\ncredentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDuplicateIndex -SqlInstance sqlserver2014a -Database db1, db2\r\n\r\nWill find exact duplicate indexes on both db1 and db2 databases\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaDuplicateIndex -SqlInstance sqlserver2014a -IncludeOverlapping\r\n\r\nWill find exact duplicate or overlapping indexes on all user databases\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaLoginInGroup",
        "Description":  "Outputs all the active directory groups members for a server, or limits it to find a specific AD user in the groups",
        "Synopsis":  "Finds Logins in Active Directory groups that have logins on the SQL Instance.",
        "Name":  "Find-DbaLoginInGroup",
        "Links":  "https://dbatools.io/Find-DbaLoginInGroup",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaLoginInGroup -SqlInstance DEV01 -Login \"MyDomain\\Stephen.Bennett\"\r\n\r\nReturns all active directory groups with logins on Sql Instance DEV01 that contain the AD user Stephen.Bennett.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaLoginInGroup -SqlInstance DEV01\r\n\r\nReturns all active directory users within all windows AD groups that have logins on the instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaLoginInGroup -SqlInstance DEV01 | Where-Object Login -like \u0027*stephen*\u0027\r\n\r\nReturns all active directory users within all windows AD groups that have logins on the instance whose login contains \r\n\u0027stephen\u0027\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaOrphanedFile",
        "Description":  "This command searches all directories associated with SQL database files for database files that are not currently in use by the SQL Server instance.\n\nBy default, it looks for orphaned .mdf, .ldf and .ndf files in the root\\data directory, the default data path, the default log path, the system paths and any directory in use by any attached directory.\n\nYou can specify additional filetypes using the -FileType parameter, and additional paths to search using the -Path parameter.",
        "Tags":  [
                     "DisasterRecovery",
                     "Orphan"
                 ],
        "Author":  "Sander Stad (@sqlstad), sqlstad.nl",
        "Synopsis":  "Find-DbaOrphanedFile finds orphaned database files. Orphaned database files are files not associated with any attached database.",
        "Name":  "Find-DbaOrphanedFile",
        "Links":  "https://dbatools.io/Find-DbaOrphanedFile",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaOrphanedFile -SqlInstance sqlserver2014a\r\n\r\nLogs into the SQL Server \"sqlserver2014a\" using Windows credentials and searches for orphaned files. Returns server \r\nname, local filename, and unc path to file.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaOrphanedFile -SqlInstance sqlserver2014a -SqlCredential $cred\r\n\r\nLogs into the SQL Server \"sqlserver2014a\" using alternative credentials and searches for orphaned files. Returns server \r\nname, local filename, and unc path to file.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaOrphanedFile -SqlInstance sql2014 -Path \u0027E:\\Dir1\u0027, \u0027E:\\Dir2\u0027\r\n\r\nFinds the orphaned files in \"E:\\Dir1\" and \"E:Dir2\" in addition to the default directories.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaOrphanedFile -SqlInstance sql2014 -LocalOnly\r\n\r\nReturns only the local filepath. Using LocalOnly with multiple servers is not recommended since it does not return the \r\nassociated server name.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaOrphanedFile -SqlInstance sql2014 -RemoteOnly\r\n\r\nReturns only the remote filepath. Using LocalOnly with multiple servers is not recommended since it does not return the \r\nassociated server name.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaOrphanedFile -SqlInstance sql2014, sql2016 -FileType fsf, mld\r\n\r\nFinds the orphaned ending with \".fsf\" and \".mld\" in addition to the default filetypes \".mdf\", \".ldf\", \".ndf\" for both \r\nthe servers sql2014 and sql2016.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaStoredProcedure",
        "Description":  "This function can either run against specific databases or all databases searching all user or user and system stored procedures.",
        "Synopsis":  "Returns all stored procedures that contain a specific case-insensitive string or regex pattern.",
        "Name":  "Find-DbaStoredProcedure",
        "Links":  "https://dbatools.io/Find-DbaStoredProcedure",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaStoredProcedure -SqlInstance DEV01 -Pattern whatever\r\n\r\nSearches all user databases stored procedures for \"whatever\" in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaStoredProcedure -SqlInstance sql2016 -Pattern \u0027\\w+@\\w+\\.\\w+\u0027\r\n\r\nSearches all databases for all stored procedures that contain a valid email pattern in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaStoredProcedure -SqlInstance DEV01 -Database MyDB -Pattern \u0027some string\u0027 -Verbose\r\n\r\nSearches in \"mydb\" database stored procedures for \"some string\" in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaStoredProcedure -SqlInstance sql2016 -Database MyDB -Pattern RUNTIME -IncludeSystemObjects\r\n\r\nSearches in \"mydb\" database stored procedures for \"runtime\" in the textbody\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaTrigger",
        "Description":  "This function search on Instance, Database and Object level.\nIf you specify one or more databases, search on Server level will not be preformed.",
        "Synopsis":  "Returns all triggers that contain a specific case-insensitive string or regex pattern.",
        "Name":  "Find-DbaTrigger",
        "Links":  "https://dbatools.io/Find-DbaTrigger",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaTrigger -SqlInstance DEV01 -Pattern whatever\r\n\r\nSearches all user databases triggers for \"whatever\" in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaTrigger -SqlInstance sql2016 -Pattern \u0027\\w+@\\w+\\.\\w+\u0027\r\n\r\nSearches all databases for all triggers that contain a valid email pattern in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaTrigger -SqlInstance DEV01 -Database MyDB -Pattern \u0027some string\u0027 -Verbose\r\n\r\nSearches in \"mydb\" database triggers for \"some string\" in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaTrigger -SqlInstance sql2016 -Database MyDB -Pattern RUNTIME -IncludeSystemObjects\r\n\r\nSearches in \"mydb\" database triggers for \"runtime\" in the textbody\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaUnusedIndex",
        "Description":  "This command will help you to find Unused indexes on a database or a list of databases\n\nAlso tells how much space you can save by dropping the index.\nWe show the type of compression so you can make a more considered decision.\nFor now only supported for CLUSTERED and NONCLUSTERED indexes\n\nYou can select the indexes you want to drop on the gridview and by click OK the drop statement will be generated.",
        "Tags":  "Indexes",
        "Synopsis":  "Find Unused indexes",
        "Name":  "Find-DbaUnusedIndex",
        "Links":  "https://dbatools.io/Find-DbaUnusedIndex",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaUnusedIndex -SqlInstance sql2005 -FilePath C:\\temp\\sql2005-UnusedIndexes.sql\r\n\r\nExports SQL for the Unused indexes in server \"sql2005\" chosen on grid-view and writes them to the file \r\n\"C:\\temp\\sql2005-UnusedIndexes.sql\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaUnusedIndex -SqlInstance sql2005 -FilePath C:\\temp\\sql2005-UnusedIndexes.sql -Append\r\n\r\nExports SQL for the Unused indexes in server \"sql2005\" chosen on grid-view and writes/appends them to the file \r\n\"C:\\temp\\sql2005-UnusedIndexes.sql\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaUnusedIndex -SqlInstance sqlserver2016 -SqlCredential $cred\r\n\r\nWill find exact Unused indexes on all user databases present on sqlserver2016 will be verified using SQL credentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaUnusedIndex -SqlInstance sqlserver2016 -Database db1, db2\r\n\r\nWill find exact Unused indexes on both db1 and db2 databases\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaUnusedIndex -SqlInstance sqlserver2016\r\n\r\nWill find exact Unused indexes on all user databases\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaUserObject",
        "Description":  "Looks at the below list of objects to see if they are either owned by a user or a specific user (using the parameter -Pattern)\n Database Owner\n Agent Job Owner\n Used in Credential\n USed in Proxy\n SQL Agent Steps using a Proxy\n Endpoints\n Server Roles\n Database Schemas\n Database Roles\n Database Assembles\n Database Synonyms",
        "Synopsis":  "Searches SQL Server to find user-owned objects (ie. not dbo or sa) or for any object owned by a specific user specified by the Pattern parameter.",
        "Name":  "Find-DbaUserObject",
        "Links":  "https://dbatools.io/Find-DbaUserObject",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaUserObject -SqlInstance DEV01 -Pattern ad\\stephen\r\n\r\nSearches user objects for owner ad\\stephen\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaUserObject -SqlInstance DEV01 -Verbose\r\n\r\nShows all user owned (non-sa, non-dbo) objects and verbose output\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Find-DbaView",
        "Description":  "This function can either run against specific databases or all databases searching all user or user and system views.",
        "Synopsis":  "Returns all views that contain a specific case-insensitive string or regex pattern.",
        "Name":  "Find-DbaView",
        "Links":  "https://dbatools.io/Find-DbaView",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaView -SqlInstance DEV01 -Pattern whatever\r\n\r\nSearches all user databases views for \"whatever\" in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaView -SqlInstance sql2016 -Pattern \u0027\\w+@\\w+\\.\\w+\u0027\r\n\r\nSearches all databases for all views that contain a valid email pattern in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaView -SqlInstance DEV01 -Database MyDB -Pattern \u0027some string\u0027 -Verbose\r\n\r\nSearches in \"mydb\" database views for \"some string\" in the textbody\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eFind-DbaView -SqlInstance sql2016 -Database MyDB -Pattern RUNTIME -IncludeSystemObjects\r\n\r\nSearches in \"mydb\" database views for \"runtime\" in the textbody\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgDatabase",
        "Description":  "Default view provides most common set of properties for information on the database in an Availability Group(s).\n\nInformation returned on the database will be specific to that replica, whether it is primary or a secondary.\n\nThis command will return an SMO object, but it is the AvailabilityDatabases object\tand not the Server.Databases object.",
        "Tags":  [
                     "DisasterRecovery",
                     "AG",
                     "AvailabilityGroup",
                     "Replica"
                 ],
        "Synopsis":  "Outputs the databases involved in the Availability Group(s) found on the server.",
        "Name":  "Get-DbaAgDatabase",
        "Links":  "https://dbatools.io/Get-DbaAgDatabase",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgDatabase -SqlInstance sqlserver2014a\r\n\r\nReturns basic information on all the databases in each Availability Group found on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgDatabase -SqlInstance sqlserver2014a -AvailabilityGroup AG-a\r\n\r\nReturns basic information on all the databases in the Availability Group AG-a on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgDatabase -SqlInstance sqlserver2014a -AvailabilityGroup AG-a -Database AG-Database\r\n\r\nReturns basic information on the database AG-Database found in the Availability Group AG-a on server sqlserver2014a\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgentAlert",
        "Description":  "This function returns SQL Agent alerts.",
        "Tags":  [
                     "Agent",
                     "SMO"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Returns all SQL Agent alerts on a SQL Server Agent.",
        "Name":  "Get-DbaAgentAlert",
        "Links":  "https://dbatools.io/Get-DbaAgentAlert",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentAlert -SqlInstance ServerA,ServerB\\instanceB\r\n\r\nReturns all SQL Agent alerts on serverA and serverB\\instanceB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027serverA\u0027,\u0027serverB\\instanceB\u0027 | Get-DbaAgentAlert\r\n\r\nReturns all SQL Agent alerts on serverA and serverB\\instanceB\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgentJob",
        "Description":  "The Get-DbaAgentJob returns connected SMO object for SQL Agent Job information for each instance(s) of SQL Server.",
        "Tags":  [
                     "Job",
                     "Agent"
                 ],
        "Synopsis":  "Gets SQL Agent Job information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaAgentJob",
        "Links":  "https://dbatools.io/Get-DbaAgentJob",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance localhost\r\n\r\nReturns all SQL Agent Jobs on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance localhost, sql2016\r\n\r\nReturns all SQl Agent Jobs for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance localhost -Job BackupData, BackupDiff\r\n\r\nReturns all SQL Agent Jobs named BackupData and BackupDiff from the local SQL Server instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance localhost -ExcludeJob BackupDiff\r\n\r\nReturns all SQl Agent Jobs for the local SQL Server instances, except the BackupDiff Job.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance localhost -NoDisabledJobs\r\n\r\nReturns all SQl Agent Jobs for the local SQL Server instances, excluding the disabled jobs.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgentJobHistory",
        "Description":  "Get-DbaAgentJobHistory returns all information on the executions still available on each instance(s) of SQL Server submitted.\n The cleanup of SQL Agent history determines how many records are kept.\n\n https://msdn.microsoft.com/en-us/library/ms201680.aspx\n https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.agent.jobhistoryfilter(v=sql.120).aspx",
        "Tags":  [
                     "Job",
                     "Agent"
                 ],
        "Synopsis":  "Gets execution history of SQL Agent Job on instance(s) of SQL Server.",
        "Name":  "Get-DbaAgentJobHistory",
        "Links":  "https://dbatools.io/Get-DbaAgentJobHistory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobHistory -SqlInstance localhost\r\n\r\nReturns all SQL Agent Job execution results on the local default SQL Server instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobHistory -SqlInstance localhost, sql2016\r\n\r\nReturns all SQL Agent Job execution results for the local and sql2016 SQL Server instances.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\\Inst2K17\u0027 | Get-DbaAgentJobHistory\r\n\r\nReturns all SQL Agent Job execution results for sql1 and sql2\\Inst2K17.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobHistory -SqlInstance sql2\\Inst2K17 | select *\r\n\r\nReturns all properties for all SQl Agent Job execution results on sql2\\Inst2K17.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobHistory -SqlInstance sql2\\Inst2K17 -Job \u0027Output File Cleanup\u0027\r\n\r\nReturns all properties for all SQl Agent Job execution results of the \u0027Output File Cleanup\u0027 job on sql2\\Inst2K17.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobHistory -SqlInstance sql2\\Inst2K17 -NoJobSteps\r\n\r\nReturns the SQL Agent Job execution results for the whole jobs on sql2\\Inst2K17, leaving out job step execution results.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobHistory -SqlInstance sql2\\Inst2K17 -StartDate \u00272017-05-22\u0027 -EndDate \u00272017-05-23 12:30:00\u0027\r\n\r\nReturns the SQL Agent Job execution results between 2017/05/22 00:00:00 and 2017/05/23 12:30:00 on sql2\\Inst2K17.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJob -SqlInstance sql2016 | Where Name -match backup | Get-DbaAgentJobHistory\r\n\r\nGets all jobs with the name that match the regex pattern \"backup\" and then gets the job history from those. You can \r\nalso use -Like *backup* in this example.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgentJobOutputFile",
        "Description":  "This function returns for one or more SQL Instances the output file value for each step of one or many agent job with the Job Names \nprovided dynamically. It will not return anything if there is no Output File",
        "Tags":  [
                     "Agent",
                     "Job"
                 ],
        "Author":  "Rob Sewell (https://sqldbawithabeard.com)",
        "Synopsis":  "Returns the Output File for each step of one or many agent job with the Job Names provided dynamically if \nrequired for one or more SQL Instances",
        "Name":  "Get-DbaAgentJobOutputFile",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobOutputFile -SqlInstance SERVERNAME -Job \u0027The Agent Job\u0027\r\n\r\nThis will return the paths to the output files for each of the job step of the The Agent Job Job \r\non the SERVERNAME instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobOutputFile -SqlInstance SERVERNAME\r\n\r\nThis will return the paths to the output files for each of the job step of all the Agent Jobs\r\non the SERVERNAME instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobOutputFile -SqlInstance SERVERNAME,SERVERNAME2 -Job \u0027The Agent Job\u0027\r\n\r\nThis will return the paths to the output files for each of the job step of the The Agent Job Job \r\non the SERVERNAME instance and SERVERNAME2\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$Servers = \u0027SERVER\u0027,\u0027SERVER\\INSTANCE1\u0027\r\n\r\nGet-DbaAgentJobOutputFile -SqlInstance $Servers -Job \u0027The Agent Job\u0027 -OpenFile \r\n\r\nThis will return the paths to the output files for each of the job step of the The Agent Job Job \r\non the SERVER instance and the SERVER\\INSTANCE1 and open the files if they are available\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobOutputFile -SqlInstance SERVERNAME | Out-GridView\r\n\r\nThis will return the paths to the output files for each of the job step of all the Agent Jobs\r\non the SERVERNAME instance and Pipe them to Out-GridView\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003e(Get-DbaAgentJobOutputFile -SqlInstance SERVERNAME | ogv -PassThru).FileName | Invoke-Item\r\n\r\nThis will return the paths to the output files for each of the job step of all the Agent Jobs\r\non the SERVERNAME instance and Pipe them to Out-GridView and enable you to choose the output\r\nfile and open it\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentJobOutputFile -SqlInstance SERVERNAME -Verbose\r\n\r\nThis will return the paths to the output files for each of the job step of all the Agent Jobs\r\non the SERVERNAME instance and also show the job steps without an output file\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgentLog",
        "Description":  "Gets the \"SQL Agent Error Log\" of an instance. Returns all 10 error logs by default.",
        "Tags":  "Logging",
        "Synopsis":  "Gets the \"SQL Agent Error Log\" of an instance",
        "Name":  "Get-DbaAgentLog",
        "Links":  "https://dbatools.io/Get-DbaAgentLog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentLog -SqlInstance sql01\\sharepoint\r\n\r\nReturns the entire error log for the SQL Agent on sql01\\sharepoint\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentLog -SqlInstance sql01\\sharepoint -LogNumber 3, 6\r\n\r\nReturns log numbers 3 and 6 for the SQL Agent on sql01\\sharepoint\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$servers = \"sql2014\",\"sql2016\", \"sqlcluster\\sharepoint\"\r\n\r\n$servers | Get-DbaAgentLog -LogNumber 0\r\n\r\nReturns the most recent SQL Agent error logs for \"sql2014\",\"sql2016\" and \"sqlcluster\\sharepoint\"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgentOperator",
        "Description":  "This function returns SQL Agent operators.",
        "Tags":  [
                     "Agent",
                     "Operator"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Returns all SQL Agent operators on a SQL Server Agent.",
        "Name":  "Get-DbaAgentOperator",
        "Links":  "https://dbatools.io/Get-DbaAgentOperator",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentOperator -SqlInstance ServerA,ServerB\\instanceB\r\n\r\nReturns any SQL Agent operators on serverA and serverB\\instanceB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027ServerA\u0027,\u0027ServerB\\instanceB\u0027 | Get-DbaAgentOperator\r\n\r\nReturns all SQL Agent operators on serverA and serverB\\instanceB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentOperator -SqlInstance ServerA -Operator Dba1,Dba2\r\n\r\nReturns only the SQL Agent Operators Dba1 and Dba2 on ServerA.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentOperator -SqlInstance ServerA,ServerB -ExcludeOperator Dba3\r\n\r\nReturns all the SQL Agent operators on ServerA and ServerB, except the Dba3 operator.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgentSchedule",
        "Description":  "This function returns SQL Agent Shared Schedules.",
        "Tags":  [
                     "Agent",
                     "Schedule"
                 ],
        "Author":  "Chris McKeown (@devopsfu), http://www.devopsfu.com",
        "Synopsis":  "Returns all SQL Agent Shared Schedules on a SQL Server Agent.",
        "Name":  "Get-DbaAgentSchedule",
        "Links":  "https://dbatools.io/Get-DbaAgentSchedule",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentSchedule -SqlInstance localhost\r\n\r\nReturns all SQL Agent Shared Schedules on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgentSchedule -SqlInstance localhost, sql2016\r\n\r\nReturns all SQL Agent Shared Schedules for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAgReplica",
        "Description":  "Default view provides most common set of properties for information on the Availability Group(s)\u0027 Replica.",
        "Tags":  [
                     "DisasterRecovery",
                     "AG",
                     "AvailabilityGroup",
                     "Replica"
                 ],
        "Synopsis":  "Outputs the Availability Group(s)\u0027 Replica object found on the server.",
        "Name":  "Get-DbaAgReplica",
        "Links":  "https://dbatools.io/Get-DbaAgReplica",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgReplica -SqlInstance sqlserver2014a\r\n\r\nReturns basic information on all the Availability Group(s) replica(s) found on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgReplica -SqlInstance sqlserver2014a -AvailabilityGroup AG-a\r\n\r\nShows basic information on the replica(s) found on Availability Group AG-a on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAgReplica -SqlInstance sqlserver2014a | Select *\r\n\r\nReturns full object properties on all Availability Group(s) replica(s) on sqlserver2014a\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaAvailabilityGroup",
        "Description":  "Default view provides most common set of properties for information on the Availability Group(s).",
        "Tags":  [
                     "DisasterRecovery",
                     "AG",
                     "AvailabilityGroup"
                 ],
        "Synopsis":  "Outputs the Availability Group(s) object found on the server.",
        "Name":  "Get-DbaAvailabilityGroup",
        "Links":  "https://dbatools.io/Get-DbaAvailabilityGroup",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAvailabilityGroup -SqlInstance sqlserver2014a\r\n\r\nReturns basic information on all the Availability Group(s) found on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAvailabilityGroup -SqlInstance sqlserver2014a -AvailabilityGroup AG-a\r\n\r\nShows basic information on the Availability Group AG-a on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAvailabilityGroup -SqlInstance sqlserver2014a | Select *\r\n\r\nReturns full object properties on all Availability Group(s) on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaAvailabilityGroup -SqlInstance sqlserver2014a -AvailabilityGroup AG-a -IsPrimary\r\n\r\nReturns true/false if the server, sqlserver2014a, is the primary replica for AG-a Availability Group\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaBackupDevice",
        "Description":  "The Get-DbaBackupDevice command gets SQL Backup Device information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Backup Device information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaBackupDevice",
        "Links":  "https://dbatools.io/Get-DbaBackupDevice",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupDevice -SqlInstance localhost\r\n\r\nReturns all Backup Devices on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupDevice -SqlInstance localhost, sql2016\r\n\r\nReturns all Backup Devices for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaBackupHistory",
        "Description":  "Returns backup history details for some or all databases on a SQL Server.\n\nYou can even get detailed information (including file path) for latest full, differential and log files.\n\nBackups taken with the CopyOnly option will NOT be returned, unless the IncludeCopyOnly switch is present\n\nReference: http://www.sqlhub.com/2011/07/find-your-backup-history-in-sql-server.html",
        "Tags":  [
                     "Storage",
                     "DisasterRecovery",
                     "Backup"
                 ],
        "Synopsis":  "Returns backup history details for databases on a SQL Server",
        "Name":  "Get-DbaBackupHistory",
        "Links":  "https://dbatools.io/Get-DbaBackupHistory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance SqlInstance2014a\r\n\r\nReturns server name, database, username, backup type, date for all backups databases on SqlInstance2014a. This may \r\nreturn a ton of rows; consider using filters that are included in other examples.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$cred = Get-Credential sqladmin\r\n\r\nGet-DbaBackupHistory -SqlInstance SqlInstance2014a -SqlCredential $cred\r\n\r\nDoes the same as above but logs in as SQL user \"sqladmin\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance SqlInstance2014a -Database db1, db2 -Since \u00277/1/2016 10:47:00\u0027\r\n\r\nReturns backup information only for databases db1 and db2 on sqlserve2014a since July 1, 2016 at 10:47 AM.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance sql2014 -Database AdventureWorks2014, pubs -Force | Format-Table\r\n\r\nReturns information only for AdventureWorks2014 and pubs, and makes the output pretty\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance sql2014 -Database AdventureWorks2014 -Last\r\n\r\nReturns information about the most recent full, differential and log backups for AdventureWorks2014 on sql2014\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance sql2014 -Database AdventureWorks2014 -Last -DeviceType Disk\r\n\r\nReturns information about the most recent full, differential and log backups for AdventureWorks2014 on sql2014, only \r\nfor backups to disk\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance sql2014 -Database AdventureWorks2014 -Last -DeviceType 148,107\r\n\r\nReturns information about the most recent full, differential and log backups for AdventureWorks2014 on sql2014, only \r\nfor backups with device_type 148 and 107\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance sql2014 -Database AdventureWorks2014 -LastFull\r\n\r\nReturns information about the most recent full backup for AdventureWorks2014 on sql2014\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 9 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance sql2014 -Database AdventureWorks2014 -Type Full\r\n\r\nReturns information about all Full backups for AdventureWorks2014 on sql2014\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 10 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sql2016 | Get-DbaBackupHistory\r\n\r\nReturns database backup information for every database on every server listed in the Central Management Server on \r\nsql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 11 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaBackupHistory -SqlInstance SqlInstance2014a, sql2016 -Force\r\n\r\nLots of detailed information for all databases on SqlInstance2014a and sql2016.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaClientProtocol",
        "Description":  "Gets the SQL Server related client protocols on one or more computers.\n\nRequires Local Admin rights on destination computer(s).\nThe client protocols can be enabled and disabled when retrieved via WSMan.",
        "Tags":  "Protocol",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Gets the SQL Server related client protocols on a computer.",
        "Name":  "Get-DbaClientProtocol",
        "Links":  "https://dbatools.io/Get-DbaClientProtocol",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaClientProtocol -ComputerName sqlserver2014a\r\n\r\nGets the SQL Server related client protocols on computer sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\u0027,\u0027sql3\u0027 | Get-DbaClientProtocol\r\n\r\nGets the SQL Server related client protocols on computers sql1, sql2 and sql3.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaClientProtocol -ComputerName sql1,sql2 | Out-Gridview\r\n\r\nGets the SQL Server related client protocols on computers sql1 and sql2, and shows them in a grid view.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e(Get-DbaClientProtocol -ComputerName sql2 | Where { $_.DisplayName = \u0027via\u0027 }).Disable()\r\n\r\nDisables the VIA ClientNetworkProtocol on computer sql2.\r\nIf succesfull, returncode 0 is shown.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaClusterActiveNode",
        "Description":  "Returns a string of the current owner. If -Detailed is specified, a datatable of details will be returned.",
        "Synopsis":  "Returns the active node of a SQL Cluster",
        "Name":  "Get-DbaClusterActiveNode",
        "Links":  "https://dbatools.io/Get-DbaClusterActiveNode",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaClusterActiveNode -SqlInstance sqlcluster\r\n\r\nReturns a simple string with the ComputerNamePhysicalNetBIOS property\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaClusterActiveNode -SqlInstance sqlcluster -Detailed\r\n\r\nReturns a datatable with details\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaCmConnection",
        "Description":  "Retrieves windows management connections from the cache",
        "Tags":  "ComputerManagement",
        "Synopsis":  "Retrieves windows management connections from the cache",
        "Name":  "Get-DbaCmConnection",
        "Links":  "https://dbatools.io/Get-DbaCmConnection",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmConnection\r\n\r\nList all cached connections.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmConnection sql2014\r\n\r\nList the cached connection - if any - to the server sql2014.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmConnection -UserName \"*charles*\"\r\n\r\nList all cached connection that use a username containing \"charles\" as default or override credentials.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaCmObject",
        "Description":  "This function centralizes all requests for information retrieved from Get-WmiObject or Get-CimInstance.\nIt uses different protocols as available in this order:\n- Cim over WinRM\n- Cim over DCOM\n- Wmi\n- Wmi over PowerShell Remoting\nIt remembers channels that didn\u0027t work and will henceforth avoid them. It remembers invalid credentials and will avoid reusing them.\nMuch of its behavior can be configured using Test-DbaWmConnection.",
        "Tags":  "ComputerManagement",
        "Synopsis":  "Retrieves Wmi/Cim-Style information from computers.",
        "Name":  "Get-DbaCmObject",
        "Links":  "https://dbatools.io/Get-DbaCmObject",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmObject win32_OperatingSystem\r\n\r\nRetrieves the common operating system informations from the local computer.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmObject -Computername \"sql2014\" -ClassName Win32_OperatingSystem -Credential $cred -DoNotUse CimRM\r\n\r\nRetrieves the common operating system informations from the server sql2014.\r\nIt will use the credewntials stored in $cred to connect, unless they are known to not work, in which case they will \r\ndefault to windows credentials (unless another default has been set).\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaComputerCertificate",
        "Description":  "Gets computer certificates on localhost that are candidates for using with SQL Server\u0027s network encryption",
        "Tags":  "Certificate",
        "Synopsis":  "Simplifies finding computer certificates that are candidates for using with SQL Server\u0027s network encryption",
        "Name":  "Get-DbaComputerCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaComputerCertificate\r\n\r\nGets computer certificates on localhost that are candidates for using with SQL Server\u0027s network encryption\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaComputerCertificate -ComputerName sql2016\r\n\r\nGets computer certificates on sql2016 that are candidates for using with SQL Server\u0027s network encryption\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaComputerCertificate -ComputerName sql2016 -Thumbprint 8123472E32AB412ED4288888B83811DB8F504DED, \r\n04BFF8B3679BB01A986E097868D8D494D70A46D6\r\n\r\nGets computer certificates on sql2016 that match thumbprints 8123472E32AB412ED4288888B83811DB8F504DED or \r\n04BFF8B3679BB01A986E097868D8D494D70A46D6\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaComputerSystem",
        "Description":  "Gets computer system information from the server and returns as an object.",
        "Tags":  "ServerInfo",
        "Synopsis":  "Gets computer system information from the server.",
        "Name":  "Get-DbaComputerSystem",
        "Links":  "https://dbatools.io/Get-DbaComputerSystem",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaComputerSystem\r\n\r\nReturns information about the local computer\u0027s computer system\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaComputerSystem -ComputerName sql2016\r\n\r\nReturns information about the sql2016\u0027s computer system\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaComputerSystem -ComputerName sql2016 -IncludeAws\r\n\r\nReturns information about the sql2016\u0027s computer system and includes additional properties around the EC2 instance.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaConfig",
        "Description":  "Retrieves configuration elements by name.\nCan be used to search the existing configuration list.",
        "Tags":  "Config",
        "Author":  "Friedrich Weinmann",
        "Synopsis":  "Retrieves configuration elements by name.",
        "Name":  "Get-DbaConfig",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaConfig \u0027Mail.To\u0027\r\n\r\nRetrieves the configuration element for the key \"Mail.To\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaConfig -Force\r\n\r\nRetrieve all configuration elements from all modules, even hidden ones.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaConfigValue",
        "Description":  "Returns the configuration value stored under the specified name.\nIt requires the full name (\u003cModule\u003e.\u003cName\u003e) and is usually only called by functions.",
        "Tags":  "Config",
        "Author":  "Friedrich Weinmann",
        "Synopsis":  "Returns the configuration value stored under the specified name.",
        "Name":  "Get-DbaConfigValue",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaConfigValue -Name \u0027System.MailServer\u0027\r\n\r\nReturns the configured value that was assigned to the key \u0027System.MailServer\u0027\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaConfigValue -Name \u0027Default.CoffeeMilk\u0027 -Fallback 0\r\n\r\nReturns the configured value for \u0027Default.CoffeeMilk\u0027. If no such value is configured, it returns \u00270\u0027 instead.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaCredential",
        "Description":  "The Get-DbaCredential command gets SQL Credential information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Credential information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaCredential",
        "Links":  "https://dbatools.io/Get-DbaCredential",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCredential -SqlInstance localhost\r\n\r\nReturns all SQL Credentials on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCredential -SqlInstance localhost, sql2016\r\n\r\nReturns all SQL Credentials for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaCustomError",
        "Description":  "The Get-DbaCustomError command gets SQL Custom Error Message information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Custom Error Message information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaCustomError",
        "Links":  "https://dbatools.io/Get-DbaCustomError",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCustomError -SqlInstance localhost\r\n\r\nReturns all Custom Error Message(s) on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCustomError -SqlInstance localhost, sql2016\r\n\r\nReturns all Custom Error Message(s) for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabase",
        "Description":  "The Get-DbaDatabase command gets SQL database information for each database that is present in the target instance(s) of\nSQL Server. If the name of the database is provided, the command will return only the specific database information.",
        "Tags":  "Database",
        "Author":  "Klaas Vandenberghe ( @PowerDbaKlaas )",
        "Synopsis":  "Gets SQL Database information for each database that is present in the target instance(s) of SQL Server.",
        "Name":  "Get-DbaDatabase",
        "Links":  "https://dbatools.io/Get-DbaDatabase",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance localhost\r\n\r\nReturns all databases on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance localhost -ExcludeAllUserDb\r\n\r\nReturns only the system databases on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance localhost -ExcludeAllSystemDb\r\n\r\nReturns only the user databases on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e\u0027localhost\u0027,\u0027sql2016\u0027 | Get-DbaDatabase\r\n\r\nReturns databases on multiple instances piped into the function\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance SQL1\\SQLExpress -RecoveryModel full,Simple\r\n\r\nReturns only the user databases in Full or Simple recovery model from SQL1\\SQLExpress\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance SQL1\\SQLExpress -Status Normal\r\n\r\nReturns only the user databases with status \u0027normal\u0027 from sql instance SQL1\\SQLExpress\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance SQL1\\SQLExpress -IncludeLastUsed\r\n\r\nReturns the databases from sql instance SQL1\\SQLExpress including the last used information \r\nfrom the sys.dm_db_index_usage_stats DMV\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance SQL1\\SQLExpress,SQL2 -ExcludeDatabase model,master\r\n\r\nReturns all databases except master and model from sql instances SQL1\\SQLExpress and SQL2\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 9 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance SQL1\\SQLExpress,SQL2 -Encrypted\r\n\r\nReturns only encrypted databases from sql instances SQL1\\SQLExpress and SQL2\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 10 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance SQL1\\SQLExpress,SQL2 -Access ReadOnly\r\n\r\nReturns only read only databases from sql instances SQL1\\SQLExpress and SQL2\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 11 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance SQL2,SQL3 -Database OneDB,OtherDB\r\n\r\nReturns databases \u0027OneDb\u0027 and \u0027OtherDB\u0027 from sql instances SQL2 and SQL3 if the databases exist on those instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseAssembly",
        "Description":  "The Get-DbaDatabaseAssembly command gets SQL Database Assembly information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Database Assembly information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaDatabaseAssembly",
        "Links":  "https://dbatools.io/Get-DbaDatabaseAssembly",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseAssembly -SqlInstance localhost\r\n\r\nReturns all Database Assembly on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseAssembly -SqlInstance localhost, sql2016\r\n\r\nReturns all Database Assembly for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseCertificate",
        "Description":  "Gets database certificates",
        "Tags":  "Certificate",
        "Synopsis":  "Gets database certificates",
        "Name":  "Get-DbaDatabaseCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseCertificate -SqlInstance sql2016\r\n\r\nGets all certificates\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseCertificate -SqlInstance Server1 -Database db1\r\n\r\nGets the certificate for the db1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseCertificate -SqlInstance Server1 -Database db1 -Certificate cert1\r\n\r\nGets the cert1 certificate within the db1 database\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseEncryption",
        "Description":  "Shows if a database has Transparent Data Encryption (TDE), any certificates, asymmetric keys or symmetric keys with details for each.",
        "Synopsis":  "Returns a summary of encryption used on databases passed to it.",
        "Name":  "Get-DbaDatabaseEncryption",
        "Links":  "https://dbatools.io/Get-DbaDatabaseEncryption",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseEncryption -SqlInstance DEV01\r\n\r\nList all encrpytion found on the instance by database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseEncryption -SqlInstance DEV01 -Database MyDB\r\n\r\nList all encrption found for the MyDB database.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseEncryption -SqlInstance DEV01 -ExcludeDatabase MyDB\r\n\r\nList all encrption found for all databases except MyDB.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseEncryption -SqlInstance DEV01 -IncludeSystemDBs\r\n\r\nList all encrption found for all databases including the system databases.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseFile",
        "Description":  "Returns detailed information about database files. Does not use SMO - SMO causes enumeration and this command avoids that.",
        "Tags":  "Database",
        "Author":  "Stuart Moore (@napalmgram), stuart-moore.com",
        "Synopsis":  "Returns detailed information about database files.",
        "Name":  "Get-DbaDatabaseFile",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseFile -SqlInstance sql2016\r\n\r\nWill return an object containing all filegroups and their contained files for every database on the sql2016 SQL Server \r\ninstance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseFile -SqlInstance sql2016 -Database Impromptu\r\n\r\nWill return an object containing all filegroups and their contained files for the Impromptu Database on the sql2016 SQL \r\nServer instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseFile -SqlInstance sql2016 -Database Impromptu, Trading\r\n\r\nWill return an object containing all filegroups and their contained files for the Impromptu and Trading databases on \r\nthe sql2016 SQL Server instance\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseMasterKey",
        "Description":  "Gets specified database master key",
        "Tags":  [
                     "Certificate",
                     "Databases"
                 ],
        "Synopsis":  "Gets specified database master key",
        "Name":  "Get-DbaDatabaseMasterKey",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseMasterKey -SqlInstance sql2016\r\n\r\nGets all master database keys\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseMasterKey -SqlInstance Server1 -Database db1\r\n\r\nGets the master key for the db1 database\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabasePartitionFunction",
        "Description":  "Gets database Partition Functions",
        "Tags":  "Databases",
        "Author":  "Klaas Vandenberghe ( @PowerDbaKlaas )",
        "Synopsis":  "Gets database Partition Functions",
        "Name":  "Get-DbaDatabasePartitionFunction",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabasePartitionFunction -SqlInstance sql2016\r\n\r\nGets all database Partition Functions\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabasePartitionFunction -SqlInstance Server1 -Database db1\r\n\r\nGets the Partition Functions for the db1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabasePartitionFunction -SqlInstance Server1 -ExcludeDatabase db1\r\n\r\nGets the Partition Functions for all databases except db1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e\u0027Sql1\u0027,\u0027Sql2/sqlexpress\u0027 | Get-DbaDatabasePartitionFunction\r\n\r\nGets the Partition Functions for the databases on Sql1 and Sql2/sqlexpress\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabasePartitionScheme",
        "Description":  "Gets database Partition Schemes",
        "Tags":  "Databases",
        "Author":  "Klaas Vandenberghe ( @PowerDbaKlaas )",
        "Synopsis":  "Gets database Partition Schemes",
        "Name":  "Get-DbaDatabasePartitionScheme",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabasePartitionScheme -SqlInstance sql2016\r\n\r\nGets all database Partition Schemes\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabasePartitionScheme -SqlInstance Server1 -Database db1\r\n\r\nGets the Partition Schemes for the db1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabasePartitionScheme -SqlInstance Server1 -ExcludeDatabase db1\r\n\r\nGets the Partition Schemes for all databases except db1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e\u0027Sql1\u0027,\u0027Sql2/sqlexpress\u0027 | Get-DbaDatabasePartitionScheme\r\n\r\nGets the Partition Schemes for the databases on Sql1 and Sql2/sqlexpress\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseSnapshot",
        "Description":  "Retrieves the list of database snapshot available, along with their base (the db they are the snapshot of) and creation time",
        "Tags":  "Snapshot",
        "Author":  "niphlod",
        "Synopsis":  "Get database snapshots with details",
        "Name":  "Get-DbaDatabaseSnapshot",
        "Links":  "https://dbatools.io/Get-DbaDatabaseSnapshot",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseSnapshot -SqlInstance sqlserver2014a\r\n\r\nReturns a custom object displaying Server, Database, DatabaseCreated, SnapshotOf, SizeMB, DatabaseCreated\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Database HR, Accounting\r\n\r\nReturns information for database snapshots having HR and Accounting as base dbs\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Snapshot HR_snapshot, Accounting_snapshot\r\n\r\nReturns information for database snapshots HR_snapshot and Accounting_snapshot\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseSpace",
        "Description":  "This function returns database file space information for a SQL Instance or group of SQL\nInstances. Information is based on a query against sys.database_files and the FILEPROPERTY\nfunction to query and return information. The function can accept a single instance or\nmultiple instances. By default, only user dbs will be shown, but using the IncludeSystemDBs\nswitch will include system databases\n\nFile free space script borrowed and modified from Glenn Berry\u0027s DMV scripts (http://www.sqlskills.com/blogs/glenn/category/dmv-queries/)",
        "Synopsis":  "Returns database file space information for database files on a SQL instance.",
        "Name":  "Get-DbaDatabaseSpace",
        "Links":  "https://dbatools.io/Get-DbaDatabaseSpace",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseSpace -SqlInstance localhost\r\n\r\nReturns all user database files and free space information for the local host\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseSpace -SqlInstance localhost | Where-Object {$_.PercentUsed -gt 80}\r\n\r\nReturns all user database files and free space information for the local host. Filters\r\nthe output object by any files that have a percent used of greater than 80%.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e\u0027localhost\u0027,\u0027localhost\\namedinstance\u0027 | Get-DbaDatabaseSpace\r\n\r\nReturns all user database files and free space information for the localhost and\r\nlocalhost\\namedinstance SQL Server instances. Processes data via the pipeline.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseSpace -SqlInstance localhost -Database db1, db2\r\n\r\nReturns database files and free space information for the db1 and db2 on localhost.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseState",
        "Description":  "Gets some common \"states\" on databases:\n - \"RW\" options : READ_ONLY or READ_WRITE\n - \"Status\" options : ONLINE, OFFLINE, EMERGENCY\n - \"Access\" options : SINGLE_USER, RESTRICTED_USER, MULTI_USER\n\nReturns an object with SqlInstance, Database, RW, Status, Access",
        "Tags":  "Databases",
        "Author":  "niphlod",
        "Synopsis":  "Gets various options for databases, hereby called \"states\"",
        "Name":  "Get-DbaDatabaseState",
        "Links":  "https://dbatools.io/Get-DbaDatabaseState",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseState -SqlInstance sqlserver2014a\r\n\r\nGets options for all databases of the sqlserver2014a instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseState -SqlInstance sqlserver2014a -Database HR, Accounting\r\n\r\nGets options for both HR and Accounting database of the sqlserver2014a instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseState -SqlInstance sqlserver2014a -Exclude HR\r\n\r\nGets options for all databases of the sqlserver2014a instance except HR\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e\u0027sqlserver2014a\u0027, \u0027sqlserver2014b\u0027 | Get-DbaDatabaseState\r\n\r\nGets options for all databases of sqlserver2014a and sqlserver2014b instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseUdf",
        "Description":  "Gets database User Defined Functions",
        "Tags":  [
                     "security",
                     "Databases"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDbaKlaas )",
        "Synopsis":  "Gets database User Defined Functions",
        "Name":  "Get-DbaDatabaseUdf",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUdf -SqlInstance sql2016\r\n\r\nGets all database User Defined Functions\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUdf -SqlInstance Server1 -Database db1\r\n\r\nGets the User Defined Functions for the db1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUdf -SqlInstance Server1 -ExcludeDatabase db1\r\n\r\nGets the User Defined Functions for all databases except db1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUdf -SqlInstance Server1 -ExcludeSystemUdf\r\n\r\nGets the User Defined Functions for all databases that are not system objects (there can be 100+ system User Defined \r\nFunctions in each DB)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e\u0027Sql1\u0027,\u0027Sql2/sqlexpress\u0027 | Get-DbaDatabaseUdf\r\n\r\nGets the User Defined Functions for the databases on Sql1 and Sql2/sqlexpress\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseUser",
        "Description":  "Gets database users",
        "Tags":  [
                     "security",
                     "Databases"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDbaKlaas )",
        "Synopsis":  "Gets database users",
        "Name":  "Get-DbaDatabaseUser",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUser -SqlInstance sql2016\r\n\r\nGets all database users\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUser -SqlInstance Server1 -Database db1\r\n\r\nGets the users for the db1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUser -SqlInstance Server1 -ExcludeDatabase db1\r\n\r\nGets the users for all databases except db1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseUser -SqlInstance Server1 -ExcludeSystemUser\r\n\r\nGets the users for all databases that are not system objects, like \u0027dbo\u0027, \u0027guest\u0027 or \u0027INFORMATION_SCHEMA\u0027\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e\u0027Sql1\u0027,\u0027Sql2/sqlexpress\u0027 | Get-DbaDatabaseUser\r\n\r\nGets the users for the databases on Sql1 and Sql2/sqlexpress\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDatabaseView",
        "Description":  "Gets database views",
        "Tags":  [
                     "security",
                     "Databases"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDbaKlaas )",
        "Synopsis":  "Gets database views",
        "Name":  "Get-DbaDatabaseView",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseView -SqlInstance sql2016\r\n\r\nGets all database views\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseView -SqlInstance Server1 -Database db1\r\n\r\nGets the views for the db1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseView -SqlInstance Server1 -ExcludeDatabase db1\r\n\r\nGets the views for all databases except db1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseView -SqlInstance Server1 -ExcludeSystemView\r\n\r\nGets the views for all databases that are not system objects (there can be 400+ system views in each DB)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e\u0027Sql1\u0027,\u0027Sql2/sqlexpress\u0027 | Get-DbaDatabaseView\r\n\r\nGets the views for the databases on Sql1 and Sql2/sqlexpress\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDbMailHistory",
        "Description":  "Gets the history of mail sent from a SQL instance",
        "Tags":  "Logging",
        "Synopsis":  "Gets the history of mail sent from a SQL instance",
        "Name":  "Get-DbaDbMailHistory",
        "Links":  "https://dbatools.io/Get-DbaDbMailHistory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbMailHistory -SqlInstance sql01\\sharepoint\r\n\r\nReturns the entire dbmail history on sql01\\sharepoint\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbMailHistory -SqlInstance sql01\\sharepoint | Select *\r\n\r\nReturns the entire dbmail history on sql01\\sharepoint then return a bunch more columns\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$servers = \"sql2014\",\"sql2016\", \"sqlcluster\\sharepoint\"\r\n\r\n$servers | Get-DbaDbMailHistory\r\n\r\nReturns the all dbmail history for \"sql2014\",\"sql2016\" and \"sqlcluster\\sharepoint\"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDbMailLog",
        "Description":  "Gets the DBMail log from a SQL instance",
        "Tags":  "Logging",
        "Synopsis":  "Gets the DBMail log from a SQL instance",
        "Name":  "Get-DbaDbMailLog",
        "Links":  "https://dbatools.io/Get-DbaDbMailLog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbMailLog -SqlInstance sql01\\sharepoint\r\n\r\nReturns the entire dbmail log on sql01\\sharepoint\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbMailLog -SqlInstance sql01\\sharepoint | Select *\r\n\r\nReturns the entire dbmail log on sql01\\sharepoint then return a bunch more columns\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$servers = \"sql2014\",\"sql2016\", \"sqlcluster\\sharepoint\"\r\n\r\n$servers | Get-DbaDbMailLog -Type Error, Information\r\n\r\nReturns only the Error and Information dbmail log for \"sql2014\",\"sql2016\" and \"sqlcluster\\sharepoint\"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDbQueryStoreOptions",
        "Description":  "Retrieves and returns the Query Store configuration for every database that has the Query Store feature enabled.",
        "Tags":  "QueryStore",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Get the Query Store configuration for Query Store enabled databases.",
        "Name":  "Get-DbaDbQueryStoreOptions",
        "Links":  "https://dbatools.io/Get-DbaQueryStoreOptions",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbQueryStoreOptions -SqlInstance ServerA\\sql\r\n\r\nReturns Query Store configuration settings for every database on the ServerA\\sql instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbQueryStoreOptions -SqlInstance ServerA\\sql | Where-Object {$_.ActualState -eq \"ReadWrite\"}\r\n\r\nReturns the Query Store configuration for all databases on ServerA\\sql where the Query Store feature is in Read/Write \r\nmode.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbQueryStoreOptions -SqlInstance localhost | format-table -AutoSize -Wrap\r\n\r\nReturns Query Store configuration settings for every database on the ServerA\\sql instance inside a table format.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDbStoredProcedure",
        "Description":  "Gets database Stored Procedures",
        "Tags":  "Databases",
        "Author":  "Klaas Vandenberghe ( @PowerDbaKlaas )",
        "Synopsis":  "Gets database Stored Procedures",
        "Name":  "Get-DbaDbStoredProcedure",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbStoredProcedure -SqlInstance sql2016\r\n\r\nGets all database Stored Procedures\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbStoredProcedure -SqlInstance Server1 -Database db1\r\n\r\nGets the Stored Procedures for the db1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbStoredProcedure -SqlInstance Server1 -ExcludeDatabase db1\r\n\r\nGets the Stored Procedures for all databases except db1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDbStoredProcedure -SqlInstance Server1 -ExcludeSystemSp\r\n\r\nGets the Stored Procedures for all databases that are not system objects\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e\u0027Sql1\u0027,\u0027Sql2/sqlexpress\u0027 | Get-DbaDbStoredProcedure\r\n\r\nGets the Stored Procedures for the databases on Sql1 and Sql2/sqlexpress\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDefaultPath",
        "Description":  "Gets the default SQL Server paths for data, logs and backups",
        "Tags":  "Config",
        "Synopsis":  "Gets the default SQL Server paths for data, logs and backups",
        "Name":  "Get-DbaDefaultPath",
        "Links":  "https://dbatools.io/Get-DbaDefaultPath",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDefaultPath -SqlInstance sql01\\sharepoint\r\n\r\nReturns the default file paths for sql01\\sharepoint\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$servers = \"sql2014\",\"sql2016\", \"sqlcluster\\sharepoint\"\r\n\r\n$servers | Get-DbaDefaultPath\r\n\r\nReturns the default file paths for \"sql2014\",\"sql2016\" and \"sqlcluster\\sharepoint\"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDependency",
        "Description":  "This function recursively finds all objects that depends on the input.\nIt will then retrieve rich information from them, including their creation scripts and the order in which it should be applied.\n\nBy using the \u0027Parents\u0027 switch, the function will instead retrieve all items that the input depends on (including their creation scripts).\n\nFor more details on dependency, see:\nhttps://technet.microsoft.com/en-us/library/ms345449(v=sql.105).aspx",
        "Synopsis":  "Finds object dependencies and their relevant creation scripts.",
        "Name":  "Get-DbaDependency",
        "Links":  "https://dbatools.io/Get-DbaDependency",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003e$table = (Get-DbaDatabase -SqlInstance sql2012 Northwind).tables | Where Name -eq Customers\r\n\r\n$table | Get-DbaDependency\r\n\r\nReturns everything that depends on the \"Customers\" table\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDetachedDatabaseInfo",
        "Description":  "This script gathers the following information from detached database files: database name, SQL Server version (compatibility level), collation, and file structure. \n\t\n\"Data files\" and \"Log file\" report the structure of the data and log files as they were when the database was detached. \"Database version\" is the comptability level.\n\nMDF files are most easily read by using a SQL Server to interpret them. Because of this, you must specify a SQL Server and the path must be relative to the SQL Server.",
        "Tags":  "DisasterRecovery",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Get detailed information about detached SQL Server database files.",
        "Name":  "Get-DbaDetachedDatabaseInfo",
        "Links":  "https://dbatools.io/Get-DbaDetachedDatabaseInfo",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDetachedDatabaseInfo -SqlInstance sql2016 -Path M:\\Archive\\mydb.mdf\r\n\r\nSQL Server is required to process offilne MDF files. The abvoe example reutrns information about the detached database \r\nfile, M:\\Archive\\mydb.mdf. This path is relative to the SQL Server \"sql2016\".\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaDiskSpace",
        "Description":  "Returns a custom object with Server name, name of disk, label of disk, total size, free size, percent free, block size and filesystem.\n\nBy default, this funtion only shows drives of type 2 and 3 (removable disk and local disk).\n\nRequires: Windows administrator access on SQL Servers",
        "Tags":  "Storage",
        "Author":  "Chrissy LeMaire (clemaire@gmail.com) \u0026 Jakob Bindslet (jakob@bindslet.dk)",
        "Synopsis":  "Displays Disk information for all local drives on a server",
        "Name":  "Get-DbaDiskSpace",
        "Links":  "https://dbatools.io/Get-DbaDiskSpace",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDiskSpace -ComputerName srv0042 | Format-Table -AutoSize\r\n\r\nGet diskspace for the server srv0042\r\n\r\nServer Name Label SizeInGB FreeInGB PercentFree BlockSize\r\n------ ---- ----- -------- -------- ----------- ---------\r\nsrv0042 C:\\ System 126,45 114,12 90,25 4096\r\nsrv0042 E:\\ Data1 97,62 96,33 98,67 4096\r\nsrv0042 F:\\ DATA2 29,2 29,2 100 16384\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDiskSpace -ComputerName srv0042 -Unit MB | Format-Table -AutoSize\r\n\r\nGet diskspace for the server srv0042, display in MB\r\n\r\nServer Name Label SizeInMB FreeInMB PercentFree BlockSize\r\n------ ---- ----- -------- -------- ----------- ---------\r\nsrv0042 C:\\ System 129481 116856,11 90,25 4096\r\nsrv0042 E:\\ Data1 99968 98637,56 98,67 4096\r\nsrv0042 F:\\ DATA2 29901 29900,92 100 16384\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDiskSpace -ComputerName srv0042, srv0007 -Unit TB | Format-Table -AutoSize\r\n\r\nGet diskspace from two servers, display in TB\r\n\r\nServer Name Label SizeInTB FreeInTB PercentFree BlockSize\r\n------ ---- ----- -------- -------- ----------- ---------\r\nsrv0042 C:\\ System 0,12 0,11 90,25 4096\r\nsrv0042 E:\\ Data1 0,1 0,09 98,67 4096\r\nsrv0042 F:\\ DATA2 0,03 0,03 100 16384\r\nsrv0007 C:\\ System 0,07 0,01 11,92 4096\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDiskSpace -ComputerName srv0042 -Detailed | Format-Table -AutoSize\r\n\r\nGet detailed diskspace information\r\n\r\nServer Name Label SizeInGB FreeInGB PercentFree BlockSize IsSqlDisk \r\nFileSystem DriveType\r\n------ ---- ----- -------- -------- ----------- --------- --------- \r\n---------- ---------\r\nsrv0042 C:\\ System 126,45 114,12 90,25 4096 False \r\nNTFS Local Disk\r\nsrv0042 E:\\ Data1 97,62 96,33 98,67 4096 False \r\nReFS Local Disk\r\nsrv0042 F:\\ DATA2 29,2 29,2 100 16384 False \r\nFAT32 Local Disk\r\nsrv0042 \\\\?\\Volume{7a31be94-b842-42f5-af71-e0464a1a9803}\\ Recovery 0,44 0,13 30,01 4096 False \r\nNTFS Local Disk\r\nsrv0042 D:\\ 0 0 0 False \r\n Compact Disk\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaEndpoint",
        "Description":  "The Get-DbaEndpoint command gets SQL Endpoint(s) information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Endpoint(s) information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaEndpoint",
        "Links":  "https://dbatools.io/Get-DbaEndpoint",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaEndpoint -SqlInstance localhost\r\n\r\nReturns all Endpoint(s) on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaEndpoint -SqlInstance localhost, sql2016\r\n\r\nReturns all Endpoint(s) for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaEstimatedCompletionTime",
        "Description":  "Gets execution and estimated completion time information for queries\n\nPercent complete will show for the following commands\n\t\nALTER INDEX REORGANIZE\nAUTO_SHRINK option with ALTER DATABASE\nBACKUP DATABASE\nDBCC CHECKDB\nDBCC CHECKFILEGROUP\nDBCC CHECKTABLE\nDBCC INDEXDEFRAG\nDBCC SHRINKDATABASE\nDBCC SHRINKFILE\nRECOVERY\nRESTORE DATABASE\nROLLBACK\nTDE ENCRYPTION\n\t\nFor additional information, check out https://blogs.sentryone.com/loriedwards/patience-dm-exec-requests/ and https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-requests-transact-sql",
        "Tags":  "Database",
        "Synopsis":  "Gets execution and estimated completion time information for queries",
        "Name":  "Get-DbaEstimatedCompletionTime",
        "Links":  "https://dbatools.io/Get-DbaEstimatedCompletionTime",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaEstimatedCompletionTime -SqlInstance sql2016\r\n\r\nGets estimated completion times for queries performed against the entire server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaEstimatedCompletionTime -SqlInstance sql2016 | Select *\r\n\r\nGets estimated completion times for queries performed against the entire server PLUS the SQL query text of each command\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaEstimatedCompletionTime -SqlInstance sql2016 | Where-Object { $_.Text -match \u0027somequerytext\u0027 }\r\n\r\nGets results for commands whose queries only match specific text (match is like LIKE but way more powerful)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaEstimatedCompletionTime -SqlInstance sql2016 -Database Northwind,pubs,Adventureworks2014\r\n\r\nGets estimated completion times for queries performed against the Northwind, pubs, and Adventureworks2014 databases\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaExecutionPlan",
        "Description":  "Gets execution plans and metadata. Can pipe to Export-DbaExecutionPlan :D\n\t\nThanks to \n\thttps://www.simple-talk.com/sql/t-sql-programming/dmvs-for-query-plan-metadata/\n\tand\n\thttp://www.scarydba.com/2017/02/13/export-plans-cache-sqlplan-file/\nfor the idea and query.",
        "Tags":  "Performance",
        "Synopsis":  "Gets execution plans and metadata",
        "Name":  "Get-DbaExecutionPlan",
        "Links":  "https://dbatools.io/Get-DbaExecutionPlan",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaExecutionPlan -SqlInstance sqlserver2014a\r\n\r\nGets all execution plans on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaExecutionPlan -SqlInstance sqlserver2014a -Database db1, db2 -SinceLastExecution \u00277/1/2016 10:47:00\u0027\r\n\r\nGets all execution plans for databases db1 and db2 on sqlserve2014a since July 1, 2016 at 10:47 AM.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaExecutionPlan -SqlInstance sqlserver2014a, sql2016 -Exclude db1 | Format-Table\r\n\r\nGets execution plan info for all databases except db1 on sqlserver2014a and sql2016 and makes the output pretty\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaExecutionPlan -SqlInstance sql2014 -Database AdventureWorks2014, pubs -Force\r\n\r\nGets super detailed information for execution plans on only for AdventureWorks2014 and pubs\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaFile",
        "Description":  "This command searches all specified directories, allowing a DBA to see file information on a server without direct access\n\nYou can filter by extension using the -FileType parameter. By default, the default data directory will be returned. You can provide and additional paths to search using the -Path parameter.",
        "Tags":  "Discovery",
        "Author":  "Brandon Abshire, netnerds.net",
        "Synopsis":  "Get-DbaFile finds files in any directory specified on a remote SQL Server",
        "Name":  "Get-DbaFile",
        "Links":  "https://dbatools.io/Get-DbaFile",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaFile -SqlInstance sqlserver2014a -Path E:\\Dir1\r\n\r\nLogs into the SQL Server \"sqlserver2014a\" using Windows credentials and searches E:\\Dir for all files\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaFile -SqlInstance sqlserver2014a -SqlCredential $cred -Path \u0027E:\\sql files\u0027\r\n\r\nLogs into the SQL Server \"sqlserver2014a\" using alternative credentials and returns all files in \u0027E:\\sql files\u0027\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$all = Get-DbaDefaultPath -SqlInstance sql2014\r\n\r\nGet-DbaFile -SqlInstance sql2014 -Path $all.Data, $all.Log, $all.Backup\r\nReturns the files in the default data, log and backup directories on sql2014\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaFile -SqlInstance sql2014 -Path \u0027E:\\Dir1\u0027, \u0027E:\\Dir2\u0027\r\n\r\nReturns the files in \"E:\\Dir1\" and \"E:Dir2\" on sql2014\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaFile -SqlInstance -Path \u0027E:\\Dir1\u0027 sql2014, sql2016 -FileType fsf, mld\r\n\r\nFinds files in E:\\Dir1 ending with \".fsf\" and \".mld\" for both the servers sql2014 and sql2016.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaFile -SqlInstance -Path \u0027E:\\Dir1\u0027 sql2014, sql2016 -FileType fsf, mld\r\n\r\nFinds files in E:\\Dir1 ending with \".fsf\" and \".mld\" for both the servers sql2014 and sql2016.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaForceNetworkEncryption",
        "Description":  "Gets Force Encryption settings for a SQL Server instance. Note that this requires access to the Windows Server - not the SQL instance itself.\n\nThis setting is found in Configuration Manager.",
        "Tags":  "Certificate",
        "Synopsis":  "Gets Force Encryption settings for a SQL Server instance",
        "Name":  "Get-DbaForceNetworkEncryption",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaForceNetworkEncryption\r\n\r\nGets Force Encryption properties on the default (MSSQLSERVER) instance on localhost - requires (and checks for) RunAs \r\nadmin.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaForceNetworkEncryption -SqlInstance sql01\\SQL2008R2SP2\r\n\r\nGets Force Network Encryption for the SQL2008R2SP2 on sql01. Uses Windows Credentials to both login and view the \r\nregistry.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaHelpIndex",
        "Description":  "This function will return detailed information on indexes (and optionally statistics) for all indexes in a database, or a given index should one be passed along.\nAs this uses SQL Server DMVs to access the data it will only work in 2005 and up (sorry folks still running SQL Server 2000).\nFor performance reasons certain statistics information will not be returned from SQL Server 2005 if an ObjectName is not provided.\n\nThe data includes:\n\t- ObjectName: the table containing the index\n\t- IndexType: clustered/non-clustered/columnstore and whether the index is unique/primary key\n\t- KeyColumns: the key columns of the index\n\t- IncludeColumns: any include columns in the index\n\t- FilterDefinition: any filter that may have been used in the index\n\t- DataCompression: row/page/none depending upon whether or not compression has been used\n\t- IndexReads: the number of reads of the index since last restart or index rebuild\n\t- IndexUpdates: the number of writes to the index since last restart or index rebuild\n\t- SizeKB: the size the index in KB\n\t- IndexRows: the number of the rows in the index (note filtered indexes will have fewer rows than exist in the table)\n\t- IndexLookups: the number of lookups that have been performed (only applicable for the heap or clustered index)\n\t- MostRecentlyUsed: when the index was most recently queried (default to 1900 for when never read)\n\t- StatsSampleRows: the number of rows queried when the statistics were built/rebuilt (not included in SQL Server 2005 unless ObjectName is specified)\n\t- StatsRowMods: the number of changes to the statistics since the last rebuild\n\t- HistogramSteps: the number of steps in the statistics histogram (not included in SQL Server 2005 unless ObjectName is specified)\n\t- StatsLastUpdated: when the statistics were last rebuilt (not included in SQL Server 2005 unless ObjectName is specified)",
        "Tags":  "Indexes",
        "Synopsis":  "Returns size, row and configuration information for indexes in databases.",
        "Name":  "Get-DbaHelpIndex",
        "Links":  "https://dbatools.io/Get-DbaHelpIndex",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaHelpIndex -SqlInstance localhost -Database MyDB\r\n\r\nReturns information on all indexes on the MyDB database on the localhost.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaHelpIndex -SqlInstance localhost -Database MyDB,MyDB2\r\n\r\nReturns information on all indexes on the MyDB, MyDB2 databases\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaHelpIndex -SqlInstance localhost -Database MyDB -ObjectName dbo.Table1\r\n\r\nReturns index information on the object dbo.Table1 in the database MyDB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaHelpIndex -SqlInstance localhost -Database MyDB -ObjectName dbo.Table1 -IncludeStats\r\n\r\nReturns information on the indexes and statistics for the table dbo.Table1 in the MyDB database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaHelpIndex -SqlInstance localhost -Database MyDB -ObjectName dbo.Table1 -IncludeDataTypes\r\n\r\nReturns the index information for the table dbo.Table1 in the MyDB database, and includes the data types for the key \r\nand include columns\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaHelpIndex -SqlInstance localhost -Database MyDB -ObjectName dbo.Table1 -FormatResults\r\n\r\nReturns the index information for the table dbo.Table1 in the MyDB database, and returns the numerical data with \r\nseparators to make it more readable (ie 1234 becomes 1,234)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaHelpIndex -SqlInstance localhost -Database MyDB -IncludeStats -FormatResults\r\n\r\nReturns the index information for all index in the MyDB database, as well as statistics, and formats the numerical data \r\nto be more redable\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaJobCategory",
        "Description":  "The Get-DbaJobCategory returns connected SMO object for SQL Agent Job Category information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Agent Job Category information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaJobCategory",
        "Links":  "https://dbatools.io/Get-DbaJobCategory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaJobCategory -SqlInstance localhost\r\n\r\nReturns all SQL Agent Job Categories on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaJobCategory -SqlInstance localhost, sql2016\r\n\r\nReturns all SQL Agent Job Categories for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaLastBackup",
        "Description":  "Retrieves and compares the date/time for the last known backups, as well as the creation date/time for the database.\n\nDefault output includes columns Server, Database, RecoveryModel, LastFullBackup, LastDiffBackup, LastLogBackup, SinceFull, SinceDiff, SinceLog, Status, DatabaseCreated, DaysSinceDbCreated.",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Get date/time for last known backups",
        "Name":  "Get-DbaLastBackup",
        "Links":  "https://dbatools.io/Get-DbaLastBackup",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLastBackup -SqlInstance ServerA\\sql987\r\n\r\nReturns a custom object displaying Server, Database, RecoveryModel, LastFullBackup, LastDiffBackup, LastLogBackup, \r\nSinceFull, SinceDiff, SinceLog, Status, DatabaseCreated, DaysSinceDbCreated\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLastBackup -SqlInstance ServerA\\sql987\r\n\r\nReturns a custom object with Server name, Database name, and the date the last time backups were performed\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLastBackup -SqlInstance ServerA\\sql987 | Select *\r\n\r\nReturns a custom object with Server name, Database name, and the date the last time backups were performed, and also \r\nrecoverymodel and calculations on how long ago backups were taken and what the status is.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLastBackup -SqlInstance ServerA\\sql987 | Select * | Out-Gridview\r\n\r\nReturns a gridview displaying Server, Database, RecoveryModel, LastFullBackup, LastDiffBackup, LastLogBackup, \r\nSinceFull, SinceDiff, SinceLog, Status, DatabaseCreated, DaysSinceDbCreated\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaLastGoodCheckDb",
        "Description":  "Retrieves and compares the date/time for the last known good DBCC CHECKDB, as well as the creation date/time for the database.\n\nThis function supports SQL Server 2005+\n\nPlease note that this script uses the DBCC DBINFO() WITH TABLERESULTS. DBCC DBINFO has several known weak points, such as:\n - DBCC DBINFO is an undocumented feature/command.\n - The LastKnowGood timestamp is updated when a DBCC CHECKFILEGROUP is performed.\n - The LastKnowGood timestamp is updated when a DBCC CHECKDB WITH PHYSICAL_ONLY is performed.\n - The LastKnowGood timestamp does not get updated when a database in READ_ONLY.\n\nAn empty ($null) LastGoodCheckDb result indicates that a good DBCC CHECKDB has never been performed.\n\nSQL Server 2008R2 has a \"bug\" that causes each databases to possess two dbi_dbccLastKnownGood fields, instead of the normal one.\nThis script will only display this function to only display the newest timestamp. If -Verbose is specified, the function will announce every time more than one dbi_dbccLastKnownGood fields is encountered.",
        "Tags":  [
                     "CHECKDB",
                     "Database"
                 ],
        "Author":  "Jakob Bindslet (jakob@bindslet.dk)",
        "Synopsis":  "Get date/time for last known good DBCC CHECKDB",
        "Name":  "Get-DbaLastGoodCheckDb",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLastGoodCheckDb -SqlInstance ServerA\\sql987\r\n\r\nReturns a custom object displaying Server, Database, DatabaseCreated, LastGoodCheckDb, DaysSinceDbCreated, \r\nDaysSinceLastGoodCheckDb, Status and DataPurityEnabled\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLastGoodCheckDb -SqlInstance ServerA\\sql987 -SqlCredential (Get-Credential sqladmin) | Format-Table \r\n-AutoSize\r\n\r\nReturns a formatted table displaying Server, Database, DatabaseCreated, LastGoodCheckDb, DaysSinceDbCreated, \r\nDaysSinceLastGoodCheckDb, Status and DataPurityEnabled.\r\nAuthenticates with SQL Server using alternative credentials.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaLinkedServer",
        "Description":  "Retrieves information about each linked server on the instance",
        "Author":  "Stephen Bennett ( https://sqlnotesfromtheunderground.wordpress.com/ )",
        "Synopsis":  "Gets all linked servers and summary of information from the sql servers listed",
        "Name":  "Get-DbaLinkedServer",
        "Links":  "https://dbatools.io/Get-DbaLinkedServer",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLinkedServer -SqlInstance DEV01\r\n\r\nReturns all Linked Servers for the SQL Server instance DEV01\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaLocaleSetting",
        "Description":  "Gets the Locale settings on one or more computers.\n\nRequires Local Admin rights on destination computer(s).",
        "Tags":  "OS",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Gets the Locale settings on a computer.",
        "Name":  "Get-DbaLocaleSetting",
        "Links":  "https://dbatools.io/Get-DbaLocaleSetting",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLocaleSetting -ComputerName sqlserver2014a\r\n\r\nGets the Locale settings on computer sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\u0027,\u0027sql3\u0027 | Get-DbaLocaleSetting\r\n\r\nGets the Locale settings on computers sql1, sql2 and sql3.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLocaleSetting -ComputerName sql1,sql2 | Out-Gridview\r\n\r\nGets the Locale settings on computers sql1 and sql2, and shows them in a grid view.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaLogin",
        "Description":  "The Get-DbaLogin function returns an SMO Login object for the logins passed, if there are no users passed it will return all logins.",
        "Author":  "Klaas Vandenberghe (@powerdbaklaas)",
        "Synopsis":  "Function to get an SMO login object of the logins for a given SQL Instance. Takes a server object from the pipe",
        "Name":  "Get-DbaLogin",
        "Links":  "https://dbatools.io/Get-DbaLogin",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLogin -SqlInstance sql2016\r\n\r\nGets all the logins from server sql2016 using NT authentication and returns the SMO login objects\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLogin -SqlInstance sql2016 -SqlCredential $sqlcred\r\n\r\nGets all the logins for a given SQL Server using a passed credential object and returns the SMO login objects\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLogin -SqlInstance sql2016 -SqlCredential $sqlcred -Login dbatoolsuser,TheCaptain\r\n\r\nGet specific logins from server sql2016 returned as SMO login objects.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaLogin -SqlInstance sql2016 -ExcludeLogin dbatoolsuser\r\n\r\nGet all user objects from server sql2016 except the login dbatoolsuser, returned as SMO login objects.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql2016\u0027, \u0027sql2014\u0027 | Get-DbaLogin -SqlCredential $sqlcred\r\n\r\nUsing Get-DbaLogin on the pipeline, you can also specify which names you would like with -Login.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql2016\u0027, \u0027sql2014\u0027 | Get-DbaLogin -SqlCredential $sqlcred -Locked\r\n\r\nUsing Get-DbaLogin on the pipeline to get all locked logins on servers sql2016 and sql2014.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql2016\u0027, \u0027sql2014\u0027 | Get-DbaLogin -SqlCredential $sqlcred -HasAccess -Disabled\r\n\r\nUsing Get-DbaLogin on the pipeline to get all Disabled logins that have access on servers sql2016 or sql2014.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaMaintenanceSolutionLog",
        "Description":  "Ola wrote a .sql script to get the content from the commandLog table. However, if LogToTable=\u0027N\u0027, there will be no logging in that table. This function reads the text files that are written in the SQL Instance\u0027s Log directory.",
        "Author":  "Klaas Vandenberghe ( @powerdbaklaas )",
        "Synopsis":  "Reads the log files generated by the IndexOptimize Agent Job from Ola Hallengren\u0027s MaintenanceSolution.",
        "Name":  "Get-DbaMaintenanceSolutionLog",
        "Links":  "https://dbatools.io/Get-DbaMaintenanceSolutionLog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMaintenanceSolutionLog -SqlInstance sqlserver2014a\r\n\r\nGets the outcome of the IndexOptimize job on sql instance sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMaintenanceSolutionLog -SqlInstance sqlserver2014a -SqlCredential $credential\r\n\r\nGets the outcome of the IndexOptimize job on sqlserver2014a, using SQL Authentication.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e\u0027sqlserver2014a\u0027, \u0027sqlserver2020test\u0027 | Get-DbaMaintenanceSolutionLog\r\n\r\nGets the outcome of the IndexOptimize job on sqlserver2014a and sqlserver2020test.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMaintenanceSolutionLog -SqlInstance sqlserver2014a -Path \u0027D:\\logs\\maintenancesolution\\\u0027\r\n\r\nGets the outcome of the IndexOptimize job on sqlserver2014a, reading the log files in their custom location.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMaintenanceSolutionLog -SqlInstance sqlserver2014a -Since \u00272017-07-18\u0027\r\n\r\nGets the outcome of the IndexOptimize job on sqlserver2014a, starting from july 18, 2017.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMaintenanceSolutionLog -SqlInstance sqlserver2014a -LogType IndexOptimize\r\n\r\nGets the outcome of the IndexOptimize job on sqlserver2014a, the other options are not yet available! sorry\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaMaxMemory",
        "Description":  "This command retrieves the SQL Server \u0027Max Server Memory\u0027 configuration setting as well as the total physical installed on the server.",
        "Tags":  "Memory",
        "Synopsis":  "Gets the \u0027Max Server Memory\u0027 configuration setting and the memory of the server. Works on SQL Server 2000-2014.",
        "Name":  "Get-DbaMaxMemory",
        "Links":  "https://dbatools.io/Get-DbaMaxMemory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMaxMemory -SqlInstance sqlcluster,sqlserver2012\r\n\r\nGet memory settings for all servers within the SQL Server Central Management Server \"sqlcluster\".\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMaxMemory -SqlInstance sqlcluster | Where-Object { $_.SqlMaxMB -gt $_.TotalMB }\r\n\r\nFind all servers in Server Central Management Server that have \u0027Max Server Memory\u0027 set to higher than the total memory \r\nof the server (think 2147483647)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaMemoryUsage",
        "Description":  "Retrieves the amount of memory per performance counter. Default output includes columns Server, counter instance, counter, number of pages, memory in KB, memory in MB\nSSAS and SSIS are included.\n\t\nSSRS does not have memory counters, only memory shrinks and memory pressure state.\n\nThis function requires local admin role on the targeted computers.",
        "Tags":  "Memory",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Get amount of memory in use by *all* SQL Server components and instances",
        "Name":  "Get-DbaMemoryUsage",
        "Links":  "https://dbatools.io/Get-DbaMemoryUsage",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMemoryUsage -ComputerName ServerA\r\n\r\nReturns a custom object displaying Server, counter instance, counter, number of pages, memory in KB, memory in MB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMemoryUsage -ComputerName ServerA\\sql987 -Simple\r\n\r\nReturns a custom object with Server, counter instance, counter, number of pages, memory in KB, memory in MB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMemoryUsage -ComputerName ServerA\\sql987 | Out-Gridview\r\n\r\nReturns a gridview displaying Server, counter instance, counter, number of pages, memory in KB, memory in MB\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaMsdtc",
        "Description":  "Returns a custom object with Computer name, state of the MSDTC Service, security settings of MSDTC and CID\u0027s\n\nRequires: Windows administrator access on Servers",
        "Tags":  [
                     "WSMan",
                     "CIM"
                 ],
        "Author":  "Klaas Vandenberghe ( powerdbaklaas )",
        "Synopsis":  "Displays information about the Distributed Transactioon Coordinator (MSDTC) on a server",
        "Name":  "Get-DbaMsdtc",
        "Links":  "https://dbatools.io/Get-DbaMsdtc",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMsdtc -ComputerName srv0042\r\n\r\nGet DTC status for the server srv0042\r\n\r\nComputerName : srv0042\r\nDTCServiceName : Distributed Transaction Coordinator\r\nDTCServiceState : Running\r\nDTCServiceStatus : OK\r\nDTCServiceStartMode : Manual\r\nDTCServiceAccount : NT AUTHORITY\\NetworkService\r\nDTCCID_MSDTC : b2aefacb-85d1-46b8-8047-7bb88e08d38a\r\nDTCCID_MSDTCUIS : 205bd32c-b022-4d0c-aa3e-2e5dc65c6d35\r\nDTCCID_MSDTCTIPGW : 3e743aa0-ead6-4569-ba7b-fe1aaea0a1eb\r\nDTCCID_MSDTCXATM : 667fc4b8-c2f5-4c3f-ad75-728b113f36c5\r\nnetworkDTCAccess : 0\r\nnetworkDTCAccessAdmin : 0\r\nnetworkDTCAccessClients : 0\r\nnetworkDTCAccessInbound : 0\r\nnetworkDTCAccessOutBound : 0\r\nnetworkDTCAccessTip : 0\r\nnetworkDTCAccessTransactions : 0\r\nXATransactions : 0\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$Computers = (Get-Content D:\\configfiles\\SQL\\MySQLInstances.txt | % {$_.split(\u0027\\\u0027)[0]})\r\n\r\n$Computers | Get-DbaMsdtc\r\n\r\nGet DTC status for all the computers in a .txt file\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMsdtc -Computername $Computers | where { $_.dtcservicestate -ne \u0027running\u0027 }\r\n\r\nGet DTC status for all the computers where the MSDTC Service is not running\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaMsdtc -ComputerName srv0042 | Out-Gridview\r\n\r\nGet DTC status for the computer srv0042 and show in a grid view\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaNetworkActivity",
        "Description":  "Gets the Current traffic on every Network Interface on a computer.\nSee https://msdn.microsoft.com/en-us/library/aa394293(v=vs.85).aspx\n\nRequires Local Admin rights on destination computer(s).",
        "Tags":  "Network",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Gets the Current traffic on every Network Interface on a computer.",
        "Name":  "Get-DbaNetworkActivity",
        "Links":  "https://dbatools.io/Get-DbaNetworkActivity",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaNetworkActivity -ComputerName sqlserver2014a\r\n\r\nGets the Current traffic on every Network Interface on computer sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\u0027,\u0027sql3\u0027 | Get-DbaNetworkActivity\r\n\r\nGets the Current traffic on every Network Interface on computers sql1, sql2 and sql3.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaNetworkActivity -ComputerName sql1,sql2 | Out-Gridview\r\n\r\nGets the Current traffic on every Network Interface on computers sql1 and sql2, and shows them in a grid view.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaNetworkCertificate",
        "Description":  "Gets computer certificates on localhost that are candidates for using with SQL Server\u0027s network encryption",
        "Tags":  "Certificate",
        "Synopsis":  "Simplifies finding computer certificates that are candidates for using with SQL Server\u0027s network encryption",
        "Name":  "Get-DbaNetworkCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaNetworkCertificate\r\n\r\nGets computer certificates on localhost that are candidates for using with SQL Server\u0027s network encryption\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaNetworkCertificate -ComputerName sql2016\r\n\r\nGets computer certificates on sql2016 that are being used for SQL Server network encryption\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaOperatingSystem",
        "Description":  "Gets operating system information from the server and returns as an object.",
        "Tags":  [
                     "ServerInfo",
                     "OperatingSystem"
                 ],
        "Synopsis":  "Gets operating system information from the server.",
        "Name":  "Get-DbaOperatingSystem",
        "Links":  "https://dbatools.io/Get-DbaOperatingSystem",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaOperatingSystem\r\n\r\nReturns information about the local computer\u0027s operating system\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaOperatingSystem -ComputerName sql2016\r\n\r\nReturns information about the sql2016\u0027s operating system\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaPageFileSetting",
        "Description":  "WMI class Win32_ComputerSystem tells us if Page File is managed automatically.\nIf TRUE all other properties do not exist.\nIf FALSE classes Win32_PageFile, Win32_PageFileSetting en Win32_PageFileUsage are examined.\nCIM is used, first via WinRM, and if not successful, via DCOM.\nThis function needs to be executed as a user with local admin rights on the target computer(s).",
        "Tags":  "CIM",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Returns information about the network connection of the target computer including NetBIOS name, IP Address, domain name and fully qualified domain name (FQDN).",
        "Name":  "Get-DbaPageFileSetting",
        "Links":  "https://dbatools.io/Get-DbaPageFileSetting",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaPageFileSetting -ComputerName ServerA,ServerB\r\n\r\nReturns a custom object displaying ComputerName, AutoPageFile, FileName, Status, LastModified, LastAccessed, \r\nAllocatedBaseSize, InitialSize, MaximumSize, PeakUsage, CurrentUsage for ServerA and ServerB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027ServerA\u0027 | Get-DbaPageFileSetting\r\n\r\nReturns a custom object displaying ComputerName, AutoPageFile, FileName, Status, LastModified, LastAccessed, \r\nAllocatedBaseSize, InitialSize, MaximumSize, PeakUsage, CurrentUsage for ServerA\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaPermission",
        "Description":  "Retrieves a list of permissions\n\nPermissions link principals to securables.\nPrincipals exist on Windows, Instance and Database level.\nSecurables exist on Instance and Database level.\nA permission state can be GRANT, DENY or REVOKE.\nThe permission type can be SELECT, CONNECT, EXECUTE and more.\n\nSee https://msdn.microsoft.com/en-us/library/ms191291.aspx for more information",
        "Tags":  [
                     "Permissions",
                     "Databases"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Get a list of Server and Database level permissions",
        "Name":  "Get-DbaPermission",
        "Links":  "https://dbatools.io/Get-DbaPermission",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaPermission -SqlInstance ServerA\\sql987\r\n\r\nReturns a custom object with Server name, Database name, permission state, permission type, grantee and securable\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaPermission -SqlInstance ServerA\\sql987 | Format-Table -AutoSize\r\n\r\nReturns a formatted table displaying Server, Database, permission state, permission type, grantee, granteetype, \r\nsecurable and securabletype\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaPermission -SqlInstance ServerA\\sql987 -NoSystemObjects -IncludeServerLevel\r\n\r\nReturns a custom object with Server name, Database name, permission state, permission type, grantee and securable\r\nin all databases and on the server level, but not on system securables\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaPermission -SqlInstance sql2016 -Database master\r\n\r\nReturns a custom object with permissions for the master database\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaPrivilege",
        "Description":  "Gets the users with local privileges \u0027Lock Pages in Memory\u0027, \u0027Instant File Initialization\u0027, \u0027Logon as Batch\u0027 on one or more computers.\n\nRequires Local Admin rights on destination computer(s).",
        "Tags":  "Privilege",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Gets the users with local privileges on one or more computersr.",
        "Name":  "Get-DbaPrivilege",
        "Links":  "https://dbatools.io/Get-DbaPrivilege",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaPrivilege -ComputerName sqlserver2014a\r\n\r\nGets the local privileges on computer sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\u0027,\u0027sql3\u0027 | Get-DbaPrivilege\r\n\r\nGets the local privileges on computers sql1, sql2 and sql3.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaPrivilege -ComputerName sql1,sql2 | Out-Gridview\r\n\r\nGets the local privileges on computers sql1 and sql2, and shows them in a grid view.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaProcess",
        "Description":  "This command displays processes associated with a spid, login, host, program or database.\n\nThanks to Michael J Swart at https://sqlperformance.com/2017/07/sql-performance/find-database-connection-leaks for the\nquery to get the last executed SQL statement, minutesasleep and host process ID",
        "Synopsis":  "This command displays SQL Server processes.",
        "Name":  "Get-DbaProcess",
        "Links":  "https://dbatools.io/Get-DbaProcess",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaProcess -SqlInstance sqlserver2014a -Login base\\ctrlb, sa\r\n\r\nShows information about the processes for base\\ctrlb and sa on sqlserver2014a. Uses Windows Authentication to login to \r\nsqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaProcess -SqlInstance sqlserver2014a -SqlCredential $credential -Spid 56, 77\r\n\r\nShows information about the processes for spid 56 and 57. Uses alternative (SQL or Windows) credentials to login to \r\nsqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaProcess -SqlInstance sqlserver2014a -Program \u0027Microsoft SQL Server Management Studio\u0027\r\n\r\nShows information about the processes that were created in Microsoft SQL Server Management Studio.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaProcess -SqlInstance sqlserver2014a -Host workstationx, server100\r\n\r\nShows information about the processes that were initiated by hosts (computers/clients) workstationx and server 1000.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaQueryExecutionTime",
        "Description":  "Quickly find slow query executions within a database. Results will include stored procedures and individual SQL statements.",
        "Tags":  [
                     "Query",
                     "Performance"
                 ],
        "Author":  "Brandon Abshire, netnerds.net",
        "Synopsis":  "Displays Stored Procedures and Ad hoc queries with the highest execution times. Works on SQL Server 2008 and above.",
        "Name":  "Get-DbaQueryExecutionTime",
        "Links":  "https://dbatools.io/Get-DbaQueryExecutionTime",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaQueryExecutionTime -SqlInstance sql2008, sqlserver2012\r\n\r\nReturn the top 100 slowest stored procedures or statements for servers sql2008 and sqlserver2012.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaQueryExecutionTime -SqlInstance sql2008 -Database TestDB\r\n\r\nReturn the top 100 slowest stored procedures or statements on server sql2008 for only the TestDB database.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaQueryExecutionTime -SqlInstance sql2008 -Database TestDB -MaxResultsPerDb 100 -MinExecs 200 -MinExecMs \r\n1000\r\n\r\nReturn the top 100 slowest stored procedures or statements on server sql2008 for only the TestDB database,\r\nlimiting results to queries with more than 200 total executions and an execution time over 1000ms or higher.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaRegisteredServerName",
        "Description":  "Returns an array of servers found in the CMS. By default, the command returns the ServerName property\nof the servers. You can specify -FullObject to return the full SMO object, -IpAddress for only the\nIPv4 Addresses of the server, and -NetBiosName for only the ComputerName.",
        "Tags":  [
                     "RegisteredServer",
                     "CMS"
                 ],
        "Synopsis":  "Gets list of SQL Server objects stored in SQL Server Central Management Server (CMS).",
        "Name":  "Get-DbaRegisteredServerName",
        "Links":  "https://dbatools.io/Get-DbaRegisteredServerName",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a\r\n\r\nGets a list of server names from the CMS on sqlserver2014a, using Windows Credentials\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a -SqlCredential $credential\r\n\r\nGets a list of server names from the CMS on sqlserver2014a, using SQL Authentication\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a -Group HR, Accounting\r\n\r\nGets a list of servers in the HR and Accounting groups from the CMS on sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a -NoCmsServer\r\n\r\nGets a list of server names from the CMS on sqlserver2014a, but excludes the CMS server name.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a -Group HR\\Development\r\n\r\nReturns a list of server names in the HR and sub-group Development from the CMS on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a -IpAddress\r\n\r\nGets a list of the IP Addresses for servers in the CMS on sqlserver2014a, using Windows Credentials\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a -NetBiosName\r\n\r\nGets a list of the NetBIOS names of the servers in the CMS on sqlserver2014a, using Windows Credentials\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a -FullObject\r\n\r\nReturns the full SMO RegisteredServer object for servers in the CMS on sqlserver2014a, using Windows Credentials\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaRegisteredServersStore",
        "Description":  "Returns a SQL Server Registered Server Store object - useful for working with Central Management Store",
        "Tags":  [
                     "RegisteredServer",
                     "CMS"
                 ],
        "Synopsis":  "Returns a SQL Server Registered Server Store Object",
        "Name":  "Get-DbaRegisteredServersStore",
        "Links":  "https://dbatools.io/Get-DbaRegisteredServersStore",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServersStore -SqlInstance sqlserver2014a\r\n\r\nReturns a SQL Server Registered Server Store Object from sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServersStore -SqlInstance sqlserver2014a -SqlCredential (Get-Credential sqladmin)\r\n\r\nReturns a SQL Server Registered Server Store Object from sqlserver2014a by logging in with the sqladmin login\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaRestoreHistory",
        "Description":  "By default, this command will return the server name, database, username, restore type, date, from file and to files.\n\nThanks to https://www.mssqltips.com/SqlInstancetip/1724/when-was-the-last-time-your-sql-server-database-was-restored/ for the query and https://sqlstudies.com/2016/07/27/when-was-this-database-restored/ for the idea.",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup",
                     "Restore",
                     "Databases"
                 ],
        "Synopsis":  "Returns restore history details for databases on a SQL Server",
        "Name":  "Get-DbaRestoreHistory",
        "Links":  "https://dbatools.io/Get-DbaRestoreHistory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRestoreHistory -SqlInstance sql2016\r\n\r\nReturns server name, database, username, restore type, date for all restored databases on sql2016.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRestoreHistory -SqlInstance sql2016 -Database db1, db2 -Since \u00277/1/2016 10:47:00\u0027\r\n\r\nReturns restore information only for databases db1 and db2 on sqlserve2014a since July 1, 2016 at 10:47 AM.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRestoreHistory -SqlInstance sql2016, sql2016 -Exclude db1\r\n\r\nLots of detailed information for all databases except db1 on sql2016 and sql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRestoreHistory -SqlInstance sql2014 -Database AdventureWorks2014, pubs | Format-Table\r\n\r\nAdds From and To file information to output, returns information only for AdventureWorks2014 and pubs, and makes the \r\noutput pretty\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sql2016 | Get-DbaRestoreHistory\r\n\r\nReturns database restore information for every database on every server listed in the Central Management Server on \r\nsql2016\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaRoleMember",
        "Description":  "Get members of all roles on a Sql instance.\n\nDefault output includes columns SQLServer, Database, Role, Member.",
        "Tags":  [
                     "Roles",
                     "Databases"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Get members of all roles on a Sql instance.",
        "Name":  "Get-DbaRoleMember",
        "Links":  "https://dbatools.io/Get-DbaRoleMember",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRoleMember -SqlInstance ServerA\r\n\r\nReturns a custom object displaying SQLServer, Database, Role, Member for all DatabaseRoles.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRoleMember -SqlInstance sql2016 | Out-Gridview\r\n\r\nReturns a gridview displaying SQLServer, Database, Role, Member for all DatabaseRoles.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRoleMember -SqlInstance ServerA\\sql987 -IncludeServerLevel\r\n\r\nReturns a gridview displaying SQLServer, Database, Role, Member for both ServerRoles and DatabaseRoles.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaRunningJob",
        "Description":  "This function returns agent jobs that active on the SQL Server instance when calling the command. The information is gathered the SMO JobServer.jobs and be returned either in detailed or standard format",
        "Synopsis":  "Returns all non idle agent jobs running on the server.",
        "Name":  "Get-DbaRunningJob",
        "Links":  "https://dbatools.io/Get-DbaRunningJob",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRunningJob -SqlInstance localhost\r\n\r\nReturns any active jobs on the localhost\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRunningJob -SqlInstance localhost -Detailed\r\n\r\nReturns a detailed output of any active jobs on the localhost\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e\u0027localhost\u0027,\u0027localhost\\namedinstance\u0027 | Get-DbaRunningJob\r\n\r\nReturns all active jobs on multiple instances piped into the function\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSchemaChangeHistory",
        "Description":  "Queries the default system trace for any DDL changes in the specified timeframe\nOnly works with SQL 2005 and later, as the system trace didn\u0027t exist before then",
        "Tags":  [
                     "Migration",
                     "Backup",
                     "Databases"
                 ],
        "Synopsis":  "Gets DDL changes logged in the system trace.",
        "Name":  "Get-DbaSchemaChangeHistory",
        "Links":  "https://dbatools.io/Get-DbaSchemaChangeHistory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSchemaChangeHistory -SqlInstance localhost\r\n\r\nReturns all DDL changes made in all databases on the SQL Server instance localhost since the system trace began\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSchemaChangeHistory -SqlInstance localhost -Since (Get-Date).AddDays(-7)\r\n\r\nReturns all DDL changes made in all databases on the SQL Server instance localhost in the last 7 days\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSchemaChangeHistory -SqlInstance localhost -Database Finance, Prod -Since (Get-Date).AddDays(-7)\r\n\r\nReturns all DDL changes made in the Prod and Finance databases on the SQL Server instance localhost in the last 7 days\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSchemaChangeHistory -SqlInstance localhost -Database Finance -Object AccountsTable -Since \r\n(Get-Date).AddDays(-7)\r\n\r\nReturns all DDL changes made to the AccountsTable object in the Finance database on the SQL Server instance localhost \r\nin the last 7 days\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaServerAudit",
        "Description":  "The Get-DbaServerAudit command gets SQL Security Audit information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Security Audit information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaServerAudit",
        "Links":  "https://dbatools.io/Get-DbaServerAudit",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerAudit -SqlInstance localhost\r\n\r\nReturns all Security Audits on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerAudit -SqlInstance localhost, sql2016\r\n\r\nReturns all Security Audits for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaServerAuditSpecification",
        "Description":  "The Get-DbaServerAuditSpecification command gets SQL Security Audit Specification information for each instance(s) of SQL Server.",
        "Author":  "Garry Bargsley (@gbargsley), http://blog.garrybargsley.com",
        "Synopsis":  "Gets SQL Security Audit Specification information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaServerAuditSpecification",
        "Links":  "https://dbatools.io/Get-DbaServerAuditSpecification",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerAuditSpecification -SqlInstance localhost\r\n\r\nReturns all Security Audit Specifications on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerAuditSpecification -SqlInstance localhost, sql2016\r\n\r\nReturns all Security Audit Specifications for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaServerInstallDate",
        "Description":  "By default, this command returns for each SQL Instance instance passed in:\nSQL Instance install date, formatted as a string\nHosting Windows server install date, formatted as a string",
        "Tags":  "CIM",
        "Synopsis":  "Returns the install date of a SQL Instance and Windows Server, depending on what is passed.",
        "Name":  "Get-DbaServerInstallDate",
        "Links":  "https://dbatools.io/Get-DbaServerInstallDate",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerInstallDate -SqlInstance SqlBox1\\Instance2\r\n\r\nReturns an object with SQL Instance Install date as a string and the Windows install date as string.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerInstallDate -SqlInstance winserver\\sqlexpress, sql2016\r\n\r\nReturns an object with SQL Instance Install date as a string and the Windows install date as a string for both \r\nSQLInstances that are passed to the cmdlet.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerInstallDate -SqlInstance sqlserver2014a, sql2016\r\n\r\nReturns an object with only the SQL Server Install date as a string.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerInstallDate -SqlInstance sqlserver2014a, sql2016 -IncludeWindows\r\n\r\nReturns an object with the Windows Install date and the SQL install date as a string.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sql2014 | Get-DbaServerInstallDate\r\n\r\nReturns an object with SQL Instance install date as a string for every server listed in the Central Management Server \r\non sql2014\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaServerProtocol",
        "Description":  "Gets the SQL Server related server protocols on one or more computers.\n\nRequires Local Admin rights on destination computer(s).\nThe server protocols can be enabled and disabled when retrieved via WSMan.",
        "Tags":  "Protocol",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Gets the SQL Server related server protocols on a computer.",
        "Name":  "Get-DbaServerProtocol",
        "Links":  "https://dbatools.io/Get-DbaServerProtocol",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerProtocol -ComputerName sqlserver2014a\r\n\r\nGets the SQL Server related server protocols on computer sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\u0027,\u0027sql3\u0027 | Get-DbaServerProtocol\r\n\r\nGets the SQL Server related server protocols on computers sql1, sql2 and sql3.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaServerProtocol -ComputerName sql1,sql2 | Out-Gridview\r\n\r\nGets the SQL Server related server protocols on computers sql1 and sql2, and shows them in a grid view.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e(Get-DbaServerProtocol -ComputerName sql1 | Where { $_.DisplayName = \u0027via\u0027 }).Disable()\r\n\r\nDisables the VIA ServerNetworkProtocol on computer sql1.\r\nIf succesfull, returncode 0 is shown.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSpConfigure",
        "Description":  "This function returns server level system configuration (sys.configuration/sp_configure) information. The information is gathered through SMO Configuration.Properties.\nThe data includes the default value for each configuration, for quick identification of values that may have been changed.",
        "Author":  "Nic Cain, https://sirsql.net/",
        "Synopsis":  "Returns all server level system configuration (sys.configuration/sp_configure) information",
        "Name":  "Get-DbaSpConfigure",
        "Links":  "https://dbatools.io/Get-DbaSpConfigure",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSpConfigure -SqlInstance localhost\r\n\r\nReturns server level configuration data on the localhost (ServerName, ConfigName, DisplayName, Description, IsAdvanced, \r\nIsDynamic, MinValue, MaxValue, ConfiguredValue, RunningValue, DefaultValue, IsRunningDefaultValue)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027localhost\u0027,\u0027localhost\\namedinstance\u0027 | Get-DbaSpConfigure\r\n\r\nReturns system configuration information on multiple instances piped into the function\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSpConfigure -SqlInstance localhost\r\n\r\nReturns server level configuration data on the localhost (ServerName, ConfigName, DisplayName, Description, IsAdvanced, \r\nIsDynamic, MinValue, MaxValue, ConfiguredValue, RunningValue, DefaultValue, IsRunningDefaultValue)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSpConfigure -SqlInstance sql2012 -ConfigName MaxServerMemory\r\n\r\nReturns only the system configuration for MaxServerMemory. Configs is auto-populated for tabbing convenience.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSpn",
        "Description":  "Get a list of set SPNs. SPNs are set at the AD account level. You can either retrieve set SPNs for a computer, or any SPNs set for\na given active directry account. You can query one, or both. You\u0027ll get a list of every SPN found for either search term.",
        "Tags":  "SPN",
        "Author":  "Drew Furgiuele (@pittfurg), http://www.port1433.com",
        "Synopsis":  "Returns a list of set service principal names for a given computer/AD account",
        "Name":  "Get-DbaSpn",
        "Links":  "https://dbatools.io/Get-DbaSpn",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSpn -ServerName SQLSERVERA -Credential (Get-Credential)\r\n\r\nReturns a custom object with SearchTerm (ServerName) and the SPNs that were found\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSpn -AccountName domain\\account -Credential (Get-Credential)\r\n\r\nReturns a custom object with SearchTerm (domain account) and the SPNs that were found\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSpn -ServerName SQLSERVERA,SQLSERVERB -Credential (Get-Credential)\r\n\r\nReturns a custom object with SearchTerm (ServerName) and the SPNs that were found for multiple computers\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlBuildReference",
        "Description":  "Returns info about the specific build of a SQL instance, including the SP, the CU and the reference KB, wherever possible.\nIt also includes End Of Support dates as specified on Microsoft Lifecycle Policy",
        "Tags":  "SqlBuild",
        "Author":  "niphlod",
        "Synopsis":  "Returns SQL Server Build infos on a SQL instance",
        "Name":  "Get-DbaSqlBuildReference",
        "Links":  "https://dbatools.io/Get-DbaSqlBuildReference",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlBuildReference -Build \"12.00.4502\"\r\n\r\nReturns information about a build identified by \"12.00.4502\" (which is SQL 2014 with SP1 and CU11)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlBuildReference -Build \"12.00.4502\" -Update\r\n\r\nReturns information about a build trying to fetch the most up to date index online. When the online version is newer, \r\nthe local one gets overwritten\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlBuildReference -Build \"12.0.4502\",\"10.50.4260\"\r\n\r\nReturns information builds identified by these versions strings\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver2014a | Get-DbaSqlBuildReference\r\n\r\nIntegrate with other commandlets to have builds checked for all your registered servers on sqlserver2014a\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlInstanceProperty",
        "Description":  "The Get-DbaSqlInstanceProperty command gets SQL Instance properties from the SMO object sqlserver.",
        "Author":  "Klaas Vandenberghe (@powerdbaklaas)",
        "Synopsis":  "Gets SQL Instance properties of one or more instance(s) of SQL Server.",
        "Name":  "Get-DbaSqlInstanceProperty",
        "Links":  "https://dbatools.io/Get-DbaSqlInstanceProperty",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlInstanceProperty -SqlInstance localhost\r\n\r\nReturns SQL Instance properties on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlInstanceProperty -SqlInstance sql2, sql4\\sqlexpress\r\n\r\nReturns SQL Instance properties on default instance on sql2 and sqlexpress instance on sql4\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql2\u0027,\u0027sql4\u0027 | Get-DbaSqlInstanceProperty\r\n\r\nReturns SQL Instance properties on sql2 and sql4\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlInstanceUserOption",
        "Description":  "The Get-DbaSqlInstanceUserOption command gets SQL Instance user options from the SMO object sqlserver.",
        "Author":  "Klaas Vandenberghe (@powerdbaklaas)",
        "Synopsis":  "Gets SQL Instance user options of one or more instance(s) of SQL Server.",
        "Name":  "Get-DbaSqlInstanceUserOption",
        "Links":  "https://dbatools.io/Get-DbaSqlInstanceUserOption",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlInstanceUserOption -SqlInstance localhost\r\n\r\nReturns SQL Instance user options on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlInstanceUserOption -SqlInstance sql2, sql4\\sqlexpress\r\n\r\nReturns SQL Instance user options on default instance on sql2 and sqlexpress instance on sql4\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql2\u0027,\u0027sql4\u0027 | Get-DbaSqlInstanceUserOption\r\n\r\nReturns SQL Instance user options on sql2 and sql4\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlLog",
        "Description":  "Gets the \"SQL Error Log\" of an instance. Returns all 10 error logs by default.",
        "Tags":  "Logging",
        "Synopsis":  "Gets the \"SQL Error Log\" of an instance",
        "Name":  "Get-DbaSqlLog",
        "Links":  "https://dbatools.io/Get-DbaSqlLog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlLog -SqlInstance sql01\\sharepoint\r\n\r\nReturns every log entry from sql01\\sharepoint SQL Server instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlLog -SqlInstance sql01\\sharepoint -LogNumber 3, 6\r\n\r\nReturns all log entries for log number 3 and 6 on sql01\\sharepoint SQL Server instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlLog -SqlInstance sql01\\sharepoint -Source Logon\r\n\r\nReturns every log entry, with a source of Logon, from sql01\\sharepoint SQL Server instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlLog -SqlInstance sql01\\sharepoint -LogNumber 3 -Text \"login failed\"\r\n\r\nReturns every log entry for log number 3, with \"login failed\" in the text, from sql01\\sharepoint SQL Server instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e$servers = \"sql2014\",\"sql2016\", \"sqlcluster\\sharepoint\"\r\n\r\n$servers | Get-DbaSqlLog -LogNumber 0\r\n\r\nReturns the most recent SQL Server error logs for \"sql2014\",\"sql2016\" and \"sqlcluster\\sharepoint\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlLog -SqlInstance sql01\\sharepoint -After \u002711/14/2006 00:00\u0027\r\n\r\nReturns every log entry found after the date 11/14/2006 00:00 from sql101\\sharepoint SQL Server instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlLog -SqlInstance sql01\\sharepoint -Before \u002708/16/2016 00:00\u0027\r\n\r\nReturns every log entry found before the date 08/16/2016 00:00 from sql101\\sharepoint SQL Server instance.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlManagementObject",
        "Description":  "The Get-DbaSqlManagementObject returns an object with the Version and the \nAdd-Type Load Template for each version on the server.",
        "Tags":  "SMO",
        "Synopsis":  "Gets SQL Mangaement Object versions installed on the machine.",
        "Name":  "Get-DbaSqlManagementObject",
        "Links":  "https://dbatools.io/Get-DbaSqlManagementObject",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlManagementObject\r\n\r\nReturns all versions of SMO on the computer\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlManagementObject -VersionNumber 13\r\n\r\nReturns just the version specified. If the version does not exist then it will return nothing.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlModule",
        "Description":  "Quickly find modules (Stored Procs, Functions, Views, Constraints, Rules, Triggers, etc) that have been modified in a database, or across all databases.\nResults will exclude the module definition, but can be queried explicitly.",
        "Tags":  [
                     "StoredProcedure",
                     "Trigger"
                 ],
        "Author":  "Brandon Abshire, netnerds.net",
        "Synopsis":  "Displays all objects in sys.sys_modules after specified modification date. Works on SQL Server 2008 and above.",
        "Name":  "Get-DbaSqlModule",
        "Links":  "https://dbatools.io/Get-DbaSqlModule",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlModule -SqlServer sql2008, sqlserver2012\r\n\r\nReturn all modules for servers sql2008 and sqlserver2012 sorted by Database, Modify_Date ASC.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlModule -SqlServer sql2008, sqlserver2012 | Select *\r\n\r\nShows hidden definition column (informative wall of text).\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlModule -SqlServer sql2008 -Database TestDB -ModifiedSince \"01/01/2017 10:00:00 AM\"\r\n\r\nReturn all modules on server sql2008 for only the TestDB database with a modified date after 01/01/2017 10:00:00 AM.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlModule -SqlServer sql2008 -Type View, Trigger, ScalarFunction\r\n\r\nReturn all modules on server sql2008 for all databases that are triggers, views or scalar functions.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlProductKey",
        "Description":  "Using a string of servers, a text file, or Central Management Server to provide a list of servers, this script will go to each server and get the product key for all installed instances. Clustered instances are supported as well. Requires regular user access to the SQL instances, SMO installed locally, Remote Registry enabled and accessible by the account running the script.\n\nUses key decoder by Jakob Bindslet (http://goo.gl/1jiwcB)",
        "Tags":  [
                     "SQL",
                     "Product Key"
                 ],
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Gets SQL Server Product Keys from local or destination SQL Servers. Works with SQL Server 2005-2016",
        "Name":  "Get-DbaSqlProductKey",
        "Links":  "https://dbatools.io/Get-DbaSqlProductKey",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlProductKey winxp, sqlservera, sqlserver2014a, win2k8\r\n\r\nGets SQL Server versions, editions and product keys for all instances within each server or workstation.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlProductKey -SqlCms sqlserver01\r\n\r\nGets SQL Server versions, editions and product keys for all instances within sqlserver01\u0027s Central Management Server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlProductKey -ServersFromFile C:\\Scripts\\servers.txt\r\n\r\nGets SQL Server versions, editions and product keys for all instances listed within C:\\Scripts\\servers.txt\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSqlService",
        "Description":  "Gets the SQL Server related services on one or more computers.\n\nRequires Local Admin rights on destination computer(s).",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Gets the SQL Server related services on a computer.",
        "Name":  "Get-DbaSqlService",
        "Links":  "https://dbatools.io/Get-DbaSqlService",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlService -ComputerName sqlserver2014a\r\n\r\nGets the SQL Server related services on computer sqlserver2014a.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\u0027,\u0027sql3\u0027 | Get-DbaSqlService\r\n\r\nGets the SQL Server related services on computers sql1, sql2 and sql3.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlService -ComputerName sql1,sql2 | Out-Gridview\r\n\r\nGets the SQL Server related services on computers sql1 and sql2, and shows them in a grid view.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSqlService -ComputerName $MyServers -Type SSRS\r\n\r\nGets the SQL Server related services of type \"SSRS\" (Reporting Services) on computers in the variable MyServers.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaSsisEnvironmentVariable",
        "Description":  "This command gets all variables from specified environment from SSIS Catalog. All sensitive values are decrypted.\nThe function communicates directly with SSISDB database, \"SQL Server Integration Services\" service isn\u0027t queried there.\nEach parameter (besides SqlInstance and SqlCredential) acts as the filter to only include or exclude particular element",
        "Author":  "Bartosz Ratajczyk ( @b_ratajczyk )",
        "Synopsis":  "This command gets specified SSIS Environment and all its variables",
        "Name":  "Get-DbaSsisEnvironmentVariable",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV -Folder DWH_ETL\r\n\r\nGets variables of \u0027DEV\u0027 environment located in \u0027DWH_ETL\u0027 folder on \u0027localhost\u0027 Server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV -Folder DWH_ETL, DEV2, QA\r\n\r\nGets variables of \u0027DEV\u0027 environment(s) located in folders \u0027DWH_ETL\u0027, \u0027DEV2\u0027 and \u0027QA\u0027 on \u0027localhost\u0027 server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV -FolderExclude DWH_ETL, DEV2, QA\r\n\r\nGets variables of \u0027DEV\u0027 environments located in folders other than \u0027DWH_ETL\u0027, \u0027DEV2\u0027 and \u0027QA\u0027 on \u0027localhost\u0027 server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV, PROD -Folder DWH_ETL, DEV2, QA\r\n\r\nGets variables of \u0027DEV\u0027 and \u0027PROD\u0027 environment(s) located in folders \u0027DWH_ETL\u0027, \u0027DEV2\u0027 and \u0027QA\u0027 on \u0027localhost\u0027 server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSsisEnvironmentVariable -SqlInstance localhost -EnvironmentExclude DEV, PROD -Folder DWH_ETL, DEV2, QA\r\n\r\nGets variables of environments other than \u0027DEV\u0027 and \u0027PROD\u0027 located in folders \u0027DWH_ETL\u0027, \u0027DEV2\u0027 and \u0027QA\u0027 on \u0027localhost\u0027 \r\nserver\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaSsisEnvironmentVariable -SqlInstance localhost -EnvironmentExclude DEV, PROD -FolderExclude DWH_ETL, \r\nDEV2, QA\r\n\r\nGets variables of environments other than \u0027DEV\u0027 and \u0027PROD\u0027 located in folders other than \u0027DWH_ETL\u0027, \u0027DEV2\u0027 and \u0027QA\u0027 on \r\n\u0027localhost\u0027 server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003e\u0027localhost\u0027 | Get-DbaSsisEnvironmentVariable -EnvironmentExclude DEV, PROD\r\n\r\nGets all SSIS environments except \u0027DEV\u0027 and \u0027PROD\u0027 from \u0027localhost\u0027 server. The server name comes from pipeline\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003e\u0027SRV1\u0027, \u0027SRV3\u0027 | Get-DbaSsisEnvironmentVariable\r\n\r\nGets all SSIS environments from \u0027SRV1\u0027 and \u0027SRV3\u0027 servers. The server\u0027s names come from pipeline\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 9 --------------------------\r\n\r\nPS C:\\\u003e\u0027SRV1\u0027, \u0027SRV2\u0027 | Get-DbaSsisEnvironmentVariable DEV | Out-GridView\r\n\r\nGets all variables from \u0027DEV\u0027 Environment(s) on servers \u0027SRV1\u0027 and \u0027SRV2\u0027 and outputs it as the GridView. \r\nThe server names come from the pipeline.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 10 --------------------------\r\n\r\nPS C:\\\u003e\u0027localhost\u0027 | Get-DbaSsisEnvironmentVariable -EnvironmentExclude DEV, PROD | Select-Object -Property Name, Value \r\n| Where-Object {$_.Name -match \u0027^a\u0027} | Out-GridView\r\n\r\nGets all variables from Environments other than \u0027DEV\u0027 and \u0027PROD\u0027 on \u0027localhost\u0027 server, \r\nselects Name and Value properties for variables that names start with letter \u0027a\u0027 and outputs it as the GridView\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaStartupParameter",
        "Description":  "Displays values for a detailed list of SQL Server Startup Parameters including Master Data Path, Master Log path, Error Log, Trace Flags, Parameter String and much more.\n\nThis command relies on remote Windows Server (SQL WMI/WinRm) access. You can pass alternative Windows credentials by using the -Credential parameter.\n\nSee https://msdn.microsoft.com/en-us/library/ms190737.aspx for more information.",
        "Tags":  [
                     "WSMan",
                     "SQLWMI",
                     "Memory"
                 ],
        "Synopsis":  "Displays values for a detailed list of SQL Server Startup Parameters.",
        "Name":  "Get-DbaStartupParameter",
        "Links":  "https://dbatools.io/Get-DbaStartupParameter",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaStartupParameter -SqlInstance sql2014\r\n\r\nLogs into SQL WMI as the current user then displays the values for numerous startup parameters.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$wincred = Get-Credential ad\\sqladmin\r\n\r\nGet-DbaStartupParameter -SqlInstance sql2014 -Credential $wincred -Simple\r\n\r\nLogs in to WMI using the ad\\sqladmin credential and gathers simplified information about the SQL Server Startup \r\nParameters.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaTable",
        "Description":  "Shows table information around table row and data sizes and if it has any table type information.",
        "Tags":  [
                     "Database",
                     "Tables"
                 ],
        "Synopsis":  "Returns a summary of information on the tables",
        "Name":  "Get-DbaTable",
        "Links":  "https://dbatools.io/Get-DbaTable",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTable -SqlInstance DEV01 -Database Test1\r\n\r\nReturn all tables in the Test1 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTable -SqlInstance DEV01 -Database MyDB -Table MyTable\r\n\r\nReturn only information on the table MyTable from the database MyDB\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTable -SqlInstance DEV01 -Table MyTable\r\n\r\nReturns information on table called MyTable if it exists in any database on the server, under any schema\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTable -SqlInstance DEV01 -Table dbo.[First.Table]\r\n\r\nReturns information on table called First.Table on schema dbo if it exists in any database on the server\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e\u0027localhost\u0027,\u0027localhost\\namedinstance\u0027 | Get-DbaTable -Database DBA -Table Commandlog\r\n\r\nReturns information on the CommandLog table in the DBA database on both instances localhost and the named instance \r\nlocalhost\\namedinstance\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaTcpPort",
        "Description":  "By default, this command returns just the TCP port used by the specified SQL Server.\n\nIf -Detailed is specified, server name, IPAddress (ipv4 and ipv6), port number and if the port assignment is static.",
        "Tags":  [
                     "SQLWMI",
                     "tcp"
                 ],
        "Synopsis":  "Returns the TCP port used by the specified SQL Server.",
        "Name":  "Get-DbaTcpPort",
        "Links":  "https://dbatools.io/Get-DbaTcpPort",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTcpPort -SqlInstance sqlserver2014a\r\n\r\nReturns just the port number for the default instance on sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTcpPort -SqlInstance winserver\\sqlexpress, sql2016\r\n\r\nReturns an object with server name and port number for the sqlexpress on winserver and the default instance on sql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTcpPort -SqlInstance sqlserver2014a, sql2016 -Detailed\r\n\r\nReturns an object with server name, IPAddress (ipv4 and ipv6), port and static ($true/$false) for sqlserver2014a and \r\nsql2016\r\n\r\nRemote sqlwmi is used by default. If this doesn\u0027t work, then remoting is used. If neither work, it defaults to T-SQL \r\nwhich can provide only the port.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sql2014 | Get-DbaTcpPort -ExcludeIpv6 -Detailed -Verbose\r\n\r\nReturns an object with server name, IPAddress (just ipv4), port and static ($true/$false) for every server listed in \r\nthe Central Management Server on sql2014\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaTempdbUsage",
        "Description":  "This function queries DMVs for running sessions using Tempdb and returns results if those sessions have user or internal space allocated or deallocated against them.",
        "Synopsis":  "Gets Tempdb usage for running queries.",
        "Name":  "Get-DbaTempdbUsage",
        "Links":  "https://dbatools.io/Get-DbaTempdbUsage",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTempdbUsage -SqlInstance localhost\\SQLDEV2K14\r\n\r\nGets tempdb usage for localhost\\SQLDEV2K14\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbatoolsLog",
        "Description":  "Returns log entries for dbatools. Handy when debugging or developing for it. Also used when preparing a support package.",
        "Tags":  "Debug",
        "Synopsis":  "Returns log entries for dbatools",
        "Name":  "Get-DbatoolsLog",
        "Links":  "https://dbatools.io/Get-DbatoolsLog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbatoolsLog\r\n\r\nReturns all log entries currently in memory.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaTraceFlag",
        "Description":  "Returns Trace Flags that are enabled globally on each instance(s) of SQL Server as an object.",
        "Tags":  [
                     "Trace",
                     "Flag"
                 ],
        "Synopsis":  "Get global Trace Flag(s) information for each instance(s) of SQL Server.",
        "Name":  "Get-DbaTraceFlag",
        "Links":  "https://dbatools.io/Get-DbaTraceFlag",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTraceFlag -SqlInstance localhost\r\n\r\nReturns all Trace Flag information on the local default SQL Server instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTraceFlag -SqlInstance localhost, sql2016\r\n\r\nReturns all Trace Flag(s) for the local and sql2016 SQL Server instances\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTraceFlag -SqlInstance localhost -TraceFlag 4199,3205\r\n\r\nReturns Trace Flag status for TF 4199 and 3205 for the local SQL Server instance if they are enabled.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaTrigger",
        "Description":  "Get all existing triggers on one or more SQL instances.\n\nDefault output includes columns ComputerName, SqlInstance, Database, TriggerName, IsEnabled and DateLastModified.",
        "Tags":  [
                     "Database",
                     "Triggers"
                 ],
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Get all existing triggers on one or more SQL instances.",
        "Name":  "Get-DbaTrigger",
        "Links":  "https://dbatools.io/Get-DbaTrigger",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTrigger -SqlInstance ComputerA\\sql987\r\n\r\nReturns a custom object displaying ComputerName, SqlInstance, Database, TriggerName, IsEnabled and DateLastModified.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTrigger -SqlInstance \u0027ComputerA\\sql987\u0027,\u0027ComputerB\u0027\r\n\r\nReturns a custom object displaying ComputerName, SqlInstance, Database, TriggerName, IsEnabled and DateLastModified \r\nfrom two instances.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaTrigger -SqlInstance ComputerA\\sql987 | Out-Gridview\r\n\r\nReturns a gridview displaying ComputerName, SqlInstance, Database, TriggerName, IsEnabled and DateLastModified.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e\u0027ComputerA\\sql987\u0027,\u0027ComputerB\u0027 | Get-DbaTrigger | Out-Gridview\r\n\r\nReturns a custom object displaying ComputerName, SqlInstance, Database, TriggerName, IsEnabled and DateLastModified \r\nfrom two instances.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaUptime",
        "Description":  "By default, this command returns for each SQL Server instance passed in:\nSQL Instance last startup time, Uptime as a PS TimeSpan, Uptime as a formatted string\nHosting Windows server last startup time, Uptime as a PS TimeSpan, Uptime as a formatted string",
        "Tags":  "CIM",
        "Synopsis":  "Returns the uptime of the SQL Server instance, and if required the hosting windows server",
        "Name":  "Get-DbaUptime",
        "Links":  "https://dbatools.io/Get-DbaUptime",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaUptime -SqlInstance SqlBox1\\Instance2\r\n\r\nReturns an object with SQL Server start time, uptime as TimeSpan object, uptime as a string, and Windows host boot \r\ntime, host uptime as TimeSpan objects and host uptime as a string for the sqlexpress instance on winserver\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaUptime -SqlInstance winserver\\sqlexpress, sql2016\r\n\r\nReturns an object with SQL Server start time, uptime as TimeSpan object, uptime as a string, and Windows host boot \r\ntime, host uptime as TimeSpan objects and host uptime as a string for the sqlexpress instance on host winserver and \r\nthe default instance on host sql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaUptime -SqlInstance sqlserver2014a, sql2016 -SqlOnly\r\n\r\nReturns an object with SQL Server start time, uptime as TimeSpan object, uptime as a string for the sqlexpress instance \r\non host winserver and the default instance on host sql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sql2014 | Get-DbaUptime\r\n\r\nReturns an object with SQL Server start time, uptime as TimeSpan object, uptime as a string, and Windows host boot \r\ntime, host uptime as TimeSpan objects and host uptime as a string for every server listed in the Central Management \r\nServer on sql2014\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaWindowsLog",
        "Description":  "Gets Windows Application events associated with an instance",
        "Tags":  "Logging",
        "Synopsis":  "Gets Windows Application events associated with an instance",
        "Name":  "Get-DbaWindowsLog",
        "Links":  "https://dbatools.io/Get-DbaWindowsLog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003e$ErrorLogs = Get-DbaWindowsLog -SqlInstance sql01\\sharepoint\r\n\r\n$ErrorLogs | Where-Object ErrorNumber -eq 18456\r\n\r\nReturns all lines in the errorlogs that have event number 18456 in them\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Get-DbaXEventsSession",
        "Description":  "Retrieves a list of Extended Events Sessions",
        "Tags":  "Memory",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Get a list of Extended Events Sessions",
        "Name":  "Get-DbaXEventsSession",
        "Links":  "https://dbatools.io/Get-DbaXEventsSession",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaXEventsSession -SqlInstance ServerA\\sql987\r\n\r\nReturns a custom object with ComputerName, SQLInstance, Session, StartTime, Status and other properties.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaXEventsSession -SqlInstance ServerA\\sql987 | Format-Table ComputerName, SQLInstance, Session, Status \r\n-AutoSize\r\n\r\nReturns a formatted table displaying ComputerName, SQLInstance, Session, and Status.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e\u0027ServerA\\sql987\u0027,\u0027ServerB\u0027 | Get-DbaXEventsSession\r\n\r\nReturns a custom object with ComputerName, SQLInstance, Session, StartTime, Status and other properties, from multiple \r\nSQL Instances.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Import-DbaCsvToSql",
        "Description":  "Import-DbaCsvToSql takes advantage of .NET\u0027s super fast SqlBulkCopy class to import CSV files into SQL Server at up to 90,000 rows a second.\n\t\nThe entire import is contained within a transaction, so if a failure occurs or the script is aborted, no changes will persist.\n\nIf the table specified does not exist, it will be automatically created using best guessed data types. In addition, the destination table can be truncated prior to import. \n\nThe Query parameter will be used to import only the data returned from a SQL Query executed against the CSV file(s). This function supports a number of bulk copy options. Please see parameter list for details.\n\nTHIS CODE IS PROVIDED \"AS IS\", WITH NO WARRANTIES.",
        "Tags":  "Migration",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Efficiently imports very large (and small) CSV files into SQL Server using only the .NET Framework and PowerShell.",
        "Name":  "Import-DbaCsvToSql",
        "Links":  "https://blog.netnerds.net/2015/09/Import-DbaCsvtosql-super-fast-csv-to-sql-server-import-powershell-module/",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eImport-DbaCsvToSql -Csv C:\\temp\\housing.csv -SqlInstance sql001 -Database markets\r\n\r\nImports the entire *comma delimited* housing.csv to the SQL \"markets\" database on a SQL Server named sql001.\r\n\r\nSince a table name was not specified, the table name is automatically determined from filename as \"housing\" and a \r\nprompt will appear to confirm table name.\r\n\r\nThe first row is not skipped, as it does not contain column names.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eImport-DbaCsvToSql -Csv .\\housing.csv -SqlInstance sql001 -Database markets -Table housing -First 100000 -Safe \r\n-Delimiter \"`t\" -FirstRowColumns\r\n\r\nImports the first 100,000 rows of the tab delimited housing.csv file to the \"housing\" table in the \"markets\" database \r\non a SQL Server named sql001. Since Safe was specified, the OleDB method will be used for the bulk import. It\u0027s assumed \r\nSafe was used because the first attempt without -Safe resulted in an import error. The first row is skipped, as it \r\ncontains column names.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eImport-DbaCsvToSql -csv C:\\temp\\huge.txt -SqlInstance sqlcluster -Database locations -Table latitudes -Delimiter \r\n\"|\" -Turbo\r\n\r\nImports all records from the pipe delimited huge.txt file using the fastest method possible into the latitudes table \r\nwithin the locations database. Obtains a table lock for the duration of the bulk copy operation. This specific command \r\nhas been used \r\nto import over 10.5 million rows in 2 minutes.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eImport-DbaCsvToSql -Csv C:\\temp\\housing.csv, .\\housing2.csv -SqlInstance sql001 -Database markets -Table housing \r\n-Delimiter \"`t\" -query \"select top 100000 column1, column3 from csv\" -Truncate\r\n\r\nTruncates the \"housing\" table, then imports columns 1 and 3 of the first 100000 rows of the tab-delimited housing.csv \r\nin the C:\\temp directory, and housing2.csv in the current directory. Since the query is executed against both files, a \r\ntotal of 200,000 rows will be imported.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eImport-DbaCsvToSql -Csv C:\\temp\\housing.csv -SqlInstance sql001 -Database markets -Table housing -query \"select \r\naddress, zip from csv where state = \u0027Louisiana\u0027\" -FirstRowColumns -Truncate -FireTriggers\r\n\r\nUses the first line to determine CSV column names. Truncates the \"housing\" table on the SQL Server, then imports the \r\naddress and zip columns from all records in the housing.csv where the state equals Louisiana.\r\n\r\nTriggers are fired for all rows. Note that this does slightly slow down the import.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Import-DbaSpConfigure",
        "Description":  "Updates sp_configure settings on destination server.",
        "Synopsis":  "Updates sp_configure settings on destination server.",
        "Name":  "Import-DbaSpConfigure",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eImport-DbaSpConfigure sqlserver sqlcluster $SourceSqlCredential $DestinationSqlCredential\r\n\r\nImports the spconfigure settings from the source server sqlserver and sets them on the sqlcluster server\r\nusing the SQL credentials stored in the variables\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eImport-DbaSpConfigure -SqlInstance sqlserver -Path .\\spconfig.sql -SqlCredential $SqlCredential\r\n\r\nImports the spconfigure settings from the file .\\spconfig.sql and sets them on the sqlcluster server\r\nusing the SQL credential stored in the variables\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Install-DbaFirstResponderKit",
        "Description":  "Downloads, extracts and installs the First Responder Kit stored procedures: \nsp_Blitz, sp_BlitzWho, sp_BlitzFirst, sp_BlitzIndex, sp_BlitzCache and sp_BlitzTrace. \n\nFirst Responder Kit links:\nhttp://FirstResponderKit.org\nhttps://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit",
        "Synopsis":  "Installs or updates the First Responder Kit stored procedures.",
        "Name":  "Install-DbaFirstResponderKit",
        "Links":  "https://dbatools.io/Install-DbaFirstResponderKit",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaFirstResponderKit -SqlInstance server1 -Database master\r\n\r\nLogs into server1 with Windows authentication and then installs the FRK in the master database.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaFirstResponderKit -SqlInstance server1\\instance1 -Database DBA\r\n\r\nLogs into server1\\instance1 with Windows authentication and then installs the FRK in the DBA database.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaFirstResponderKit -SqlInstance server1\\instance1 -Database master -SqlCredential $cred\r\n\r\nLogs into server1\\instance1 with SQL authentication and then installs the FRK in the master database.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaFirstResponderKit -SqlInstance sql2016\\standardrtm, sql2016\\sqlexpress, sql2014\r\n\r\nLogs into sql2016\\standardrtm, sql2016\\sqlexpress and sql2014 with Windows authentication and then installs the FRK in \r\nthe master database.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e$servers = \"sql2016\\standardrtm\", \"sql2016\\sqlexpress\", \"sql2014\"\r\n\r\n$servers | Install-DbaFirstResponderKit\r\n\r\nLogs into sql2016\\standardrtm, sql2016\\sqlexpress and sql2014 with Windows authentication and then installs the FRK in \r\nthe master database.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Install-DbaMaintenanceSolution",
        "Description":  "This script will download and install the latest version of SQL Server Maintenance Solution created by Ola Hallengren",
        "Author":  "Viorel Ciucu, viorel.ciucu@gmail.com, cviorel.com",
        "Synopsis":  "Download and Install SQL Server Maintenance Solution created by Ola Hallengren (https://ola.hallengren.com)",
        "Name":  "Install-DbaMaintenanceSolution",
        "Links":  "http://dbatools.io/Install-DbaMaintenanceSolution",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaMaintenanceSolution -SqlInstance RES14224 -Database DBA -CleanupTime 72\r\n\r\nInstalls Ola Hallengren\u0027s Solution objects on RES14224 in the master database. \r\nBackups will default to the default Backup Directory. \r\nIf the Maintenance Solution already exists, the script will be halted.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaMaintenanceSolution -SqlInstance RES14224 -Database DBA -ReplaceExisting -CleanupTime 72 -LogToTable \r\n-Solution \"Backup\" -BackupLocation \"Z:\\SQLBackup\" -InstallJobs\r\n\r\n\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaMaintenanceSolution -SqlInstance RES14224 -Database DBA -BackupLocation \"Z:\\SQLBackup\" -CleanupTime 72\r\n\r\nThis will create the Ola Hallengren\u0027s Solution objects. Existing objects are not affected in any way.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaMaintenanceSolution -SqlInstance RES14224 -Database DBA -BackupLocation \"Z:\\SQLBackup\" -CleanupTime \r\n72 -ReplaceExisting\r\n\r\nThis will drop and then recreate the Ola Hallengren\u0027s Solution objects\r\nThe cleanup script will drop and recreate:\r\n - TABLE [dbo].[CommandLog]\r\n - STORED PROCEDURE [dbo].[CommandExecute]\r\n - STORED PROCEDURE [dbo].[DatabaseBackup]\r\n - STORED PROCEDURE [dbo].[DatabaseIntegrityCheck]\r\n - STORED PROCEDURE [dbo].[IndexOptimize]\r\n\r\nThe follwing SQL Agent jobs will be deleted:\r\n - \u0027Output File Cleanup\u0027\r\n - \u0027IndexOptimize - USER_DATABASES\u0027\r\n - \u0027sp_delete_backuphistory\u0027\r\n - \u0027DatabaseBackup - USER_DATABASES - LOG\u0027\r\n - \u0027DatabaseBackup - SYSTEM_DATABASES - FULL\u0027\r\n - \u0027DatabaseBackup - USER_DATABASES - FULL\u0027\r\n - \u0027sp_purge_jobhistory\u0027\r\n - \u0027DatabaseIntegrityCheck - SYSTEM_DATABASES\u0027\r\n - \u0027CommandLog Cleanup\u0027\r\n - \u0027DatabaseIntegrityCheck - USER_DATABASES\u0027\r\n - \u0027DatabaseBackup - USER_DATABASES - DIFF\u0027\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Install-DbaWatchUpdate",
        "Description":  "Adds the scheduled task to support Watch-DbaUpdate.",
        "Tags":  "JustForFun",
        "Synopsis":  "Adds the scheduled task to support Watch-DbaUpdate",
        "Name":  "Install-DbaWatchUpdate",
        "Links":  "https://dbatools.io/Install-DbaWatchUpdate",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaWatchUpdate\r\n\r\nAdds the scheduled task needed by Watch-DbaUpdate\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Install-DbaWhoIsActive",
        "Description":  "This command downloads, extracts and installs sp_WhoisActive with Adam\u0027s permission. To read more about sp_WhoisActive, please visit http://whoisactive.com and http://sqlblog.com/blogs/adam_machanic/archive/tags/who+is+active/default.aspx\n\nPlease consider donating to Adam if you find this stored procedure helpful: http://tinyurl.com/WhoIsActiveDonate\n\nNote that you will be prompted a bunch of times to confirm an action.",
        "Synopsis":  "Automatically installs or updates sp_WhoisActive by Adam Machanic.",
        "Name":  "Install-DbaWhoIsActive",
        "Links":  "https://dbatools.io/Install-DbaWhoIsActive",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaWhoIsActive -SqlInstance sqlserver2014a -Database master\r\n\r\nDownloads sp_WhoisActive from the internet and installs to sqlserver2014a\u0027s master database. Connects to SQL Server \r\nusing Windows Authentication.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaWhoIsActive -SqlInstance sqlserver2014a -SqlCredential $cred\r\n\r\nPops up a dialog box asking which database on sqlserver2014a you want to install the procedure into. Connects to SQL \r\nServer using SQL Authentication.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInstall-DbaWhoIsActive -SqlInstance sqlserver2014a -Database master -LocalFile \r\nc:\\SQLAdmin\\whoisactive_install.sql\r\n\r\nInstalls sp_WhoisActive to sqlserver2014a\u0027s master database from the local file whoisactive_install.sql\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$instances = Get-DbaRegisteredServerName sqlserver\r\n\r\nInstall-DbaWhoIsActive -SqlInstance $instances -Database master\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Invoke-DbaDatabaseShrink",
        "Description":  "Shrinks all files in a database. Databases should be shrunk only when completely necessary.\n\nMany awesome SQL people have written about why you should not shrink your data files. Paul Randal and Kalen Delaney wrote great posts about this topic:\n\n\thttp://www.sqlskills.com/blogs/paul/why-you-should-not-shrink-your-data-files\n\thttp://sqlmag.com/sql-server/shrinking-data-files\n\nHowever, there are some cases where a database will need to be shrunk. In the event that you must shrink your database:\n\n1. Ensure you have plenty of space for your T-Log to grow\n2. Understand that shrinks require a lot of CPU and disk resources\n3. Consider running DBCC INDEXDEFRAG or ALTER INDEX ... REORGANIZE after the shrink is complete.",
        "Tags":  [
                     "Shrink",
                     "Databases"
                 ],
        "Synopsis":  "Shrinks all files in a database. This is a command that should rarely be used.\n\n- Shrinks can cause severe index fragmentation (to the tune of 99%)\n- Shrinks can cause massive growth in the database\u0027s transaction log\n- Shrinks can require a lot of time and system resources to perform data movement",
        "Name":  "Invoke-DbaDatabaseShrink",
        "Links":  "https://dbatools.io/Invoke-DbaDatabaseShrink",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDatabaseShrink -SqlInstance sql2016 -Database Northwind,pubs,Adventureworks2014\r\n\r\nShrinks Northwind, pubs and Adventureworks2014 to have as little free space as possible.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDatabaseShrink -SqlInstance sql2014 -Database Adventureworks2014 -PercentFreeSpace 50\r\n\r\nShrinks Adventureworks2014 to have 50% free space. So let\u0027s say Adventureworks2014 was 1GB and it\u0027s using 100MB space. \r\nThe database free space would be reduced to 50MB.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDatabaseShrink -SqlInstance sql2012 -AllUserDatabases\r\n\r\nShrinks all databases on SQL2012 (not ideal for production)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Invoke-DbaDatabaseUpgrade",
        "Description":  "Updates compatibility level, then runs CHECKDB with data_purity, DBCC updateusage, sp_updatestats and finally sp_refreshview against all user views.",
        "Tags":  [
                     "Shrink",
                     "Databases"
                 ],
        "Author":  "Stephen Bennett, https://sqlnotesfromtheunderground.wordpress.com/",
        "Synopsis":  "Take a database and upgrades it to compatibility of the SQL Instance its hosted on. Based on https://thomaslarock.com/2014/06/upgrading-to-sql-server-2014-a-dozen-things-to-check/",
        "Name":  "Invoke-DbaDatabaseUpgrade",
        "Links":  "https://dbatools.io/Invoke-DbaDatabaseUpgrade",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDatabaseUpgrade -SqlInstance PRD-SQL-MSD01 -Database Test\r\n\r\nRuns the below processes against the databases\r\n-- Puts compatibility of database to level of SQL Instance\r\n-- Runs CHECKDB DATA_PURITY\r\n-- Runs DBCC UPDATESUSAGE\r\n-- Updates all users statistics\r\n-- Runs sp_refreshview against every view in the database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDatabaseUpgrade -SqlInstance PRD-SQL-INT01 -Database Test -NoRefreshView\r\n\r\nRuns the upgrade command skipping the sp_refreshview update on all views\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDatabaseUpgrade -SqlInstance PRD-SQL-INT01 -Database Test -Force\r\n\r\nIf database Test is already at the correct compatibility, runs every necessary step\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance sql2016 | Out-GridView -Passthru | Invoke-DbaDatabaseUpgrade\r\n\r\nGet only specific databases using GridView and pass those to Invoke-DbaDatabaseUpgrade\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Invoke-DbaDiagnosticQuery",
        "Description":  "This is the main function of the Sql Server Diagnostic Queries related functions in dbatools. \nThe diagnostic queries are developed and maintained by Glenn Berry and they can be found here along with a lot of documentation:\nhttp://www.sqlskills.com/blogs/glenn/category/dmv-queries/\n\nThe most recent version of the diagnostic queries are included in the dbatools module. \nBut it is possible to download a newer set or a specific version to an alternative location and parse and run those scripts.\nIt will run all or a selection of those scripts on one or multiple servers and return the result as a PowerShell Object",
        "Tags":  [
                     "Database",
                     "DMV"
                 ],
        "Author":  "André Kamman (@AndreKamman), http://clouddba.io",
        "Synopsis":  "Invoke-DbaDiagnosticQuery runs the scripts provided by Glenn Berry\u0027s DMV scripts on specified servers",
        "Name":  "Invoke-DbaDiagnosticQuery",
        "Links":  "https://dbatools.io/Invoke-DbaDiagnosticQuery",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDiagnosticQuery -SqlInstance sql2016\r\n\r\nRun the selection made by the user on the Sql Server instance specified.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaDiagnosticQuery -SqlInstance sql2016 -UseSelectionHelper | Export-DbaDiagnosticQuery -Path \r\nC:\\temp\\gboutput\r\n\r\nProvides a gridview with all the queries to choose from and will run the selection made by the user on the SQL Server \r\ninstance specified. \r\n\t\r\nThen it will export the results to Export-DbaDiagnosticQuery.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Invoke-DbaLogShipping",
        "Description":  "Invoke-DbaLogShipping helps to easily set up log shipping for one or more databases.\n\nThis function will make a lot of decisions for you assuming you want default values like a daily interval for the schedules with a 15 minute interval on the day.\nThere are some settings that cannot be made by the function and they need to be prepared before the function is executed.\n\nThe following settings need to be made before log shipping can be initiated:\n- Backup destination (the folder and the privileges)\n- Copy destination (the folder and the privileges)\n\n* Privileges\nMake sure your agent service on both the primary and the secondary instance is an Active Directory account.\nAlso have the credentials ready to set the folder permissions\n\n** Network share\nThe backup destination needs to be shared and have the share privileges of FULL CONTROL to Everyone.\n\n** NTFS permissions\nThe backup destination must have at least read/write permissions for the primary instance agent account. \nThe backup destination must have at least read permissions for the secondary instance agent account.\nThe copy destination must have at least read/write permission for the secondary instance agent acount.",
        "Tags":  [
                     "Log shippin",
                     "disaster recovery"
                 ],
        "Synopsis":  "Invoke-DbaLogShipping sets up log shipping for one or more databases",
        "Name":  "Invoke-DbaLogShipping",
        "Links":  "https://dbatools.io/Invoke-DbaLogShipping",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaLogShipping -SourceSqlInstance sql1 -DestinationSqlInstance sql2 -Database db1 -BackupNetworkPath \r\n\\\\sql1\\logshipping -BackupLocalPath D:\\Data\\logshipping -BackupScheduleFrequencyType daily \r\n-BackupScheduleFrequencyInterval 1 -CompressBackup -CopyScheduleFrequencyType daily -CopyScheduleFrequencyInterval 1 \r\n-GenerateFullBackup -RestoreScheduleFrequencyType daily -RestoreScheduleFrequencyInterval 1 -SecondaryDatabaseSuffix DR \r\n-CopyDestinationFolder \\\\sql2\\logshippingdest -Force\r\n\r\nSets up log shiping for database \"db1\" with the backup path to a network share allowing local backups. \r\nIt creates daily schedules for the backup, copy and restore job with all the defaults to be executed every 15 minutes \r\ndaily.\r\nThe secondary databse will be called \"db1_LS\".\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaLogShipping -SourceSqlInstance sql1 -DestinationSqlInstance sql2 -Database db1 -BackupNetworkPath \r\n\\\\sql1\\logshipping -GenerateFullBackup -Force\r\n\r\nSets up log shipping with all defaults except that a backup file is generated.\r\nThe script will show a message that the copy destination has not been supplied and asks if you want to use the default \r\nwhich would be the backup directory of the secondary server with the folder \"logshipping\" i.e. \r\n\"D:\\SQLBackup\\Logshiping\".\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Invoke-DbaLogShippingRecovery",
        "Description":  "By default all the databases for a particular instance are recovered.\nIf the database is in the right state, either standby or recovering, the process will try to recover the database.\n\nAt first the function will check if the backup source directory can still be reached.\nIf so it will look up the last transaction log backup for the database. If that backup file is not the last copied file the log shipping copy job will be started.\nIf the directory cannot be reached for the function will continue to the restoring process.\nAfter the copy job check is performed the job is disabled to prevent the job to run.\n\nFor the restore the log shipping status is checked in the msdb database.\nIf the last restored file is not the same as the last file name found, the log shipping restore job will be executed.\nAfter the restore job check is performed the job is disabled to prevent the job to run\n\nThe last part is to set the databse online by restoring the databases with recovery",
        "Author":  "Sander Stad (@sqlstad), sqlstad.nl",
        "Synopsis":  "Invoke-DbaLogShippingRecovery recovers log shipped databases to a normal state to act upon a migration or disaster.",
        "Name":  "Invoke-DbaLogShippingRecovery",
        "Links":  "https://dbatools.io/Invoke-DbaLogShippingRecovery",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaLogShippingRecovery -SqlServer server1\r\n\r\nRecovers all the databases on the instance that are enabled for log shiping\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaLogShippingRecovery -SqlServer server1 -SqlCredential $cred -Verbose\r\n\r\nRecovers all the databases on the instance that are enabled for log shiping using a credential\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaLogShippingRecovery -SqlServer server1 -database db_logship -Verbose\r\n\r\nRecovers the database \"db_logship\" to a normal status\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003edb1, db2, db3, db4 | Invoke-DbaLogShippingRecovery -SqlServer server1 -Verbose\r\n\r\nRecovers the database db1, db2, db3, db4 to a normal status\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaLogShippingRecovery -SqlServer server1 -WhatIf\r\n\r\nShows what would happen if the command were executed.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Invoke-DbaWhoisActive",
        "Description":  "Output results of Adam Machanic\u0027s sp_WhoIsActive\n\nThis command was built with Adam\u0027s permission. To read more about sp_WhoIsActive, please visit:\n\nUpdates: http://sqlblog.com/blogs/adam_machanic/archive/tags/who+is+active/default.aspx\n\nAlso, consider donating to Adam if you find this stored procedure helpful: http://tinyurl.com/WhoIsActiveDonate",
        "Tags":  "Memory",
        "Synopsis":  "Outputs results of Adam Machanic\u0027s sp_WhoIsActive DataTable",
        "Name":  "Invoke-DbaWhoisActive",
        "Links":  "https://dbatools.io/Invoke-DbaWhoisActive",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaWhoisActive -SqlInstance sqlserver2014a\r\n\r\nExecute sp_whoisactive on sqlserver2014a. This command expects sp_WhoIsActive to be in the master database. Logs into \r\nthe SQL Server with Windows credentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaWhoisActive -SqlInstance sqlserver2014a -SqlCredential $credential -Database dbatools\r\n\r\nExecute sp_whoisactive on sqlserver2014a. This command expects sp_WhoIsActive to be in the dbatools database. Logs into \r\nthe SQL Server with SQL Authentication.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaWhoisActive -SqlInstance sqlserver2014a -GetAverageTime\r\n\r\nSimilar to running sp_WhoIsActive @get_avg_time\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eInvoke-DbaWhoisActive -SqlInstance sqlserver2014a -GetOuterCommand -FindBlockLeaders\r\n\r\nSimilar to running sp_WhoIsActive @get_outer_command = 1, @find_block_leaders = 1\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Invoke-Sqlcmd2",
        "Description":  "Runs a T-SQL script. Invoke-Sqlcmd2 runs the whole scipt and only captures the first selected result set, such as the output of PRINT statements when -verbose parameter is specified.\nParamaterized queries are supported.\n\nHelp details below borrowed from Invoke-Sqlcmd",
        "Synopsis":  "Runs a T-SQL script.",
        "Name":  "Invoke-Sqlcmd2",
        "Links":  [
                      "https://github.com/sqlcollaborative/Invoke-SqlCmd2",
                      "https://github.com/RamblingCookieMonster/PowerShell",
                      null
                  ],
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eInvoke-Sqlcmd2 -ServerInstance \"MyComputer\\MyInstance\" -Query \"SELECT login_time AS \u0027StartTime\u0027 FROM \r\nsysprocesses WHERE spid = 1\"\r\n\r\nThis example connects to a named instance of the Database Engine on a computer and runs a basic T-SQL query.\r\nStartTime\r\n-----------\r\n2010-08-12 21:21:03.593\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eInvoke-Sqlcmd2 -ServerInstance \"MyComputer\\MyInstance\" -InputFile \"C:\\MyFolder\\tsqlscript.sql\" | Out-File \r\n-filePath \"C:\\MyFolder\\tsqlscript.rpt\"\r\n\r\nThis example reads a file containing T-SQL statements, runs the file, and writes the output to another file.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eInvoke-Sqlcmd2 -ServerInstance \"MyComputer\\MyInstance\" -Query \"PRINT \u0027hello world\u0027\" -Verbose\r\n\r\nThis example uses the PowerShell -Verbose parameter to return the message output of the PRINT command.\r\nVERBOSE: hello world\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eInvoke-Sqlcmd2 -ServerInstance MyServer\\MyInstance -Query \"SELECT ServerName, VCNumCPU FROM tblServerInfo\" -as \r\nPSObject | ?{$_.VCNumCPU -gt 8}\r\n\r\nInvoke-Sqlcmd2 -ServerInstance MyServer\\MyInstance -Query \"SELECT ServerName, VCNumCPU FROM tblServerInfo\" -as PSObject \r\n| ?{$_.VCNumCPU}\r\n\r\nThis example uses the PSObject output type to allow more flexibility when working with results.\r\n\r\nIf we used DataRow rather than PSObject, we would see the following behavior:\r\n Each row where VCNumCPU does not exist would produce an error in the first example\r\n Results would include rows where VCNumCPU has DBNull value in the second example\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e\u0027Instance1\u0027, \u0027Server1/Instance1\u0027, \u0027Server2\u0027 | Invoke-Sqlcmd2 -query \"Sp_databases\" -as psobject \r\n-AppendServerInstance\r\n\r\nThis example lists databases for each instance. It includes a column for the ServerInstance in question.\r\n DATABASE_NAME DATABASE_SIZE REMARKS ServerInstance\r\n ------------- ------------- ------- --------------\r\n REDACTED 88320 Instance1\r\n master 17920 Instance1\r\n ...\r\n msdb 618112 Server1/Instance1\r\n tempdb 563200 Server1/Instance1\r\n ...\r\n OperationsManager 20480000 Server2\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003e#Construct a query using SQL parameters\r\n\r\n$Query = \"SELECT ServerName, VCServerClass, VCServerContact FROM tblServerInfo WHERE VCServerContact LIKE \r\n@VCServerContact AND VCServerClass LIKE @VCServerClass\"\r\n\r\n#Run the query, specifying values for SQL parameters\r\n Invoke-Sqlcmd2 -ServerInstance SomeServer\\NamedInstance -Database ServerDB -query $query -SqlParameters @{ \r\nVCServerContact=\"%cookiemonster%\"; VCServerClass=\"Prod\" }\r\n\r\n ServerName VCServerClass VCServerContact\r\n ---------- ------------- ---------------\r\n SomeServer1 Prod cookiemonster, blah\r\n SomeServer2 Prod cookiemonster\r\n SomeServer3 Prod blah, cookiemonster\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eInvoke-Sqlcmd2 -SQLConnection $Conn -Query \"SELECT login_time AS \u0027StartTime\u0027 FROM sysprocesses WHERE spid = 1\"\r\n\r\nThis example uses an existing SQLConnection and runs a basic T-SQL query against it\r\n\r\nStartTime\r\n-----------\r\n2010-08-12 21:21:03.593\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Measure-DbaBackupThroughput",
        "Description":  "Returns backup history details for one or more databases on a SQL Server. \n\nOutput looks like this:\nSqlInstance : sql2016\nDatabase : SharePoint_Config\nAvgThroughputMB : 1.07\nAvgSizeMB : 24.17\nAvgDuration : 00:00:01.1000000\nMinThroughputMB : 0.02\nMaxThroughputMB : 2.26\nMinBackupDate : 8/6/2015 10:22:01 PM\nMaxBackupDate : 6/19/2016 12:57:45 PM\nBackupCount : 10",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup",
                     "Databases"
                 ],
        "Synopsis":  "Determines how quickly SQL Server is backing up databases to media.",
        "Name":  "Measure-DbaBackupThroughput",
        "Links":  "https://dbatools.io/Measure-DbaBackupThroughput",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eMeasure-DbaBackupThroughput -SqlInstance sql2016\r\n\r\nParses every backup in msdb\u0027s backuphistory for stats on all databases.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eMeasure-DbaBackupThroughput -SqlInstance sql2016 -Database AdventureWorks2014\r\n\r\nParses every backup in msdb\u0027s backuphistory for stats on AdventureWorks2014.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eMeasure-DbaBackupThroughput -SqlInstance sql2005 -Last\r\n\r\nProcesses the last full, diff and log backups every backup for all databases on sql2005.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eMeasure-DbaBackupThroughput -SqlInstance sql2005 -Last -Type Log\r\n\r\nProcesses the last log backups every backup for all databases on sql2005.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eMeasure-DbaBackupThroughput -SqlInstance sql2016 -Since (Get-Date).AddDays(-7)\r\n\r\nGets backup calculations for the last week.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eMeasure-DbaBackupThroughput -SqlInstance sql2016 -Since (Get-Date).AddDays(-365) -Database bigoldb\r\n\r\nGets backup calculations, limited to the last year and only the bigoldb database\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Mount-DbaDatabase",
        "Description":  "This command will attach a SQL Server database.",
        "Tags":  "Database",
        "Synopsis":  "Attach a SQL Server Database - aliased to Attach-DbaDatabase",
        "Name":  "Mount-DbaDatabase",
        "Links":  "https://dbatools.io/Mount-DbaDatabase",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003e$fileStructure = New-Object System.Collections.Specialized.StringCollection\r\n\r\n$fileStructure.Add(\"E:\\archive\\example.mdf\")\r\n$filestructure.Add(\"E:\\archive\\example.ldf\")\r\n$filestructure.Add(\"E:\\archive\\example.ndf\")\r\nMount-DbaDatabase -SqlInstance sql2016 -Database example -FileStructure $fileStructure\r\n\r\nAttaches a database named \"example\" to sql2016 with the files \"E:\\archive\\example.mdf\", \"E:\\archive\\example.ldf\" and \r\n\"E:\\archive\\example.ndf\". The database owner will be set to sa and the attach option is None.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eMount-DbaDatabase -SqlInstance sql2016 -Database example\r\n\r\nSince the FileStructure was not provided, this command will attempt to determine it based on backup history. If found, \r\na database named example will be attached to sql2016.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eMount-DbaDatabase -SqlInstance sql2016 -Database example -WhatIf\r\n\r\nShows what would happen if the command were executed (without actually performing the command)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaAgentJob",
        "Description":  "New-DbaAgentJob makes it possible to create a job in the SQL Server Agent.\nIt returns an array of the job(s) created",
        "Tags":  [
                     "Agent",
                     "Job",
                     "Job Step"
                 ],
        "Synopsis":  "New-DbaAgentJob creates a new job",
        "Name":  "New-DbaAgentJob",
        "Links":  "https://dbatools.io/New-DbaAgentJob",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJob -SqlInstance sql1 -Job \u0027Job One\u0027 -Description \u0027Just another job\u0027\r\n\r\nCreates a job with the name \"Job1\" and a small description.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJob -SqlInstance sql1 -Job \u0027Job One\u0027 -Disabled\r\n\r\nCreates the job but sets it to disabled.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJob -SqlInstance sql1 -Job \u0027Job One\u0027 -EventLogLevel OnSuccess\r\n\r\nCreates the job and sets the notification to write to the Windows Application event log on success.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJob -SqlInstance SSTAD-PC -Job \u0027Job One\u0027 -EmailLevel OnFailure -EmailOperator dba\r\n\r\nCreates the job and sets the notification to send an e-mail to the e-mail operator.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJob -SqlInstance sql1 -Job \u0027Job One\u0027 -Description \u0027Just another job\u0027 -Whatif\r\n\r\nDoesn\u0027t create the job but shows what would happen.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJob -SqlInstance sql1, sql2, sql3 -Job \u0027Job One\u0027\r\n\r\nCreates a job with the name \"Job One\" on multiple servers.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003e\"sql1\", \"sql2\", \"sql3\" | New-DbaAgentJob -Job \u0027Job One\u0027\r\n\r\nCreates a job with the name \"Job One\" on multiple servers using the pipe line.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaAgentJobStep",
        "Description":  "New-DbaAgentJobStep creates a new job in the SQL Server Agent for a specific job",
        "Tags":  [
                     "Agent",
                     "Job",
                     "Job Step"
                 ],
        "Synopsis":  "New-DbaAgentJobStep creates a new job step for a job",
        "Name":  "New-DbaAgentJobStep",
        "Links":  "https://dbatools.io/New-DbaAgentJobStep",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJobStep -SqlInstance sql1 -Job Job1 -StepName Step1\r\n\r\nCreate a step in \"Job1\" with the name Step1 with the default subsystem TransactSql.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJobStep -SqlInstance sql1 -Job Job1 -StepName Step1 -Database msdb\r\n\r\nCreate a step in \"Job1\" with the name Step1 where the database will the msdb\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJobStep -SqlInstance sql1, sql2, sql3 -Job Job1 -StepName Step1 -Database msdb\r\n\r\nCreate a step in \"Job1\" with the name Step1 where the database will the \"msdb\" for multiple servers\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentJobStep -SqlInstance sql1, sql2, sql3 -Job Job1, Job2, \u0027Job Three\u0027 -StepName Step1 -Database msdb\r\n\r\nCreate a step in \"Job1\" with the name Step1 where the database will the \"msdb\" for multiple servers for multiple jobs\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | New-DbaAgentJobStep -Job Job1 -StepName Step1 -Database msdb\r\n\r\nCreate a step in \"Job1\" with the name Step1 where the database will the \"msdb\" for multiple servers using pipeline\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaAgentSchedule",
        "Description":  "New-DbaAgentSchedule will help create a new schedule for a job.\nIf the job parameter is not supplied the schedule will not be attached to a job.",
        "Tags":  [
                     "Agent",
                     "Job",
                     "Job Step"
                 ],
        "Synopsis":  "New-DbaAgentSchedule creates a new schedule in the msdb database.",
        "Name":  "New-DbaAgentSchedule",
        "Links":  "https://dbatools.io/New-DbaAgentSchedule",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentSchedule -SqlInstance sql1 -Job Job1 -Schedule daily -FrequencyType Daily -FrequencyInterval 1 -Force\r\n\r\nCreates a schedule for the job with a daily frequency every day. It also assumes default values for the start date, \r\nstart time, end date and end time.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentSchedule -SqlInstance sql1 -Job Job1, Job2, Job3 -Schedule weekly -FrequencyType Weekly \r\n-FrequencyInterval Monday, Wednesday, Friday -Force\r\n\r\nCreates a schedule for the job with a daily frequency every day. It also assumes default values for the start date, \r\nstart time, end date and end time.\r\nThe force will remove any existing schedules that have the same name\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentSchedule -SqlInstance sql1 -Job Job1 -Schedule daily -StartDate 20170530 -StartTime 110000 -EndTime \r\n150000 -FrequencyType Daily -FrequencyInterval 1\r\n\r\nCreate a daily schedule that starts on the May 30th on 11 AM and ends on 3 PM.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | New-DbaAgentSchedule -Job Job1 -Schedule daily -FrequencyType Daily -FrequencyInterval 1\r\n\r\nCreates a schedule for the job with a daily frequency every day on multiple servers\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | New-DbaAgentSchedule -Job Job1, Job2, Job3 -Schedule daily -FrequencyType Daily \r\n-FrequencyInterval 1\r\n\r\nCreates a schedule for the job with a daily frequency every day on multiple servers for multiple jobs using pipe line\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaAgentSchedule -SqlInstance sql1 -Schedule daily -FrequencyType Daily -FrequencyInterval 1 -Force\r\n\r\nCreates a schedule that\u0027s not connected to a job\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaCmConnection",
        "Description":  "Generates a connection object for use in remote computer management.\nThose objects are used for the purpose of cim/wmi queries, caching which protocol worked, optimizing performance and minimizing authentication errors.\n\nNew-DbaCmConnection will create a NEW object and overwrite any existing ones for the specified computer.\nFurthermore, information stored in the input beyond the computername will be discarded in favor of the new settings.\n\nUnless the connection cache has been disabled, all connections will automatically be registered in the cache, so no further action is necessary.\nThe output is primarily for information purposes, however it may be used to pass objects and circumvent the cache with those.\n\nNOTE: Generally, this function need not be used, as a first connection to a computer using any connecting function such as \"Get-DbaCmObject\" will automatically register a new default connection for it.\n\nThis function exists to be able to preconfigure connections.",
        "Tags":  "ComputerManagement",
        "Synopsis":  "Generates a connection object for use in remote computer management.",
        "Name":  "New-DbaCmConnection",
        "Links":  "https://dbatools.io/New-DbaCmConnection",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaCmConnection -ComputerName sql2014 -UseWindowsCredentials -OverrideExplicitCredential \r\n-DisabledConnectionTypes CimRM\r\n\r\nReturns a new configuration object for connecting to the computer sql2014.\r\n- The current user credentials are set as valid\r\n- The connection is configured to ignore explicit credentials (so all connections use the windows credentials)\r\n- The connections will not try using CIM over WinRM\r\n\r\nUnless caching is globally disabled, this is automatically stored in the connection cache and will be applied \r\nautomatically.\r\nIn that (the default) case, the output is for information purposes only and need not be used.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-Content computers.txt | New-DbaCmConnection -Credential $cred -CimWinRMOptions $options \r\n-DisableBadCredentialCache -OverrideExplicitCredential\r\n\r\nGathers a list of computers from a text file, then creates and registers connections for each of them, setting them to \r\n...\r\n- use the credentials stored in $cred\r\n- use the opzions stored in $options when connecting using CIM over WinRM\r\n- not store credentials that are known to not work\r\n- to ignore explicitly specified credentials\r\n\r\nEssentially, this configures all connections to those computers to prefer failure with the specified credentials over \r\nusing alternative credentials.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaComputerCertificate",
        "Description":  "Creates a new computer certificate - self-signed or signed by an Active Directory CA, using the Web Server certificate.\n\nBy default, a key with a length of 1024 and a friendly name of the machines FQDN is generated.\n\nThis command was originally intended to help automate the process so that SSL certificates can be available for enforcing encryption on connections.\n\nIt makes a lot of assumptions - namely, that your account is allowed to auto-enroll and that you have permission to do everything it needs to do ;)\n\nReferences:\nhttp://sqlmag.com/sql-server/7-steps-ssl-encryption\nhttps://azurebi.jppp.org/2016/01/23/using-lets-encrypt-certificates-for-secure-sql-server-connections/\nhttps://blogs.msdn.microsoft.com/sqlserverfaq/2016/09/26/creating-and-registering-ssl-certificates/\n\nThe certificate is generated using AD\u0027s webserver SSL template on the client machine and pushed to the remote machine.",
        "Tags":  "Certificate",
        "Synopsis":  "Creates a new computer certificate useful for Forcing Encryption",
        "Name":  "New-DbaComputerCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaComputerCertificate\r\n\r\nCreates a computer certificate signed by the local domain CA for the local machine with the keylength of 1024.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaComputerCertificate -ComputerName Server1\r\n\r\nCreates a computer certificate signed by the local domain CA _on the local machine_ for server1 with the keylength of \r\n1024.\r\n\r\nThe certificate is then copied to the new machine over WinRM and imported.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaComputerCertificate -ComputerName sqla, sqlb -ClusterInstanceName sqlcluster -KeyLength 4096\r\n\r\nCreates a computer certificate for sqlcluster, signed by the local domain CA, with the keylength of 4096.\r\n\r\nThe certificate is then copied to sqla _and_ sqlb over WinRM and imported.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaComputerCertificate -ComputerName Server1 -WhatIf\r\n\r\nShows what would happen if the command were run\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaComputerCertificate -SelfSigned\r\n\r\nCreates a self-signed certificate\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaCredential",
        "Description":  "Creates a new credential",
        "Tags":  "Certificate",
        "Synopsis":  "Creates a new SQL Server credential",
        "Name":  "New-DbaCredential",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaCredential -SqlInstance Server1\r\n\r\nYou will be prompted to securely enter your password, then a credential will be created in the master database on \r\nserver1 if it does not exist.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaCredential -SqlInstance Server1 -Database db1 -Confirm:$false\r\n\r\nSuppresses all prompts to install but prompts to securely enter your password and creates a credential in the \u0027db1\u0027 \r\ndatabase\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaDatabaseCertificate",
        "Description":  "Creates a new database certificate. If no database is specified, the certificate will be created in master.",
        "Tags":  "Certificate",
        "Synopsis":  "Creates a new database certificate",
        "Name":  "New-DbaDatabaseCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseCertificate -SqlInstance Server1\r\n\r\nYou will be prompted to securely enter your password, then a certificate will be created in the master database on \r\nserver1 if it does not exist.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseCertificate -SqlInstance Server1 -Database db1 -Confirm:$false\r\n\r\nSuppresses all prompts to install but prompts to securely enter your password and creates a certificate in the \u0027db1\u0027 \r\ndatabase\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaDatabaseMasterKey",
        "Description":  "Creates a new database master key. If no database is specified, the master key will be created in master.",
        "Tags":  "Certificate",
        "Synopsis":  "Creates a new database master key",
        "Name":  "New-DbaDatabaseMasterKey",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseMasterKey -SqlInstance Server1\r\n\r\nYou will be prompted to securely enter your password, then a master key will be created in the master database on \r\nserver1 if it does not exist.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseMasterKey -SqlInstance Server1 -Database db1 -Confirm:$false\r\n\r\nSuppresses all prompts to install but prompts to securely enter your password and creates a master key in the \u0027db1\u0027 \r\ndatabase\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaDatabaseSnapshot",
        "Description":  "Creates database snapshots without hassles",
        "Tags":  [
                     "DisasterRecovery",
                     "Snapshot",
                     "Restore",
                     "Databases"
                 ],
        "Author":  "niphlod",
        "Synopsis":  "Creates database snapshots",
        "Name":  "New-DbaDatabaseSnapshot",
        "Links":  "https://dbatools.io/New-DbaDatabaseSnapshot",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Database HR, Accounting\r\n\r\nCreates snapshot for HR and Accounting, returning a custom object displaying Server, Database, DatabaseCreated, \r\nSnapshotOf, SizeMB, DatabaseCreated, PrimaryFilePath, Status, Notes\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Database HR -Name HR_snap\r\n\r\nCreates snapshot named \"HR_snap\" for HR\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Database HR -NameSuffix \u0027fool_{0}_snap\u0027\r\n\r\nCreates snapshot named \"fool_HR_snap\" for HR\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Database HR, Accounting -Path F:\\snapshotpath\r\n\r\nCreates snapshots for HR and Accounting databases, storing files under the F:\\snapshotpath\\ dir\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaScriptingOption",
        "Description":  "Creates a new Microsoft.SqlServer.Management.Smo.ScriptingOptions object. Basically saves you the time from remembering the SMO assembly name ;)\n\nSee https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions.aspx for more information",
        "Tags":  [
                     "Migration",
                     "Backup",
                     "DR"
                 ],
        "Synopsis":  "Creates a new Microsoft.SqlServer.Management.Smo.ScriptingOptions object",
        "Name":  "New-DbaScriptingOption",
        "Links":  "https://dbatools.io/New-DbaScriptingOption\nhttps://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions.aspx",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003e$options = New-DbaScriptingOption\r\n\r\n$options.ScriptDrops = $false\r\n$options.WithDependencies = $true\r\nGet-DbaAgentJob -SqlInstance sql2016 | Export-DbaScript -ScriptingOptionObject $options\r\n\r\nExports Agent Jobs with the Scripting Options ScriptDrops set to $false and WithDependencies set to true\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaServiceMasterKey",
        "Description":  "Creates a new service master key in the master database",
        "Tags":  "Certificate",
        "Synopsis":  "Creates a new service master key",
        "Name":  "New-DbaServiceMasterKey",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaServiceMasterKey -SqlInstance Server1\r\n\r\nYou will be prompted to securely enter your Service Key Password twice, then a master key will be created in the master \r\ndatabase on server1 if it does not exist.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaSqlConnectionString",
        "Description":  "Builds or extracts a SQL Server Connection String\n\t\nSee https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx\nand https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx\nand https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx",
        "Synopsis":  "Builds or extracts a SQL Server Connection String",
        "Name":  "New-DbaSqlConnectionString",
        "Links":  "https://dbatools.io/New-DbaSqlConnectionString",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaSqlConnectionString -SqlInstance sql2014\r\n\r\nCreates a connection string that connects using Windows Authentication\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eConnect-DbaSqlServer -SqlInstance sql2016 | New-DbaSqlConnectionString\r\n\r\nBuilds a connected SMO object using Connect-DbaSqlServer then extracts and displays the connection string\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$wincred = Get-Credential ad\\sqladmin\r\n\r\nNew-DbaSqlConnectionString -SqlInstance sql2014 -Credential $wincred\r\n\r\nCreates a connection string that connects using alternative Windows credentials\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$sqlcred = Get-Credential sqladmin\r\n\r\n$server = New-DbaSqlConnectionString -SqlInstance sql2014 -Credential $sqlcred\r\n\r\nLogin to sql2014 as SQL login sqladmin.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003e$server = New-DbaSqlConnectionString -SqlInstance sql2014 -ClientName \"mah connection\"\r\n\r\nCreates a connection string that connects using Windows Authentication and uses the client name \"mah connection\". So \r\nwhen you open up profiler or use extended events, you can search for \"mah connection\".\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003e$server = New-DbaSqlConnectionString -SqlInstance sql2014 -AppendConnectionString \"Packet \r\nSize=4096;AttachDbFilename=C:\\MyFolder\\MyDataFile.mdf;User Instance=true;\"\r\n\r\nCreates a connection string that connects to sql2014 using Windows Authentication, then it sets the packet size (this \r\ncan also be done via -PacketSize) and other connection attributes.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003e$server = New-DbaSqlConnectionString -SqlInstance sql2014 -NetworkProtocol TcpIp -MultiSubnetFailover\r\n\r\nCreates a connection string with Windows Authentication that uses TCPIP and has MultiSubnetFailover enabled.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003e$connstring = New-DbaSqlConnectionString sql2016 -ApplicationIntent ReadOnly\r\n\r\nCreates a connection string with ReadOnly ApplicantionIntent.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaSqlConnectionStringBuilder",
        "Description":  "Creates a System.Data.SqlClient.SqlConnectionStringBuilder from a connection string.",
        "Tags":  "SqlBuild",
        "Author":  "zippy1981",
        "Synopsis":  "Returns a System.Data.SqlClient.SqlConnectionStringBuilder with the string specified",
        "Name":  "New-DbaSqlConnectionStringBuilder",
        "Links":  "https://dbatools.io/New-DbaSqlConnectionStringBuilder",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaSqlConnectionStringBuilder\r\n\r\nReturns an empty ConnectionStringBuilder\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\"Data Source=localhost,1433;Initial Catalog=AlwaysEncryptedSample;UID=sa;PWD=alwaysB3Encrypt1ng;Application \r\nName=Always Encrypted Sample MVC App;Column Encryption Setting=enabled\" | New-DbaSqlConnectionStringBuilder\r\n\r\nReturns a connection string builder that can be used to connect to the local sql server instance on the default port.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaSqlDirectory",
        "Description":  "Uses master.dbo.xp_create_subdir to create the path\nReturns $true if the path can be created, $false otherwise",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "Creates new path as specified by the path variable",
        "Name":  "New-DbaSqlDirectory",
        "Links":  "https://dbatools.io/New-DbaSqlDirectory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaSqlDirectory -SqlInstance sqlcluster -Path L:\\MSAS12.MSSQLSERVER\\OLAP\r\n\r\nIf the SQL Server instance sqlcluster can create the path L:\\MSAS12.MSSQLSERVER\\OLAP it will do and return $true, if \r\nnot it will return $false.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$credential = Get-Credential\r\n\r\nNew-DbaSqlDirectory -SqlInstance sqlcluster -SqlCredential $credential -Path L:\\MSAS12.MSSQLSERVER\\OLAP\r\n\r\nIf the SQL Server instance sqlcluster can create the path L:\\MSAS12.MSSQLSERVER\\OLAP it will do and return $true, if \r\nnot it will return $false. Uses a SqlCredential to connect\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbaSsisCatalog",
        "Description":  "After installing the SQL Server Engine and SSIS you still have to enable the SSIS Catalog. This function will enable the catalog and gives the option of supplying the password.",
        "Author":  "Stephen Bennett, https://sqlnotesfromtheunderground.wordpress.com/",
        "Synopsis":  "Enables the SSIS Catalog on a SQL Server 2012+",
        "Name":  "New-DbaSsisCatalog",
        "Links":  "https://dbatools.io/New-DbaSsisCatalog",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003e$password = ConvertTo-SecureString MyVisiblePassWord -AsPlainText -Force\r\n\r\nNew-DbaSsisCatalog -SqlInstance sql2016 -Password $password\r\n\r\nCreates the SSIS Catalog on server DEV01 with the specified password.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$password = Read-Host -AsSecureString -Prompt \"Enter password\"\r\n\r\nNew-DbaSsisCatalog -SqlInstance DEV01 -Password $password\r\n\r\nCreates the SSIS Catalog on server DEV01 with the specified password.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "New-DbatoolsSupportPackage",
        "Description":  "This function creates an extensive debugging package that can help with reproducing and fixing issues.\n\nThe file will be created on the desktop by default and will contain quite a bit of information:\n - OS Information\n - Hardware Information (CPU, Ram, things like that)\n - .NET Information\n - PowerShell Information\n - Your input history\n - The In-Memory message log\n - The In-Memory error log\n - Screenshot of the console buffer (Basically, everything written in your current console, even if you have to scroll upwards to see it.",
        "Tags":  "Debug",
        "Synopsis":  "Creates a package of troubleshooting information that can be used by dbatools to help debug issues.",
        "Name":  "New-DbatoolsSupportPackage",
        "Links":  "https://dbatools.io/New-DbatoolsSupportPackage",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbatoolsSupportPackage\r\n\r\nCreates a large support pack in order to help us troubleshoot stuff.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Out-DbaDataTable",
        "Description":  "Creates a DataTable based on an objects properties. This allows you to easily write to SQL Server tables.\n\nThanks to Chad Miller, this is based on his script. https://gallery.technet.microsoft.com/scriptcenter/4208a159-a52e-4b99-83d4-8048468d29dd",
        "Synopsis":  "Creates a DataTable for an object",
        "Name":  "Out-DbaDataTable",
        "Links":  "https://dbatools.io/Out-DbaDataTable",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-Service | Out-DbaDataTable\r\n\r\nCreates a $datatable based off of the output of Get-Service\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eOut-DbaDataTable -InputObject $csv.cheesetypes\r\n\r\nCreates a DataTable from the CSV object, $csv.cheesetypes\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$dblist | Out-DbaDataTable\r\n\r\nSimilar to above but $dbalist gets piped in\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-Process | Out-DbaDataTable -TimeSpanType TotalSeconds\r\n\r\nCreates a DataTable with the running processes and converts any TimeSpan property to TotalSeconds.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Read-DbaBackupHeader",
        "Description":  "Reads full, differential and transaction log backups. An online SQL Server is required to parse the backup files and the path specified must be relative to that SQL Server.",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup",
                     "Restore"
                 ],
        "Synopsis":  "Reads and displays detailed information about a SQL Server backup",
        "Name":  "Read-DbaBackupHeader",
        "Links":  "https://dbatools.io/Read-DbaBackupHeader",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRead-DbaBackupHeader -SqlInstance sql2016 -Path S:\\backups\\mydb\\mydb.bak\r\n\r\nLogs into sql2016 using Windows authentication and reads the local file on sql2016, S:\\backups\\mydb\\mydb.bak.\r\n\t\r\nIf you are running this command on a workstation and connecting remotely, remember that sql2016 cannot access files on \r\nyour own workstation.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRead-DbaBackupHeader -SqlInstance sql2016 -Path \\\\nas\\sql\\backups\\mydb\\mydb.bak, \r\n\\\\nas\\sql\\backups\\otherdb\\otherdb.bak\r\n\r\nLogs into sql2016 and reads two backup files - mydb.bak and otherdb.bak. The SQL Server service account must have \r\nrights to read this file.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRead-DbaBackupHeader -SqlInstance . -Path C:\\temp\\myfile.bak -Simple\r\n\r\nLogs into the local workstation (or computer) and shows simplified output about C:\\temp\\myfile.bak. The SQL Server \r\nservice account must have rights to read this file.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$backupinfo = Read-DbaBackupHeader -SqlInstance . -Path C:\\temp\\myfile.bak\r\n\r\n$backupinfo.FileList\r\n\t\r\nDisplays detailed information about each of the datafiles contained in the backupset.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eRead-DbaBackupHeader -SqlInstance . -Path C:\\temp\\myfile.bak -FileList\r\n\r\nAlso returns detailed information about each of the datafiles contained in the backupset.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003e\"C:\\temp\\myfile.bak\", \"\\backupserver\\backups\\myotherfile.bak\" | Read-DbaBackupHeader -SqlInstance sql2016\r\n\r\nSimilar to running Read-DbaBackupHeader -SqlInstance sql2016 -Path \"C:\\temp\\myfile.bak\", \r\n\"\\backupserver\\backups\\myotherfile.bak\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eGet-ChildItem \\\\nas\\sql\\*.bak | Read-DbaBackupHeader -SqlInstance sql2016\r\n\r\nGets a list of all .bak files on the \\\\nas\\sql share and reads the headers using the server named \"sql2016\". This means \r\nthat the server, sql2016, must have read access to the \\\\nas\\sql share.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eRead-DbaBackupHeader -Path \r\nhttps://dbatoolsaz.blob.core.windows.net/azbackups/restoretime/restoretime_201705131850.bak\r\n\r\n-AzureCredential AzureBackupUser\r\n\r\nGets the backup header information from the SQL Server backup file stored at \r\nhttps://dbatoolsaz.blob.core.windows.net/azbackups/restoretime/restoretime_201705131850.bak on Azure\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Read-DbaTraceFile",
        "Description":  "Using the fn_trace_gettable function, a trace file is read and returned as a PowerShell object\n\nThis function returns the whole of the trace file. The information is presented in the format that the trace subsystem uses.",
        "Tags":  [
                     "Security",
                     "Trace"
                 ],
        "Synopsis":  "Reads a trace file from specied SQL Server Database",
        "Name":  "Read-DbaTraceFile",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRead-DbaTraceFile -SqlInstance sql2016 -Database master, tempdb -Path C:\\traces\\big.trc\r\n\r\nReads the tracefile C:\\traces\\big.trc, stored on the sql2016 sql server. Filters only results that have master or \r\ntempdb as the DatabaseName.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRead-DbaTraceFile -SqlInstance sql2016 -Database master, tempdb -Path C:\\traces\\big.trc -TextData \u0027EXEC \r\nSP_PROCOPTION\u0027\r\n\r\nReads the tracefile C:\\traces\\big.trc, stored on the sql2016 sql server. \r\nFilters only results that have master or tempdb as the DatabaseName and that have \u0027EXEC SP_PROCOPTION\u0027 somewhere in the \r\ntext.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nRead-DbaTraceFile -SqlInstance sql2016 -Path C:\\traces\\big.trc -Where \"LinkedServerName = \u0027myls\u0027 and StartTime \r\n\u003e\u00275/30/2017 4:27:52 PM\u0027\"\r\n\r\nReads the tracefile C:\\traces\\big.trc, stored on the sql2016 sql server. \r\nFilters only results where LinkServerName = myls and StartTime is greater than \u00275/30/2017 4:27:52 PM\u0027.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Read-DbaTransactionLog",
        "Description":  "Using the fn_dblog function, the live transaction log is read and returned as a PowerShell object\n\nThis function returns the whole of the log. The information is presented in the format that the logging subsystem uses.\n\nA soft limit of 0.5GB of log as been implemented. This is based on testing. This limit can be overidden\nat the users request, but please be aware that this may have an impact on your target databases and on the\nsystem running this function",
        "Tags":  [
                     "Databases",
                     "Logs"
                 ],
        "Synopsis":  "Reads the live Transaction log from specied SQL Server Database",
        "Name":  "Read-DbaTransactionLog",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003e$Log = Read-DbaTransactionLog -SqlInstance sql2016 -Database MyDatabase\r\n\r\nWill read the contents of the transaction log of MyDatabase on SQL Server Instance sql2016 into the local PowerShell \r\nobject $Log\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$Log = Read-DbaTransactionLog -SqlInstance sql2016 -Database MyDatabase -IgnoreLimit\r\n\r\nWill read the contents of the transaction log of MyDatabase on SQL Server Instance sql2016 into the local PowerShell \r\nobject $Log, ignoring the recommnedation of not returning more that 0.5GB of log\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaAgentJob",
        "Description":  "Remove-DbaAgentJob removes a a job in the SQL Server Agent.",
        "Tags":  [
                     "Agent",
                     "Job"
                 ],
        "Synopsis":  "Remove-DbaAgentJob removes a job.",
        "Name":  "Remove-DbaAgentJob",
        "Links":  "https://dbatools.io/Remove-DbaAgentJob",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentJob -SqlInstance sql1 -Job Job1\r\n\r\nRemoves the job from the instance with the name Job1.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentJob -SqlInstance sql1 -Job Job1 -KeepHistory\r\n\r\nRemoves the job but keeps the history.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentJob -SqlInstance sql1 -Job Job1 -KeepUnusedSchedule\r\n\r\nRemoves the job but keeps the unused schedules.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentJob -SqlInstance sql1, sql2, sql3 -Job Job1\r\n\r\nRemoves the job from multiple servers.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | Remove-DbaAgentJob -Job Job1\r\n\r\nRemoves the job from multiple servers using pipe line\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaAgentJobStep",
        "Description":  "Remove-DbaAgentJobStep removes a job step in the SQL Server Agent.",
        "Tags":  [
                     "Agent",
                     "Job",
                     "Job Step"
                 ],
        "Synopsis":  "Remove-DbaAgentJobStep removes a job step.",
        "Name":  "Remove-DbaAgentJobStep",
        "Links":  "https://dbatools.io/Remove-DbaAgentJobStep",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentJobStep -SqlInstance sql1 -Job Job1 -StepName Step1\r\n\r\nRemove the job step from the job\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentJobStep -SqlInstance sql1 -Job Job1, Job2, Job3 -StepName Step1\r\n\r\nRemove the job step from the job for multiple jobs\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentJobStep -SqlInstance sql1, sql2, sql3 -Job Job1 -StepName Step1\r\n\r\nRemove the job step from the job on multiple servers\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | Remove-DbaAgentJobStep -Job Job1 -StepName Step1\r\n\r\nRemove the job step from the job on multiple servers using pipeline\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaAgentSchedule",
        "Description":  "Remove-DbaAgentJobSchedule removes a a job in the SQL Server Agent.",
        "Tags":  [
                     "Agent",
                     "Job",
                     "Job Step",
                     "Schedule"
                 ],
        "Synopsis":  "Remove-DbaAgentJobSchedule removes a job schedule.",
        "Name":  "Remove-DbaAgentSchedule",
        "Links":  "https://dbatools.io/Remove-DbaAgentJobSchedule",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentSchedule -SqlInstance sql1 -Schedule weekly\r\n\r\nRemove the schedule weekly\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentSchedule -SqlInstance sql1 -Schedule weekly -Force\r\n\r\nRemove the schedule weekly from the job even if the schedule is being used by another job.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentSchedule -SqlInstance sql1 -Schedule daily, weekly\r\n\r\nRemove multiple schedule\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaAgentSchedule -SqlInstance sql1, sql2, sql3 -Schedule daily, weekly\r\n\r\nRemove the schedule on multiple servers for multiple schedules\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | Remove-DbaAgentSchedule -Schedule daily, weekly\r\n\r\nRemove the schedule on multiple servers using pipe line\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaBackup",
        "Description":  "Provides all of the same functionality for removing SQL backups from disk as a standard maintenance plan would.\n\nAs an addition you have the ability to check the Archive bit on files before deletion. This will allow you to ensure\nbackups have been archived to your archive location before removal.\n\nAlso included is the ability to remove empty folders as part of this cleanup activity.",
        "Tags":  [
                     "Storage",
                     "DisasterRecovery",
                     "Backup"
                 ],
        "Synopsis":  "Remove SQL Server backups from disk",
        "Name":  "Remove-DbaBackup",
        "Links":  "https://dbatools.io/Remove-DbaBackup",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaBackup -Path \u0027C:\\MSSQL\\SQL Backup\\\u0027 -BackupFileExtension trn -RetentionPeriod 48h\r\n\r\nThe cmdlet will remove \u0027*.trn\u0027 files from \u0027C:\\MSSQL\\SQL Backup\\\u0027 and all subdirectories that are more than 48 hours.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaBackup -Path \u0027C:\\MSSQL\\SQL Backup\\\u0027 -BackupFileExtension trn -RetentionPeriod 48h -WhatIf\r\n\r\nSame as example #1, but using the WhatIf parameter. The WhatIf parameter will allow the cmdlet show you what it will \r\ndo, without actually doing it.\r\nIn this case, no trn files will be deleted. Instead, the cmdlet will output what it will do when it runs. This is a \r\ngood preventatitive measure\r\nespecially when you are first configuring the cmdlet calls.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaBackup -Path \u0027C:\\MSSQL\\Backup\\\u0027 -BackupFileExtension bak -RetentionPeriod 7d -CheckArchiveBit\r\n\r\nThe cmdlet will remove \u0027*.bak\u0027 files from \u0027C:\\MSSQL\\Backup\\\u0027 and all subdirectories that are more than 7 days old. \r\nIt will also ensure that the bak files have been archived using the archive bit before removing them.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaBackup -Path \u0027C:\\MSSQL\\Backup\\\u0027 -BackupFileExtension bak -RetentionPeriod 1w -RemoveEmptyBackupFolder\r\n\r\nThe cmdlet will remove \u0027*.bak\u0027 files from \u0027C:\\MSSQL\\Backup\\\u0027 and all subdirectories that are more than 1 week old. \r\nIt will also remove any backup folders that no longer contain backup files.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaCmConnection",
        "Description":  "Removes connection objects from the connection cache used for remote computer management.",
        "Tags":  "ComputerManagement",
        "Synopsis":  "Removes connection objects from the connection cache used for remote computer management.",
        "Name":  "Remove-DbaCmConnection",
        "Links":  "https://dbatools.io/Remove-DbaCmConnection",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaCmConnection -ComputerName sql2014\r\n\r\nRemoves the cached connection to the server sql2014 from the cache.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmConnection | Remove-DbaCmConnection\r\n\r\nClears the entire connection cache.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaComputerCertificate",
        "Description":  "Removes a computer certificate from a local or remote compuer",
        "Tags":  "Certificate",
        "Synopsis":  "Removes a computer certificate - useful for removing easily certs from remote computers",
        "Name":  "Remove-DbaComputerCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaComputerCertificate -ComputerName Server1 -Thumbprint C2BBE81A94FEE7A26FFF86C2DFDAF6BFD28C6C94\r\n\r\nRemoves certificate with thumbprint C2BBE81A94FEE7A26FFF86C2DFDAF6BFD28C6C94 in the LocalMachine store on Server1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaComputerCertificate -ComputerName Server1 -Thumbprint C2BBE81A94FEE7A26FFF86C2DFDAF6BFD28C6C94 -Store \r\nUser -Folder My\r\n\r\nRemoves certificate with thumbprint C2BBE81A94FEE7A26FFF86C2DFDAF6BFD28C6C94 in the User\\My (Personal) store on Server1\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaDatabase",
        "Description":  "Tries a bunch of different ways to remove a database or two or more.",
        "Tags":  [
                     "Delete",
                     "Databases"
                 ],
        "Synopsis":  "Drops a database, hopefully even the really stuck ones.",
        "Name":  "Remove-DbaDatabase",
        "Links":  "https://dbatools.io/Remove-DbaDatabase",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabase -SqlInstance sql2016 -Database containeddb\r\n\r\nPrompts then removes the database containeddb on SQL Server sql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabase -SqlInstance sql2016 -Database containeddb, mydb\r\n\r\nPrompts then removes the databases containeddb and mydb on SQL Server sql2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabase -SqlInstance sql2016 -Database containeddb -Confirm:$false\r\n\r\nDoes not prompt and swiftly removes containeddb on SQL Server sql2016\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaDatabaseCertificate",
        "Description":  "Deletes specified database certificate",
        "Tags":  "Certificate",
        "Synopsis":  "Deletes specified database certificate",
        "Name":  "Remove-DbaDatabaseCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseCertificate -SqlInstance Server1\r\n\r\nThe certificate in the master database on server1 will be removed if it exists.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseCertificate -SqlInstance Server1 -Database db1 -Confirm:$false\r\n\r\nSuppresses all prompts to remove the certificate in the \u0027db1\u0027 database and drops the key.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaDatabaseMasterKey",
        "Description":  "Deletes specified database master key.",
        "Tags":  "Certificate",
        "Synopsis":  "Deletes specified database master key",
        "Name":  "Remove-DbaDatabaseMasterKey",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseMasterKey -SqlInstance Server1\r\n\r\nThe master key in the master database on server1 will be removed if it exists.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseMasterKey -SqlInstance Server1 -Database db1 -Confirm:$false\r\n\r\nSuppresses all prompts to remove the master key in the \u0027db1\u0027 database and drops the key.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaDatabaseSafely",
        "Description":  "Performs a DBCC CHECKDB on the database, backs up the database with Checksum and verify only to a Final Backup location, creates an Agent Job to restore from that backup, Drops the database, runs the agent job to restore the database,\nperforms a DBCC CHECKDB and drops the database\n\nBy default the initial DBCC CHECKDB is performed\nBy default the jobs and databases are created on the same server. Use -Destination to use a seperate server\n\nIt will start the SQL Agent Service on the Destination Server if it is not running\n\n With huge thanks to Grant Fritchey and his verify your backups video\n Take a look its only 3 minutes long\n http://sqlps.io/backuprant",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup",
                     "Restore",
                     "Databases"
                 ],
        "Author":  "Rob Sewell @SQLDBAWithBeard, sqldbawithabeard.com",
        "Synopsis":  "Safely removes a SQL Database and creates an Agent Job to restore it",
        "Name":  "Remove-DbaDatabaseSafely",
        "Links":  "https://dbatools.io/Remove-DbaDatabaseSafely",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSafely -SqlInstance \u0027Fade2Black\u0027 -Database RideTheLightning -BackupFolder \r\n\u0027C:\\MSSQL\\Backup\\Rationalised - DO NOT DELETE\u0027\r\n\r\nFor the database RideTheLightning on the server Fade2Black Will perform a DBCC CHECKDB and if there are no errors\r\nbackup the database to the folder C:\\MSSQL\\Backup\\Rationalised - DO NOT DELETE. It will then create an Agent Job to \r\nrestore the database\r\nfrom that backup. It will drop the database, run the agent job to restore it, perform a DBCC ChECK DB and then drop the \r\ndatabase.\r\n\r\nAny DBCC errors will be written to your documents folder\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e$Database = \u0027DemoNCIndex\u0027,\u0027RemoveTestDatabase\u0027\r\n\r\nRemove-DbaDatabaseSafely -SqlInstance \u0027Fade2Black\u0027 -Database $Database -BackupFolder \u0027C:\\MSSQL\\Backup\\Rationalised - DO \r\nNOT DELETE\u0027\r\n\r\nFor the databases \u0027DemoNCIndex\u0027,\u0027RemoveTestDatabase\u0027 on the server Fade2Black Will perform a DBCC CHECKDB and if there \r\nare no errors\r\nbackup the database to the folder C:\\MSSQL\\Backup\\Rationalised - DO NOT DELETE. It will then create an Agent Job for \r\neach database\r\nto restore the database from that backup. It will drop the database, run the agent job, perform a DBCC ChECK DB and \r\nthen drop the database\r\n\r\nAny DBCC errors will be written to your documents folder\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSafely -SqlInstance \u0027Fade2Black\u0027 -DestinationServer JusticeForAll -Database RideTheLightning \r\n-BackupFolder \u0027\\\\BACKUPSERVER\\BACKUPSHARE\\MSSQL\\Rationalised - DO NOT DELETE\u0027\r\n\r\nFor the database RideTheLightning on the server Fade2Black Will perform a DBCC CHECKDB and if there are no errors\r\nbackup the database to the folder \\\\BACKUPSERVER\\BACKUPSHARE\\MSSQL\\Rationalised - DO NOT DELETE It will then create an \r\nAgent Job on the server\r\nJusticeForAll to restore the database from that backup. It will drop the database on Fade2Black, run the agent job to \r\nrestore it on JusticeForAll,\r\nperform a DBCC ChECK DB and then drop the database\r\n\r\nAny DBCC errors will be written to your documents folder\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSafely -SqlInstance IronMaiden -Database $Database -DestinationServer TheWildHearts \r\n-BackupFolder z:\\Backups -NoDbccCheckDb -UseDefaultFilePaths -JobOwner \u0027THEBEARD\\Rob\u0027\r\n\r\nFor the databases $Database on the server IronMaiden Will NOT perform a DBCC CHECKDB\r\nIt will backup the databases to the folder Z:\\Backups It will then create an Agent Job on the server with a Job Owner \r\nof THEBEARD\\Rob\r\nTheWildHearts to restore the database from that backup using the instance default filepaths.\r\nIt will drop the database on IronMaiden, run the agent job to restore it on TheWildHearts using the default file paths \r\nfor the instance, perform\r\na DBCC ChECK DB and then drop the database\r\n\r\nAny DBCC errors will be written to your documents folder\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSafely -SqlInstance IronMaiden -Database $Database -DestinationServer TheWildHearts \r\n-BackupFolder z:\\Backups -UseDefaultFilePaths -ContinueAfterDbccError\r\n\r\nFor the databases $Database on the server IronMaiden will backup the databases to the folder Z:\\Backups It will then \r\ncreate an Agent Job\r\nTheWildHearts to restore the database from that backup using the instance default filepaths.\r\nIt will drop the database on IronMaiden, run the agent job to restore it on TheWildHearts using the default file paths \r\nfor the instance, perform\r\na DBCC ChECK DB and then drop the database\r\n\r\nIf there is a DBCC Error it will continue to perform rest of the actions and will create an Agent Job with DBCCERROR in \r\nthe name and a Backup file with DBCCError in the name\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaDatabaseSnapshot",
        "Description":  "Removes (drops) database snapshots from the server",
        "Tags":  [
                     "Snapshot",
                     "Database"
                 ],
        "Author":  "niphlod",
        "Synopsis":  "Removes database snapshots",
        "Name":  "Remove-DbaDatabaseSnapshot",
        "Links":  "https://dbatools.io/Remove-DbaDatabaseSnapshot",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSnapshot -SqlInstance sqlserver2014a\r\n\r\nRemoves all database snapshots from sqlserver2014a\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Snapshot HR_snap_20161201, HR_snap_20161101\r\n\r\nRemoves database snapshots named HR_snap_20161201 and HR_snap_20161101\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Database HR, Accounting\r\n\r\nRemoves all database snapshots having HR and Accounting as base dbs\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaDatabaseSnapshot -SqlInstance sqlserver2014a -Snapshot HR_snapshot, Accounting_snapshot\r\n\r\nRemoves HR_snapshot and Accounting_snapshot\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseSnapshot -SqlInstance sql2016 | Where SnapshotOf -like \u0027*dumpsterfire*\u0027 | \r\nRemove-DbaDatabaseSnapshot\r\n\r\nRemoves all snapshots associated with databases that have dumpsterfire in the name\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaNetworkCertificate",
        "Description":  "Removes the network certificate for SQL Server instance. This setting is found in Configuration Manager.",
        "Tags":  "Certificate",
        "Synopsis":  "Removes the network certificate for SQL Server instance",
        "Name":  "Remove-DbaNetworkCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaNetworkCertificate\r\n\r\nRemoves the Network Certificate for the default instance (MSSQLSERVER) on localhost\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaNetworkCertificate -SqlInstance sql1\\SQL2008R2SP2\r\n\r\nRemoves the Network Certificate for the SQL2008R2SP2 instance on sql1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaNetworkCertificate -SqlInstance localhost\\SQL2008R2SP2 -WhatIf\r\n\r\nShows what would happen if the command were run\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaOrphanUser",
        "Description":  "An orphan user is defined by a user that does not have their matching login. (Login property = \"\").\nIf user is the owner of the schema with the same name and if if the schema does not have any underlying objects the schema will be dropped.\nIf user owns more than one schema, the owner of the schemas that does not have the same name as the user, will be changed to \u0027dbo\u0027. If schemas have underlying objects, you must specify the -Force parameter so the user can be dropped.\nIf exists a login to map the drop will not be performed unless you specify the -Force parameter (only when calling from Repair-DbaOrphanUser.",
        "Tags":  [
                     "Orphan",
                     "Databases"
                 ],
        "Author":  "Claudio Silva (@ClaudioESSilva)",
        "Synopsis":  "Drop orphan users with no existing login to map",
        "Name":  "Remove-DbaOrphanUser",
        "Links":  "https://dbatools.io/Remove-DbaOrphanUser",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaOrphanUser -SqlInstance sql2005\r\n\r\nWill find and drop all orphan users without matching login of all databases present on server \u0027sql2005\u0027\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaOrphanUser -SqlInstance sqlserver2014a -SqlCredential $cred\r\n\r\nWill find and drop all orphan users without matching login of all databases present on server \u0027sqlserver2014a\u0027. Will be \r\nverified using SQL credentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaOrphanUser -SqlInstance sqlserver2014a -Database db1, db2 -Force\r\n\r\nWill find all and drop orphan users even if exists their matching login on both db1 and db2 databases.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaOrphanUser -SqlInstance sqlserver2014a -ExcludeDatabase db1, db2 -Force\r\n\r\nWill finall all and drop orphan users even if exist their matching login from all databases except db1 and db2.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaOrphanUser -SqlInstance sqlserver2014a -User OrphanUser\r\n\r\nWill remove from all databases the user OrphanUser only if not have their matching login\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaOrphanUser -SqlInstance sqlserver2014a -User OrphanUser -Force\r\n\r\nWill remove from all databases the user OrphanUser EVEN if exists their matching login. First will change any schema \r\nthat it owns to \u0027dbo\u0027.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Remove-DbaSpn",
        "Description":  "This function will connect to Active Directory and search for an account. If the account is found, it will attempt to remove the specified SPN. Once the SPN is removed, the function will also remove delegation to that service. \n\nIn order to run this function, the credential you provide must have write access to Active Directory.\n\nNote: This function supports -WhatIf",
        "Tags":  "SPN",
        "Author":  "Drew Furgiuele (@pittfurg), http://www.port1433.com",
        "Synopsis":  "Removes an SPN for a given service account in active directory and also removes delegation to the same SPN, if found",
        "Name":  "Remove-DbaSpn",
        "Links":  "https://dbatools.io/Remove-DbaSpn",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaSpn -SPN MSSQLSvc\\SQLSERVERA.domain.something -ServiceAccount domain\\account\r\n\r\nConnects to Active Directory and removes a provided SPN from the given account (and also the relative delegation)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaSpn -SPN MSSQLSvc\\SQLSERVERA.domain.something -ServiceAccount domain\\account -Silent\r\n\r\nConnects to Active Directory and removes a provided SPN from the given account, suppressing all error messages and \r\nthrow exceptions that can be caught instead\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRemove-DbaSpn -SPN MSSQLSvc\\SQLSERVERA.domain.something -ServiceAccount domain\\account -Credential \r\n(Get-Credential)\r\n\r\nConnects to Active Directory and removes a provided SPN to the given account. Uses alternative account to connect to AD.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eTest-DbaSpn -ComputerName sql2005 | Where { $_.isSet -eq $true } | Remove-DbaSpn -WhatIf\r\n\r\nShows what would happen trying to remove all set SPNs for sql2005 and the relative delegations\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eTest-DbaSpn -ComputerName sql2005 | Where { $_.isSet -eq $true } | Remove-DbaSpn\r\n\r\nRemoves all set SPNs for sql2005 and the relative delegations\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Rename-DbaLogin",
        "Description":  "There are times where you might want to rename a login that was copied down, or if the name is not descriptive for what it does. \n\nIt can be a pain to update all of the mappings for a specific user, this does it for you.",
        "Tags":  "Login",
        "Synopsis":  "Rename-DbaLogin will rename login and database mapping for a specified login.",
        "Name":  "Rename-DbaLogin",
        "Links":  "https://dbatools.io/Rename-DbaLogin",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRename-DbaLogin -SqlInstance localhost -Login DbaToolsUser -NewLogin captain\r\n\r\nSQL Login Example\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRename-DbaLogin -SqlInstance localhost -Login domain\\oldname -NewLogin domain\\newname\r\n\r\nChange the windowsuser login name.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRename-DbaLogin -SqlInstance localhost -Login dbatoolsuser -NewLogin captain -WhatIf\r\n\r\nWhatIf Example\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Repair-DbaOrphanUser",
        "Description":  "An orphan user is defined by a user that does not have their matching login. (Login property = \"\")\n\nIf the matching login exists it must be:\n\tEnabled\n\tNot a system object\n\tNot locked\n\tHave the same name that user\n\nYou can drop users that does not have their matching login by specifying the parameter -RemoveNotExisting This will be made by calling Remove-DbaOrphanUser function.",
        "Tags":  "Orphan",
        "Synopsis":  "Find orphan users with existing login and remap.",
        "Name":  "Repair-DbaOrphanUser",
        "Links":  "https://dbatools.io/Repair-DbaOrphanUser",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaOrphanUser -SqlInstance sql2005\r\n\r\nWill find and repair all orphan users of all databases present on server \u0027sql2005\u0027\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaOrphanUser -SqlInstance sqlserver2014a -SqlCredential $cred\r\n\r\nWill find and repair all orphan users of all databases present on server \u0027sqlserver2014a\u0027. Will be verified using SQL \r\ncredentials.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaOrphanUser -SqlInstance sqlserver2014a -Database db1, db2\r\n\r\nWill find and repair all orphan users on both db1 and db2 databases\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaOrphanUser -SqlInstance sqlserver2014a -Database db1 -Users OrphanUser\r\n\r\nWill find and repair user \u0027OrphanUser\u0027 on \u0027db1\u0027 database\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaOrphanUser -SqlInstance sqlserver2014a -Users OrphanUser\r\n\r\nWill find and repair user \u0027OrphanUser\u0027 on all databases\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaOrphanUser -SqlInstance sqlserver2014a -RemoveNotExisting\r\n\r\nWill find all orphan users of all databases present on server \u0027sqlserver2014a\u0027\r\nWill also remove all users that does not have their matching login by calling Remove-DbaOrphanUser function\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Repair-DbaServerName",
        "Description":  "When a SQL Server\u0027s host OS is renamed, the SQL Server should be as well. This helps with Availability Groups and Kerberos.\n\nThis command renames @@SERVERNAME to match with the Windows name. The new name is automatically determined. It does not matter if you use an alias to connect to the SQL instance.\n\t\t\nIf the automatically determiend new name matches the old name, the command will not run.\n\t\nhttps://www.mssqltips.com/sqlservertip/2525/steps-to-change-the-server-name-for-a-sql-server-machine/",
        "Tags":  "SPN",
        "Synopsis":  "Renames @@SERVERNAME to match with the Windows name.",
        "Name":  "Repair-DbaServerName",
        "Links":  "https://dbatools.io/Repair-DbaServerName",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaServerName -SqlInstance sql2014\r\n\r\nChecks to see if the server is updatable, prompts galore, changes name.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaServerName -SqlInstance sql2014 -AutoFix\r\n\r\nEven more prompts/confirms, but removes Replication or breaks mirroring if necessary.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eRepair-DbaServerName -SqlInstance sql2014 -AutoFix -Force\r\n\r\nSkips some prompts/confirms but not all of them.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Reset-DbaAdmin",
        "Description":  "This function allows administrators to regain access to local or remote SQL Servers by either resetting the sa password, adding sysadmin role to existing login,\nor adding a new login (SQL or Windows) and granting it sysadmin privileges.\n\nThis is accomplished by stopping the SQL services or SQL Clustered Resource Group, then restarting SQL via the command-line\nusing the /mReset-DbaAdmin paramter which starts the server in Single-User mode, and only allows this script to connect.\n\nOnce the service is restarted, the following tasks are performed:\n- Login is added if it doesn\u0027t exist\n- If login is a Windows User, an attempt is made to ensure it exists\n- If login is a SQL Login, password policy will be set to OFF when creating the login, and SQL Server authentication will be set to Mixed Mode.\n- Login will be enabled and unlocked\n- Login will be added to sysadmin role\n\nIf failures occur at any point, a best attempt is made to restart the SQL Server.\n\nIn order to make this script as portable as possible, System.Data.SqlClient and Get-WmiObject are used (as opposed to requiring the Failover Cluster Admin tools or SMO).\nIf using this function against a remote SQL Server, ensure WinRM is configured and accessible. If this is not possible, run the script locally.\n\nTested on Windows XP, 7, 8.1, Server 2012 and Windows Server Technical Preview 2.\nTested on SQL Server 2005 SP4 through 2016 CTP2.",
        "Tags":  "WSMan",
        "Author":  "Chrissy LeMaire (@cl), netnerds.net",
        "Synopsis":  "This function will allow administrators to regain access to SQL Servers in the event that passwords or access was lost.\n\nSupports SQL Server 2005 and above. Windows administrator access is required.",
        "Name":  "Reset-DbaAdmin",
        "Links":  "https://dbatools.io/Reset-DbaAdmin",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eReset-DbaAdmin -SqlInstance sqlcluster\r\n\r\nPrompts for password, then resets the \"sa\" account password on sqlcluster.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eReset-DbaAdmin -SqlInstance sqlserver\\sqlexpress -Login ad\\administrator\r\n\r\nPrompts user to confirm that they understand the SQL Service will be restarted.\r\n\r\nAdds the domain account \"ad\\administrator\" as a sysadmin to the SQL instance.\r\nIf the account already exists, it will be added to the sysadmin role.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eReset-DbaAdmin -SqlInstance sqlserver\\sqlexpress -Login sqladmin -Force\r\n\r\nSkips restart confirmation, prompts for passsword, then adds a SQL Login \"sqladmin\" with sysadmin privleges.\r\nIf the account already exists, it will be added to the sysadmin role and the password will be reset.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Resolve-DbaNetworkName",
        "Description":  "Retrieves the IPAddress, ComputerName from one computer.\nThe object can be used to take action against its name or IPAddress.\n\nFirst ICMP is used to test the connection, and get the connected IPAddress.\n\nMultiple protocols (e.g. WMI, CIM, etc) are attempted before giving up.\n\nImportant: Remember that FQDN doesn\u0027t always match \"ComputerName dot Domain\" as AD intends.\n\tThere are network setup (google \"disjoint domain\") where AD and DNS do not match.\n\t\"Full computer name\" (as reported by sysdm.cpl) is the only match between the two,\n\tand it matches the \"DNSHostName\" property of the computer object stored in AD.\n\tThis means that the notation of FQDN that matches \"ComputerName dot Domain\" is incorrect\n\tin those scenarios.\n\tIn other words, the \"suffix\" of the FQDN CAN be different from the AD Domain.\n\t\n\tThis cmdlet has been providing good results since its inception but for lack of useful\n\tnames some doubts may arise.\n\tLet this clear the doubts:\n\t- InputName: whatever has been passed in\n\t- ComputerName: hostname only\n\t- IPAddress: IP Address\n\t- DNSHostName: hostname only, coming strictly from DNS (as reported from the calling computer)\n\t- DNSDomain: domain only, coming strictly from DNS (as reported from the calling computer)\n\t- Domain: domain only, coming strictly from AD (i.e. the domain the ComputerName is joined to)\n\t- DNSHostEntry: Fully name as returned by DNS [System.Net.Dns]::GetHostEntry\n\t- FQDN: \"legacy\" notation of ComputerName \"dot\" Domain (coming from AD)\n\t- FullComputerName: Full name as configured from within the Computer (i.e. the only secure match between AD and DNS)\n\nSo, if you need to use something, go with FullComputerName, always, as it is the most correct in every scenario.",
        "Tags":  [
                     "Network",
                     "Resolve"
                 ],
        "Synopsis":  "Returns information about the network connection of the target computer including NetBIOS name, IP Address, domain name and fully qualified domain name (FQDN).",
        "Name":  "Resolve-DbaNetworkName",
        "Links":  "https://dbatools.io/Resolve-DbaNetworkName",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eResolve-DbaNetworkName -ComputerName ServerA\r\n\r\nReturns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, DNSDomain, Domain, DNSHostEntry, \r\nFQDN, DNSHostEntry for ServerA\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eResolve-DbaNetworkName -SqlInstance sql2016\\sqlexpress\r\n\r\nReturns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, DNSDomain, Domain, DNSHostEntry, \r\nFQDN, DNSHostEntry for the SQL instance sql2016\\sqlexpress\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eResolve-DbaNetworkName -SqlInstance sql2016\\sqlexpress, sql2014\r\n\r\nReturns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, DNSDomain, Domain, DNSHostEntry, \r\nFQDN, DNSHostEntry for the SQL instance sql2016\\sqlexpress and sql2014\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sql2014 | Resolve-DbaNetworkName\r\n\r\nReturns a custom object displaying InputName, ComputerName, IPAddress, DNSHostName, Domain, FQDN for all SQL Servers \r\nreturned by Get-DbaRegisteredServerName\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Restore-DbaBackupFromDirectory",
        "Description":  "Many SQL Server database administrators use Ola Hallengren\u0027s SQL Server Maintenance Solution which can be found at http://ola.hallengren.com\nHallengren uses a predictable backup structure which made it relatively easy to create a script that can restore an entire SQL Server database instance, down to the master database (next version), to a new server. This script is intended to be used in the event that the originating SQL Server becomes unavailable, thus rendering my other SQL restore script (http://goo.gl/QmfQ6s) ineffective.",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup",
                     "Restore"
                 ],
        "Synopsis":  "Restores SQL Server databases from the backup directory structure created by Ola Hallengren\u0027s database maintenance scripts. Different structures coming soon.",
        "Name":  "Restore-DbaBackupFromDirectory",
        "Links":  "https://dbatools.io/Restore-SqlBackupFromDirectory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRestore-SqlBackupFromDirectory -SqlInstance sqlcluster -Path \\\\fileserver\\share\\sqlbackups\\SQLSERVER2014A\r\n\r\nDescription\r\n\r\nAll user databases contained within \\\\fileserver\\share\\sqlbackups\\SQLSERVERA will be restored to sqlcluster, down the \r\nmost recent full/differential/logs.\r\n\r\n\r\nRequires -Version 3.0\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Restore-DbaDatabase",
        "Description":  "Upon bein passed a list of potential backups files this command will scan the files, select those that contain SQL Server\nbackup sets. It will then filter those files down to a set that can perform the requested restore, checking that we have a\nfull restore chain to the point in time requested by the caller.\n\nThe function defaults to working on a remote instance. This means that all paths passed in must be relative to the remote instance.\nXpDirTree will be used to perform the file scans\n\n\nVarious means can be used to pass in a list of files to be considered. The default is to non recursively scan the folder\npassed in.",
        "Tags":  [
                     "DisasterRecovery",
                     "Backup",
                     "Restore"
                 ],
        "Synopsis":  "Restores a SQL Server Database from a set of backupfiles",
        "Name":  "Restore-DbaDatabase",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaDatabase -SqlInstance server1\\instance1 -Path \\\\server2\\backups\r\n\r\nScans all the backup files in \\\\server2\\backups, filters them and restores the database to server1\\instance1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaDatabase -SqlInstance server1\\instance1 -Path \\\\server2\\backups -MaintenanceSolutionBackup \r\n-DestinationDataDirectory c:\\restores\r\n\r\nScans all the backup files in \\\\server2\\backups$ stored in an Ola Hallengren style folder structure,\r\nfilters them and restores the database to the c:\\restores folder on server1\\instance1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-ChildItem c:\\SQLbackups1\\, \\\\server\\sqlbackups2 | Restore-DbaDatabase -SqlInstance server1\\instance1\r\n\r\nTakes the provided files from multiple directories and restores them on server1\\instance1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$RestoreTime = Get-Date(\u002711:19 23/12/2016\u0027)\r\n\r\nRestore-DbaDatabase -SqlInstance server1\\instance1 -Path \\\\server2\\backups -MaintenanceSolutionBackup \r\n-DestinationDataDirectory c:\\restores -RestoreTime $RestoreTime\r\n\r\nScans all the backup files in \\\\server2\\backups stored in an Ola Hallengren style folder structure,\r\nfilters them and restores the database to the c:\\restores folder on server1\\instance1 up to 11:19 23/12/2016\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaDatabase -SqlInstance server1\\instance1 -Path \\\\server2\\backups -DestinationDataDirectory c:\\restores \r\n-OutputScriptOnly | Select-Object -ExpandPropert Tsql | Out-File -Filepath c:\\scripts\\restore.sql\r\n\r\nScans all the backup files in \\\\server2\\backups stored in an Ola Hallengren style folder structure,\r\nfilters them and generate the T-SQL Scripts to restore the database to the latest point in time,\r\nand then stores the output in a file for later retrieval\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaDatabase -SqlInstance server1\\instance1 -Path c:\\backups -DestinationDataDirectory c:\\DataFiles \r\n-DestinationLogDirectory c:\\LogFile\r\n\r\nScans all the files in c:\\backups and then restores them onto the SQL Server Instance server1\\instance1, placing data \r\nfiles\r\nc:\\DataFiles and all the log files into c:\\LogFiles\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaDatabase -SqlInstance server1\\instance1 -Path http://demo.blob.core.windows.net/backups/dbbackup.bak \r\n-AzureCredential MyAzureCredential\r\n\r\nWill restore the backup held at http://demo.blob.core.windows.net/backups/dbbackup.bak to server1\\instance1. The \r\nconnection to Azure will be made using the \r\ncredential MyAzureCredential held on instance Server1\\instance1\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003e$File = Get-ChildItem c:\\backups, \\\\server1\\backups -recurse\r\n\r\n$File | Restore-DbaDatabase -SqlInstance Server1\\Instance -useDestinationDefaultDirectories\r\n\r\nThis will take all of the files found under the folders c:\\backups and \\\\server1\\backups, and pipeline them into\r\nRestore-DbaDatabase. Restore-DbaDatabase will then scan all of the files, and restore all of the databases included\r\nto the latest point in time covered by their backups. All data and log files will be moved to the default SQL Sever\r\nfolder for those file types as defined on the target instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 9 --------------------------\r\n\r\nPS C:\\\u003e$files = Get-ChildItem C:\\dbatools\\db1\r\n\r\n#Restore database to a point in time\r\n$files | Restore-DbaDatabase -SqlServer server\\instance1 `\r\n\t\t\t-DestinationFilePrefix prefix -DatabaseName Restored `\r\n\t\t\t-RestoreTime (get-date \"14:58:30 22/05/2017\") `\r\n\t\t\t-NoRecovery -WithReplace -StandbyDirectory C:\\dbatools\\standby \r\n\r\n#It\u0027s in standby so we can peek at it\r\nInvoke-Sqlcmd2 -ServerInstance server\\instance1 -Query \"select top 1 * from Restored.dbo.steps order by dt desc\"\r\n\r\n#Not quite there so let\u0027s roll on a bit:\r\n$files | Restore-DbaDatabase -SqlServer server\\instance1 `\r\n\t\t\t-DestinationFilePrefix prefix -DatabaseName Restored `\r\n\t\t\t-continue -WithReplace -RestoreTime (get-date \"15:09:30 22/05/2017\") `\r\n\t\t\t-StandbyDirectory C:\\dbatools\\standby\r\n\r\nInvoke-Sqlcmd2 -ServerInstance server\\instance1 -Query \"select top 1 * from restored.dbo.steps order by dt desc\"\r\n\r\nRestore-DbaDatabase -SqlServer server\\instance1 `\r\n\t\t\t-DestinationFilePrefix prefix -DatabaseName Restored `\r\n\t\t\t-continue -WithReplace \r\n\r\nIn this example we step through the backup files held in c:\\dbatools\\db1 folder.\r\nFirst we restore the database to a point in time in standby mode. This means we can check some details in the databases\r\nWe then roll it on a further 9 minutes to perform some more checks\r\nAnd finally we continue by rolling it all the way forward to the latest point in the backup.\r\nAt each step, only the log files needed to roll the database forward are restored.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Restore-DbaDatabaseCertificate",
        "Description":  "Imports certificates from.cer files using SMO.",
        "Tags":  [
                     "Migration",
                     "Certificate"
                 ],
        "Synopsis":  "Imports certificates from .cer files using SMO.",
        "Name":  "Restore-DbaDatabaseCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaDatabaseCertificate -SqlInstance Server1 -Path \\\\Server1\\Certificates -password \r\n(ConvertTo-SecureString -force -AsPlainText GoodPass1234!!)\r\n\r\nImports all the certificates in the specified path.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Restore-DbaFromDatabaseSnapshot",
        "Description":  "Restores the database from the snapshot, discarding every modification made to the database\nNB: Restoring to a snapshot will result in every other snapshot of the same database to be dropped\nIt also fixes some long-standing bugs in SQL Server when restoring from snapshots",
        "Tags":  [
                     "DisasterRecovery",
                     "Snapshot",
                     "Backup",
                     "Restore",
                     "Database"
                 ],
        "Author":  "niphlod",
        "Synopsis":  "Restores databases from snapshots",
        "Name":  "Restore-DbaFromDatabaseSnapshot",
        "Links":  "https://dbatools.io/Restore-DbaFromDatabaseSnapshot",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaFromDatabaseSnapshot -SqlInstance sqlserver2014a -Database HR, Accounting\r\n\r\nRestores HR and Accounting databases using the latest snapshot available\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eRestore-DbaFromDatabaseSnapshot -SqlInstance sqlserver2014a -Snapshot HR_snap_20161201, Accounting_snap_20161101\r\n\r\nRestores databases from snapshots named HR_snap_20161201 and Accounting_snap_20161101\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Save-DbaDiagnosticQueryScript",
        "Description":  "The dbatools module will have the diagnostic queries pre-installed. Use this only to update to a more recent version or specific versions.\n\nThis function is mainly used by Invoke-DbaDiagnosticQuery, but can also be used independently to download the Glenn Berry DMV scripts.\n\nUse this function to pre-download the scripts from a device with an Internet connection.\n\t\nThe function Invoke-DbaDiagnosticQuery will try to download these scripts automatically, but it obviously needs an internet connection to do that.",
        "Tags":  [
                     "Diagnostic",
                     "DMV",
                     "Troubleshooting"
                 ],
        "Author":  "André Kamman (@AndreKamman), http://clouddba.io",
        "Synopsis":  "Save-DbaDiagnosticQueryScript downloads the most recent version of all Glenn Berry DMV scripts",
        "Name":  "Save-DbaDiagnosticQueryScript",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSave-DbaDiagnosticQueryScript -Path c:\\temp\r\n\r\nDownloads the most recent version of all Glenn Berry DMV scripts to the specified location.\r\nIf Path is not specified, the \"My Documents\" location will be used.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaAgentJob",
        "Description":  "Set-DbaAgentJob updates a job in the SQL Server Agent with parameters supplied.",
        "Tags":  [
                     "Agent",
                     "Job"
                 ],
        "Synopsis":  "Set-DbaAgentJob updates a job.",
        "Name":  "Set-DbaAgentJob",
        "Links":  "https://dbatools.io/Set-DbaAgentJob",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob sql1 -Job Job1 -Disabled\r\n\r\nChanges the job to disabled\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob sql1 -Job Job1 -OwnerLogin user1\r\n\r\nChanges the owner of the job\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob -SqlInstance sql1 -Job Job1 -EventLogLevel OnSuccess\r\n\r\nChanges the job and sets the notification to write to the Windows Application event log on success\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob -SqlInstance sql1 -Job Job1 -EmailLevel OnFailure -EmailOperator dba\r\n\r\nChanges the job and sets the notification to send an e-mail to the e-mail operator\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob -SqlInstance sql1 -Job Job1, Job2, Job3 -Enabled\r\n\r\nChanges multiple jobs to enabled\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob -SqlInstance sql1, sql2, sql3 -Job Job1, Job2, Job3 -Enabled\r\n\r\nChanges multiple jobs to enabled on multiple servers\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 7 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob -SqlInstance sql1 -Job Job1 -Description \u0027Just another job\u0027 -Whatif\r\n\r\nDoesn\u0027t Change the job but shows what would happen.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 8 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJob -SqlInstance sql1, sql2, sql3 -Job \u0027Job One\u0027 -Description \u0027Job One\u0027\r\n\r\nChanges a job with the name \"Job1\" on multiple servers to have another description\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 9 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | Set-DbaAgentJob -Job Job1 -Description \u0027Job One\u0027\r\n\r\nChanges a job with the name \"Job1\" on multiple servers to have another description using pipe line\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaAgentJobOutputFile",
        "Description":  "Sets the Output File for a step of an agent job with the Job Names and steps provided dynamically if required",
        "Synopsis":  "Set the output file for a step within an Agent job.",
        "Name":  "Set-DbaAgentJobOutputFile",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJobOutputFile -SqlInstance SERVERNAME -JobName \u0027The Agent Job\u0027 -OutPutFile \r\nE:\\Logs\\AgentJobStepOutput.txt\r\n\r\nSets the Job step for The Agent job on SERVERNAME to E:\\Logs\\AgentJobStepOutput.txt\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaAgentJobStep",
        "Description":  "Set-DbaAgentJobStep updates a job step in the SQL Server Agent with parameters supplied.",
        "Tags":  [
                     "Agent",
                     "Job",
                     "Job Step"
                 ],
        "Synopsis":  "Set-DbaAgentJobStep updates a job step.",
        "Name":  "Set-DbaAgentJobStep",
        "Links":  "https://dbatools.io/Set-DbaAgentJobStep",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJobStep -SqlInstance sql1 -Job Job1 -StepName Step1 -NewName Step2\r\n\r\nChanges the name of the step in \"Job1\" with the name Step1 to Step2\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJobStep -SqlInstance sql1 -Job Job1 -StepName Step1 -Database msdb\r\n\r\nChanges the database of the step in \"Job1\" with the name Step1 to msdb\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJobStep -SqlInstance sql1 -Job Job1, Job2 -StepName Step1 -Database msdb\r\n\r\nChanges job steps in multiple jobs with the name Step1 to msdb\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJobStep -SqlInstance sql1, sql2, sql3 -Job Job1, Job2 -StepName Step1 -Database msdb\r\n\r\nChanges job steps in multiple jobs on multiple servers with the name Step1 to msdb\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentJobStep -SqlInstance sql1, sql2, sql3 -Job Job1 -StepName Step1 -Database msdb\r\n\r\nChanges the database of the step in \"Job1\" with the name Step1 to msdb for multiple servers\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | Set-DbaAgentJobStep -Job Job1 -StepName Step1 -Database msdb\r\n\r\nChanges the database of the step in \"Job1\" with the name Step1 to msdb for multiple servers using pipeline\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaAgentSchedule",
        "Description":  "Set-DbaAgentSchedule will help update a schedule for a job. It does not attach the schedule to a job.",
        "Tags":  [
                     "Agent",
                     "Job",
                     "Job Step"
                 ],
        "Synopsis":  "Set-DbaAgentSchedule updates a schedule in the msdb database.",
        "Name":  "Set-DbaAgentSchedule",
        "Links":  "https://dbatools.io/Set-DbaAgentSchedule",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentSchedule -SqlInstance sql1 -Job Job1 -ScheduleName daily -Enabled\r\n\r\nChanges the schedule for Job1 with the name \u0027daily\u0027 to enabled\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentSchedule -SqlInstance sql1 -Job Job1 -ScheduleName daily -NewName weekly -FrequencyType Weekly \r\n-FrequencyInterval Monday, Wednesday, Friday\r\n\r\nChanges the schedule for Job1 with the name daily to have a new name weekly\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentSchedule -SqlInstance sql1 -Job Job1, Job2, Job3 -ScheduleName daily -StartTime \u0027230000\u0027\r\n\r\nChanges the start time of the schedule for Job1 to 11 PM for multiple jobs\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaAgentSchedule -SqlInstance sql1, sql2, sql3 -Job Job1 -ScheduleName daily -Enabled\r\n\r\nChanges the schedule for Job1 with the name daily to enabled on multiple servers\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003esql1, sql2, sql3 | Set-DbaAgentSchedule -Job Job1 -ScheduleName \u0027daily\u0027 -Enabled\r\n\r\nChanges the schedule for Job1 with the name \u0027daily\u0027 to enabled on multiple servers using pipe line\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaCmConnection",
        "Description":  "Configures a connection object for use in remote computer management.\nThis function will either create new records for computers that have no connection registered so far, or it will configure existing connections if already present.\n\nAs such it can be handy in making bulk-edits on connections or manually adjusting some settings.",
        "Synopsis":  "Configures a connection object for use in remote computer management.",
        "Name":  "Set-DbaCmConnection",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmConnection sql2014 | Set-DbaCmConnection -ClearBadCredential -UseWindowsCredentials\r\n\r\nRetrieves the already existing connection to sql2014, removes the list of not working credentials and configures it to \r\ndefault to the credentials of the logged on user.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmConnection | Set-DbaCmConnection -RemoveBadCredential $cred\r\n\r\nRemoves the credentials stored in $cred from all connections\u0027 list of \"known to not work\" credentials.\r\nHandy to update changes in privilege.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaCmConnection | Export-Clixml .\\connections.xml\r\n\r\nImport-Clixml .\\connections.xml | Set-DbaCmConnection -ResetConfiguration\r\n\r\nAt first, the current cached connections are stored in an xml file. At a later time - possibly in the profile when \r\nstarting the console again - those connections are imported again and applied again to the connection cache.\r\n\r\nIn this example, the configuration settings will also be reset, since after reimport those will be set to explicit, \r\nrather than deriving them from the global settings.\r\nIn many cases, using the default settings is desirable. For specific settings, use New-DbaCmConnection as part of the \r\nprofile in order to explicitly configure a connection.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaConfig",
        "Description":  "This function creates or changes configuration values.\nThese are used in a larger framework to provide dynamic configuration information outside the PowerShell variable system.",
        "Tags":  "Config",
        "Author":  "Friedrich Weinmann",
        "Synopsis":  "Sets configuration entries.",
        "Name":  "Set-DbaConfig",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaConfig -Name \u0027User\u0027 -Value \"Friedrich\" -Description \"The user under which the show must go on.\"\r\n\r\nCreates a configuration entry named \"User\" with the value \"Friedrich\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaConfig \u0027ConfigLink\u0027 \u0027https://www.example.com/config.xml\u0027 \u0027Company\u0027 -Hidden\r\n\r\nCreates a configuration entry named \"ConfigLink\" in the \"Company\" module with the value \r\n\u0027https://www.example.com/config.xml\u0027.\r\nThis entry is hidden from casual discovery using Get-Config.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaConfig \u0027Network.Firewall\u0027 \u002710.0.0.2\u0027 -Default\r\n\r\nCreates a configuration entry named \"Firewall\" in the \"Network\" module with the value \u002710.0.0.2\u0027\r\nThis is only set, if the setting does not exist yet. If it does, this command will apply no changes.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaDatabaseOwner",
        "Description":  "This function will alter database ownershipt to match a specified login if their current owner does not match the target login. By default, the target login will be \u0027sa\u0027, but the fuction will allow the user to specify a different login for ownership. The user can also apply this to all databases or only to a select list of databases (passed as either a comma separated list or a string array).\n\nBest Practice reference: http://weblogs.sqlteam.com/dang/archive/2008/01/13/Database-Owner-Troubles.aspx",
        "Author":  "Michael Fal (@Mike_Fal), http://mikefal.net",
        "Synopsis":  "Sets database owners with a desired login if databases do not match that owner.",
        "Name":  "Set-DbaDatabaseOwner",
        "Links":  "https://dbatools.io/Set-DbaDatabaseOwner",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDatabaseOwner -SqlInstance localhost\r\n\r\nSets database owner to \u0027sa\u0027 on all databases where the owner does not match \u0027sa\u0027.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDatabaseOwner -SqlInstance localhost -TargetLogin DOMAIN\\account\r\n\r\nTo set the database owner to DOMAIN\\account on all databases where the owner does not match DOMAIN\\account. Note that \r\nTargetLogin must be a valid security principal that exists on the target server.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDatabaseOwner -SqlInstance sqlserver -Database db1, db2\r\n\r\nSets database owner to \u0027sa\u0027 on the db1 and db2 databases if their current owner does not match \u0027sa\u0027.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaDatabaseState",
        "Description":  "Sets some common \"states\" on databases:\n - \"RW\" options (ReadOnly, ReadWrite)\n - \"Status\" options (Online, Offline, Emergency, plus a special \"Detached\")\n - \"Access\" options (SingleUser, RestrictedUser, MultiUser)\n\nReturns an object with SqlInstance, Database, RW, Status, Access, Notes\n\nNotes gets filled when something went wrong setting the state",
        "Author":  "niphlod",
        "Synopsis":  "Sets various options for databases, hereby called \"states\"",
        "Name":  "Set-DbaDatabaseState",
        "Links":  "https://dbatools.io/Set-DbaDatabaseState",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDatabaseState -SqlInstance sqlserver2014a -Database HR -Offline\r\n\r\nSets the HR database as OFFLINE\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDatabaseState -SqlInstance sqlserver2014a -AllDatabases -Exclude HR -Readonly -Force\r\n\r\nSets all databases of the sqlserver2014a instance, except for HR, as READ_ONLY\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabaseState -SqlInstance sql2016 | Where-Object Status -eq \u0027Offline\u0027 | Set-DbaDatabaseState -Online\r\n\r\nFinds all offline databases and sets them to online\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDatabaseState -SqlInstance sqlserver2014a -Database HR -SingleUser\r\n\r\nSets the HR database as SINGLE_USER\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDatabaseState -SqlInstance sqlserver2014a -Database HR -SingleUser -Force\r\n\r\nSets the HR database as SINGLE_USER, dropping all other connections (and rolling back open transactions)\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 6 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaDatabase -SqlInstance sqlserver2014a -Database HR | Set-DbaDatabaseState -SingleUser -Force\r\n\r\nGets the databases from Get-DbaDatabase, and sets them as SINGLE_USER, dropping all other connections (and rolling back \r\nopen transactions)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaDbCompression",
        "Description":  "This function set the appropriate compression recommendation.\n Remember Uptime is critical, the longer uptime, the more accurate the analysis is.\n You would probably be best if you utilized Get-DbaUptime first, before running this command.\n\nSet-DbaDbCompression script derived from GitHub and the tigertoolbox \n (https://github.com/Microsoft/tigertoolbox/tree/master/Evaluate-Compression-Gains)",
        "Tags":  [
                     "Compression",
                     "Table",
                     "Database"
                 ],
        "Author":  "Jason Squires (@js_0505, jstexasdba@gmail.com)",
        "Synopsis":  "Sets tables and indexes with preferred compression setting.",
        "Name":  "Set-DbaDbCompression",
        "Links":  "https://dbatools.io/Set-DbaDbCompression",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDbCompression -SqlInstance localhost -MaxRunTime 60 -PercentCompression 25\r\n\r\nSet the compression run time to 60 minutes and will start the compression of tables/indexes\r\n that have a difference of 25% or higher between current and recommended.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDbCompression -SqlInstance ServerA -Database DBName -MaxRunTime 60 -PercentCompression 25 | Out-GridView\r\n\r\nSet the compression run time to 60 minutes and will start the compression of tables/indexes\r\n that have a difference of 25% or higher between current and recommended and the results into a nicely formated \r\nGridView.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003e$cred = Get-Credential sqladmin\r\n\r\nSet-DbaDbCompression -SqlInstance ServerA -ExcludeDatabase Database -SqlCredential $cred -MaxRunTime 60 \r\n-PercentCompression 25\r\nReturns results of all potential compression options for all databases\r\n with the recommendation of either Page or Row\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e$servers = \u0027Server1\u0027,\u0027Server2\u0027\r\n\r\nforeach ($svr in $servers)\r\n{\r\nSet-DbaDbCompression -SqlInstance $svr -MaxRunTime 60 -PercentCompression 25 | Export-Csv -Path \r\nC:\\temp\\CompressionAnalysisPAC.csv -Append\r\n}\r\n\r\nThis produces a full list of all your servers listed and is pushed to a csv for you to analyize.\r\nSet the compression run time to 60 minutes and will start the compression of tables/indexes; across all listed servers;\r\nthat have a difference of 25% or higher between current and recommended.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaDbQueryStoreOptions",
        "Description":  "Configure Query Store settings for a specific or multiple databases.",
        "Tags":  "QueryStore",
        "Synopsis":  "Configure Query Store settings for a specific or multiple databases.",
        "Name":  "Set-DbaDbQueryStoreOptions",
        "Links":  "https://dbatools.io/Set-DbaQueryStoreOptions",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDbQueryStoreOptions -SqlInstance ServerA\\SQL -State ReadWrite -FlushInterval 600 -CollectionInterval 10 \r\n-MaxSize 100 -CaptureMode All -CleanupMode Auto -StaleQueryThreshold 100 -AllDatabases\r\n\r\nConfigure the Query Store settings for all user databases in the ServerA\\SQL Instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDbQueryStoreOptions -SqlInstance ServerA\\SQL -FlushInterval 600\r\n\r\nOnly configure the FlushInterval setting for all Query Store databases in the ServerA\\SQL Instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDbQueryStoreOptions -SqlInstance ServerA\\SQL -Database AdventureWorks -State ReadWrite -FlushInterval 600 \r\n-CollectionInterval 10 -MaxSize 100 -CaptureMode all -CleanupMode Auto -StaleQueryThreshold 100\r\n\r\nConfigure the Query Store settings for the AdventureWorks database in the ServerA\\SQL Instance.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaDbQueryStoreOptions -SqlInstance ServerA\\SQL -Exclude AdventureWorks -State ReadWrite -FlushInterval 600 \r\n-CollectionInterval 10 -MaxSize 100 -CaptureMode all -CleanupMode Auto -StaleQueryThreshold 100\r\n\r\nConfigure the Query Store settings for all user databases except the AdventureWorks database in the ServerA\\SQL \r\nInstance.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaJobOwner",
        "Description":  "This function will alter SQL Agent Job ownership to match a specified login if their\ncurrent owner does not match the target login. By default, the target login will\nbe \u0027sa\u0027, but the function will allow the user to specify a different login for\nownership. The user can also apply this to all jobs or only to a select list\nof jobs (passed as either a comma separated list or a string array).\n\nBest practice reference: http://sqlmag.com/blog/sql-server-tip-assign-ownership-jobs-sysadmin-account",
        "Tags":  [
                     "Agent",
                     "Job"
                 ],
        "Synopsis":  "Sets SQL Agent job owners with a desired login if jobs do not match that owner.",
        "Name":  "Set-DbaJobOwner",
        "Links":  "https://dbatools.io/Set-DbaJobOwner",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaJobOwner -SqlInstance localhost\r\n\r\nSets SQL Agent Job owner to sa on all jobs where the owner does not match sa.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaJobOwner -SqlInstance localhost -Login DOMAIN\\account\r\n\r\nSets SQL Agent Job owner to sa on all jobs where the owner does not match \u0027DOMAIN\\account\u0027. Note\r\nthat Login must be a valid security principal that exists on the target server.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaJobOwner -SqlInstance localhost -Job job1, job2\r\n\r\nSets SQL Agent Job owner to \u0027sa\u0027 on the job1 and job2 jobs if their current owner does not match \u0027sa\u0027.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003e\u0027sqlserver\u0027,\u0027sql2016\u0027 | Set-DbaJobOwner\r\n\r\nSets SQL Agent Job owner to sa on all jobs where the owner does not match sa on both sqlserver and sql2016.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaMaxDop",
        "Description":  "Uses the Test-DbaMaxDop command to get the recommended value if -MaxDop parameter is not specified.\n\nThese are just general recommendations for SQL Server and are a good starting point for setting the \"max degree of parallelism\" option.\nYou can set MaxDop database scoped configurations if the server is version 2016.\n\nTHIS CODE IS PROVIDED \"AS IS\", WITH NO WARRANTIES.",
        "Author":  "Claudio Silva (@claudioessilva)",
        "Synopsis":  "Sets SQL Server max dop then displays information relating to SQL Server Max DOP configuration settings. Works on SQL Server 2005-2016.",
        "Name":  "Set-DbaMaxDop",
        "Links":  "https://dbatools.io/Set-DbaMaxDop",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaMaxDop -SqlInstance sql2008, sql2012\r\n\r\nSet recommended Max DOP setting for servers sql2008 and sql2012.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaMaxDop -SqlInstance sql2014 -MaxDop 4\r\n\r\nSet Max DOP setting to 4 for server sql2014.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eTest-DbaMaxDop -SqlInstance sql2008 | Set-DbaMaxDop\r\n\r\nGet Max DOP recommended setting from Test-DbaMaxDop and applies to sql2008 instance\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 4 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaMaxDop -SqlInstance sql2016 -Database db1\r\n\r\nSet recommended Max DOP setting database db1 on server sql2016.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 5 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaMaxDop -SqlInstance sql2016 -AllDatabases\r\n\r\nSet recommended Max DOP setting for all databases on server sql2016.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaMaxMemory",
        "Description":  "Sets SQL Server max memory then displays information relating to SQL Server Max Memory configuration settings. \n\nInspired by Jonathan Kehayias\u0027s post about SQL Server Max memory (http://bit.ly/sqlmemcalc), this uses a formula to \ndetermine the default optimum RAM to use, then sets the SQL max value to that number.\n\nJonathan notes that the formula used provides a *general recommendation* that doesn\u0027t account for everything that may \nbe going on in your specific environment.",
        "Synopsis":  "Sets SQL Server \u0027Max Server Memory\u0027 configuration setting to a new value then displays information this setting.",
        "Name":  "Set-DbaMaxMemory",
        "Links":  "https://dbatools.io/Set-DbaMaxMemory",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaMaxMemory sqlserver1\r\n\r\nSet max memory to the recommended MB on just one server named \"sqlserver1\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaMaxMemory -SqlInstance sqlserver1 -MaxMB 2048\r\n\r\nExplicitly max memory to 2048 MB on just one server, \"sqlserver1\"\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 3 --------------------------\r\n\r\nPS C:\\\u003eGet-DbaRegisteredServerName -SqlInstance sqlserver| Test-DbaMaxMemory | Where-Object { $_.SqlMaxMB -gt \r\n$_.TotalMB } | Set-DbaMaxMemory\r\n\r\nFind all servers in SQL Server Central Management server that have Max SQL memory set to higher than the total memory \r\nof the server (think 2147483647), then pipe those to Set-DbaMaxMemory and use the default recommendation.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaNetworkCertificate",
        "Description":  "Sets the network certificate for SQL Server instance. This setting is found in Configuration Manager.\n\nThis command also grants read permissions for the service account on the certificate\u0027s private key.\n\nReferences:\nhttp://sqlmag.com/sql-server/7-steps-ssl-encryption\nhttps://azurebi.jppp.org/2016/01/23/using-lets-encrypt-certificates-for-secure-sql-server-connections/\nhttps://blogs.msdn.microsoft.com/sqlserverfaq/2016/09/26/creating-and-registering-ssl-certificates/",
        "Tags":  "Certificate",
        "Synopsis":  "Sets the network certificate for SQL Server instance",
        "Name":  "Set-DbaNetworkCertificate",
        "Links":  null,
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eNew-DbaComputerCertificate | Set-DbaNetworkCertificate -SqlInstance localhost\\SQL2008R2SP2\r\n\r\nCreates and imports a new certificate signed by an Active Directory CA on localhost then sets the network certificate \r\nfor the SQL2008R2SP2 to that newly created certificate.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaNetworkCertificate -SqlInstance sql1\\SQL2008R2SP2 -Thumbprint 1223FB1ACBCA44D3EE9640F81B6BA14A92F3D6E2\r\n\r\nSets the network certificate for the SQL2008R2SP2 instance to the certificate with the thumbprint of \r\n1223FB1ACBCA44D3EE9640F81B6BA14A92F3D6E2 in LocalMachine\\My on sql1\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaPowerPlan",
        "Description":  "Sets the SQL Server OS\u0027s Power Plan. It defaults to High Performance which is Best Practice.\n\t\nIf your organization uses a custom power plan that is considered best practice, specify -CustomPowerPlan.\n\t\nReferences:\nhttps://support.microsoft.com/en-us/kb/2207548\nhttp://www.sqlskills.com/blogs/glenn/windows-power-plan-effects-on-newer-intel-processors/",
        "Synopsis":  "Sets the SQL Server OS\u0027s Power Plan.",
        "Name":  "Set-DbaPowerPlan",
        "Links":  "https://dbatools.io/Set-DbaPowerPlan",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaPowerPlan -ComputerName sqlserver2014a\r\n\r\nSets the Power Plan to High Performance. Skips it if its already set.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaPowerPlan -ComputerName sqlcluster -CustomPowerPlan \u0027Maximum Performance\u0027\r\n\r\nSets the Power Plan to the custom power plan called \"Maximum Performance\". Skips it if its already set.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
    },
    {
        "CommandName":  "Set-DbaPrivilege",
        "Description":  "Adds the SQL Service account to local privileges \u0027Lock Pages in Memory\u0027, \u0027Instant File Initialization\u0027, \u0027Logon as Batch\u0027 on one or more computers.\n\nRequires Local Admin rights on destination computer(s).",
        "Tags":  "Privilege",
        "Author":  "Klaas Vandenberghe ( @PowerDBAKlaas )",
        "Synopsis":  "Adds the SQL Service account to local privileges on one or more computers.",
        "Name":  "Set-DbaPrivilege",
        "Links":  "https://dbatools.io/Set-DbaPrivilege",
        "Examples":  "\r\n-------------------------- EXAMPLE 1 --------------------------\r\n\r\nPS C:\\\u003eSet-DbaPrivilege -ComputerName sqlserver2014a -Type LPIM,IFI\r\n\r\nAdds the SQL Service account(s) on computer sqlserver2014a to the local privileges \u0027SeManageVolumePrivilege\u0027 and \r\n\u0027SeLockMemoryPrivilege\u0027.\r\n\r\n\r\n\r\n\r\n-------------------------- EXAMPLE 2 --------------------------\r\n\r\nPS C:\\\u003e\u0027sql1\u0027,\u0027sql2\u0027,\u0027sql3\u0027 | Set-DbaPrivilege -Type IFI\r\n\r\nAdds the SQL Service account(s) on computers sql1, sql2 and sql3 to the local privilege \u0027SeManageVolumePrivilege\u0027.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"