Skip to main content

Posts

Showing posts from January, 2010

SQL Saturday #32 Recap

SQL Saturday #32 was a great success this past weekend! Pam Shaw ( @pamshaw ) and Jorge Segarra( @SQLChicken ) did a great job organizing this event! Thanks to KForce for hosting the event and to all the sponsors for picking up the costs. If you missed this event, you also missed out on some of the best food ever at a SQL Saturday!  Spaghetti Warehouse in Ybor City did a great job with the speaker/volunteer dinner Friday night.  The day of the event all attendees got a taste of Ybor from “Latam at the Centro” for lunch.  BEST LUNCH I HAVE EVER HAD AT A SQL SATURDAY!  Hmmm. Best lunch I’ve had in a while. It was great to meet the following SQL Tweeps in person: @adam_jorgensen , Argenis Fernandez( @afernandez ), David Taylor(@ dyfhid ), @GarethSwan , Jason Strate( @StrateSQL ), Aaron Nelson( @SQLvariant ),and Jeff Truman( @jtruman0917 ). I hope I didn’t miss anybody. Great to see these tweeps again: @brianknight , @cmille19 , @GratefulDBA , @patrickdba , @unclebigguns , @le

List Windows Groups With Access to SQL Servers

A manager posed the question “Can we list all the Windows groups that have access to all of our database servers?”  The answer is “Yes.”  It is very easy to do with a short PowerShell script via SMO. The results are written to a CSV file. 1: ## List Windows Groups on a server ## 2: ## ./get-WinGrps.ps1 3: $start = get-date 4: write-host "Start: " $start 5:   6: [reflection.assembly]::LoadWithPartialName( "Microsoft.SqlServer.Smo" ) | out-null 7:   8: $FilePath = "C:\Output" 9: $OutFile = Join-Path -path $FilePath -childPath ( "WindowsGroupsOnServers_" + (get-date).toString( 'yyyyMMdd_hhmmtt' ) + ".csv" ) 10:   11: # Version inventory 12: @( foreach ($svr in get-content "C:\Input\TestServers.txt" ) 13: { 14: 15: $s = New-Object "Microsoft.SqlServer.Management.Smo.Server" $svr