Upload New File
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
$ServerInstance = 'tot-2020-sql-acceptance.privatelink.03ddfc49f186.database.windows.net'
|
||||
|
||||
#$DBACredential = Get-Credential -UserName pgadmin -Message "Credentials for $RestoreServiceInstance"
|
||||
$password = ConvertTo-SecureString 'm#*7kx1K*N7b$IBU' -AsPlainText -Force
|
||||
$DBACredential = New-Object System.Management.Automation.PSCredential ("DbRefreshUser", $password)
|
||||
|
||||
$ParamInvokeSQLcmd = @{
|
||||
SqlInstance = $ServerInstance
|
||||
Verbose = $true
|
||||
ErrorAction = 'STOP'
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($DBACredential) {
|
||||
$ParamInvokeSqlcmd.SqlCredential = $DBACredential
|
||||
}
|
||||
#$query = "SELECT name FROM sys.databases order by name"
|
||||
$query = "SELECT TOP (1000) * FROM [a_rc_leu].[dbo].[tblSetting]"
|
||||
|
||||
|
||||
$SqlConn = Connect-DBAInstance -SQLInstance $ServerInstance -SQLCredential $DBACredential -TrustServerCertificate
|
||||
|
||||
|
||||
Write-Output "$Query"
|
||||
#write-warning "Continue ?" -WarningAction Inquire
|
||||
#invoke-dbaquery @ParamInvokeSQLcmd -Query $Query -Database Master -Debug
|
||||
|
||||
invoke-dbaquery $SqlConn -Query $Query -Database Master
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#########
|
||||
|
||||
|
||||
|
||||
$list_of_server_to_connect = [ordered]@{
|
||||
"Tot-SRVCTXDC01" = [PSCustomObject]@{
|
||||
"Name"="Tot-SRVCTXDC01.roser-total.local"
|
||||
"username"="roser-total\pgeeraert"
|
||||
"password"="Pr0m3th3us!!"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$command_to_type = hostname
|
||||
|
||||
$server = 'Tot-SRVCTXDC01'
|
||||
|
||||
|
||||
$pw = convertto-securestring -AsPlainText -Force -String "Pr0m3th3us!!"
|
||||
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "roser-total\pgeeraert",$pw
|
||||
$server_to_connect = $list_of_server_to_connect.$server.Name
|
||||
$session = New-PSSession -ComputerName $server_to_connect -Credential $cred
|
||||
Invoke-Command -Session $session -ScriptBlock { hostname }
|
||||
|
||||
Invoke-Command -ComputerName Tot-SRVCTXDC01.roser-total.local -ScriptBlock {
|
||||
hostname
|
||||
|
||||
#get-service *push*;
|
||||
}
|
||||
Get-ADUser 'pierretotal' -server Tot-SRVCTXDC01.roser-total.local
|
||||
|
||||
Reference in New Issue
Block a user