# ==================================================================================================== # # NAME: AutostartSQLServerBrowser.ps1 # # AUTHOR: Yan Pan # DATE : 9/11/2007 # # COMMENT: This script changes the start mode of the SQL Server Browser Service to automatically start. # ===================================================================================================== # . for the local computer # If you want to connect to a remote machine, specify the machine name here. $strComputer = "." $sqlservice = Get-WmiObject ­computerName $strComputer ­namespace root\Microsoft\SqlServer\ComputerManagement -class SqlService ­filter "ServiceName='SQLBrowser'" $sqlservice.SetStartMode(2)