You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.SYNOPSIS This function queries a CMS instance and returns a list of instances Written by Mark Wilkinson @m82labs on Twitter, website m82labs.com
3
+
4
+
.PARAMETERcmdHost
5
+
6
+
.PARAMETERsearchPattern !!NOT INJECTION SAFE!! this parameter simply gets inserted into a wildcard query on the list of available instances on the CMS. This parameter accepts a pipe delimeter list of patterns, allowing you to match instance names on multiple conditions.
7
+
8
+
.PARAMETERversion The SQL Server version (build number) that should be running on the returned instances. !! This will query each instance to get the build version, use in conjuction with searchPattern !!
9
+
10
+
.EXAMPLE This will return all instances that start with 'Pattern' and are on SQL 2016 RTM
The objective of the script is to make use of Input file in which it consists of list of database server instances as a source for various parts of the script.
4
+
5
+
.Description
6
+
This article is taking the sledge hammer approach and searching for mdf's and then comparing them against files which are available on the listed drive.
7
+
Function to log Output and display the details on the console.
8
+
9
+
.ParameterInputFile
10
+
Path to the file where the input details are saved.
11
+
Example: c:\InputServer.txt
12
+
13
+
.ParameterLogFile
14
+
The file logs all the information about the detached files or orphan file along with its size. This also contains the source of the server.
15
+
16
+
.Example
17
+
Write-Log -Message "$($Server) is reachable and starting the process " -Logfile $Logfile
Write-Log-Message "On $($instance) -> The filename $($mdf.FileName) in this path $($mdf.name) with a size of $($mdf.fileSizeMB) MB is left unattended "-Logfile $Logfile
0 commit comments