Purpose: If you don't want to put a SQL db into single user mode, you can try the following to give yourself permission to a SQL instance.
The following will open a command prompt as the built in security principal "System" using PSExec.
psexec -i -s -d cmd
From there open SQL management studio from within that command prompt.
ie:
c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
I came up with this independently, but a simple google search will show you others have figured it out as well.
Should be able to now give yourself permissions to log on now depending on how the SQL was initially configured. If this doesn't work you will have to
Start the instance of SQL Server in single-user mode by using either the -m or -f options. Any member of the computer's local Administrators group can then connect to the instance of SQL Server as a member of the sysadmin fixed server role.
http://msdn.microsoft.com/en-us/library/dd207004.aspx
These are just random notes and programs that may have incomplete descriptions. Any scripts or programs use at your risk
Showing posts with label system. Show all posts
Showing posts with label system. Show all posts
Friday, November 21, 2014
Monday, November 14, 2011
Batch file to start performance counters on system startup
Requirements:
Create folder on the c: drive
c:\perflogs\
Download
7-Zip
http://www.7-zip.org/download.html
copy 7za.exe to c:\perflogs
open perfmon and create the counters you wish to use
Add each counter name you created to the batch code under
:logmans in this format logman start countername
Create a schedule task that will run the created batch file at system startup
On reboot all csv files will be added to a zip file called performance{date}.zip
Then performance counters will be started.
REM Tony Unger
REM 8/26/2011
REM Initial Release 1.0
REM This batch file that compress all file in the c:\perflog directory to
performance%date:~4,2%%date:~7,2%%date:~10,4%.zip then purges all the old entries
rem then it starts the performance log again
7za.exe a -tzip c:\perflogs\performance%date:~4,2%%date:~7,2%%date:~10,4%.zip c:\perflogs\*.csv
if exist c:\perflogs\performance%date:~4,2%%date:~7,2%%date:~10,4%.zip goto PurgeOldRecords
:Exit
exit
:PurgeOldRecords
del *.blg
del *.csv
goto logmans
:logmans
logman start DiskSpace
logman start Memory
logman start CPU
logman start SQLMemory
go to exit
Create folder on the c: drive
c:\perflogs\
Download
7-Zip
http://www.7-zip.org/download.html
copy 7za.exe to c:\perflogs
open perfmon and create the counters you wish to use
Add each counter name you created to the batch code under
:logmans in this format logman start countername
On reboot all csv files will be added to a zip file called performance{date}.zip
Then performance counters will be started.
REM Tony Unger
REM 8/26/2011
REM Initial Release 1.0
REM This batch file that compress all file in the c:\perflog directory to
performance%date:~4,2%%date:~7,2%%date:~10,4%.zip then purges all the old entries
rem then it starts the performance log again
7za.exe a -tzip c:\perflogs\performance%date:~4,2%%date:~7,2%%date:~10,4%.zip c:\perflogs\*.csv
if exist c:\perflogs\performance%date:~4,2%%date:~7,2%%date:~10,4%.zip goto PurgeOldRecords
:Exit
exit
:PurgeOldRecords
del *.blg
del *.csv
goto logmans
:logmans
logman start DiskSpace
logman start Memory
logman start CPU
logman start SQLMemory
go to exit
Subscribe to:
Posts (Atom)
Powershell: Microsoft Graph to add new roles to application registration
PowerShell Script Bulk add new roles to application registration in azure. Update $roles with ,Us...
-
Here is an excel document I created that will ping a list of nodes in column A and give results in column B. There are much better tools th...
-
#reads event logs for filter and exports to $Date = ( Get-Date ).AddMinutes(-30) $LogName = 'Security' $ProviderName = ...
-
Using Google Chrome or MS Edge: Disable Javascript post page load. 1. Open console in dev tools 2. press ctrl - alt - p 3. In the run dial...