PowerShell Help
Enabling PSRemoting :- Enable-PSRemoting -SkipNetworkProfileCheck get-netconnectionprofile Set-NetConnectionProfile -InterfaceAlias Wi-Fi -NetworkCategory Private WinRM quickconfig Method 2: Successful 1. Enable-PSRemoting -Force 2. Set-Item wsman:\localhost\client\trustedhosts * 3. Restart-Service WinRM 4. Test-WsMan COMPUTER (servername) 5. Enter-PSSession -ComputerName servername -Credential kkolguri 6. once you connect to the remote session - type sqlps and start working on the powershell Enter-PSSession -ComputerName zeun76sqpstg01 -Credential kkolguri Setting up Mirror Using PowerShell: #Check to make sure database is in full recovery mode #Creates a new backup of data file and log on primary, then secondary restores from that location $dbnames = Invoke-Sqlcmd -Query "select name from sys.databases where database_id in (9,10,12)" | Select-Object -ExpandProperty name #| Out-File F:\dbnames.txt $dbnames= ...