SQL Server Single User Mode


how can use powershell change database mode single, multi

 

i know t-sql way ... wanted learn power shell way

im working on function, want

$server= sqlserver:\sql\<server>\<instance>
$db = $server.databases("<dbname>")
$db.useraccess = "single"
$server.killallprocesses("<dbname>")
$db.alter()



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607