Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 76b42ef

Browse files
Update PS-SQLSEC-Report.ps1
1 parent b60768c commit 76b42ef

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎PS-SQLSEC-Report.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Created by EGGSTOASTBACON :: https://github.com/eggstoastbacon
2+
13
#SQL MANAGEMENT STUDIO SHOULD BE INSTALLED FROM WHERE YOU RUN THIS
24
#The server this is run from should have SQL Port and WMI access to the servers you intend to connect to.
35
#You will require file sqlserver.psd1, change the path to it below.
@@ -45,7 +47,6 @@ foreach ($IP in $IPs) {
4547
$sysinfo = Get-WmiObject -computer $IP -credential $wmiCredentials -Class Win32_ComputerSystem -ErrorAction SilentlyContinue
4648
$server = $sysinfo.Name
4749

48-
4950
$portCheck = Test-NetConnection -computername $IP -port $SQLPort
5051
if ($portCheck.tcpTestSucceeded -like "True") { $portPassed = "True" }else { write-host "Unable to Connect to $IP on $SQLPort" }
5152

@@ -115,12 +116,10 @@ foreach ($IP in $IPs) {
115116
$userrole = $userrole + "public"
116117
$userrole
117118

118-
119119
if ($login.name -notlike "*dbo*" -and $login.name -notlike "sys"`
120120
-and $login.name -notlike "guest" -and $login.name -notlike "*##*"`
121121
-and $login.name -notlike "*MS_*" -and $login.name -notlike "*_SCHEMA*") {
122122

123-
124123
#Create an object and write properties about the account
125124
$row = New-Object PSObject
126125
$row | Add-Member -MemberType NoteProperty -Name "Database" -Value "Server Login"
@@ -213,4 +212,4 @@ INSERT into $storeTable (IP,CNAME,DB,DOMAIN,LOGIN,CREATED,MODIFIED,LOGINTYPE,SER
213212

214213
}
215214
}
216-
215+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /