Added new scripts and changes
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter(Position=1, Mandatory=$true)]
|
||||
[string]
|
||||
$machineName
|
||||
)
|
||||
$query=@"
|
||||
|
||||
USE [ControlCenter]
|
||||
DECLARE @res VARCHAR(MAX)=''
|
||||
|
||||
SELECT @res = @res + ',"'+[s].[SE_DNS]+'"'
|
||||
SELECT [s].[SE_DNS]
|
||||
FROM [dbo].[Server] s
|
||||
JOIN [dbo].[Entity] e ON [e].[EN_id] = [s].[SE_entity]
|
||||
WHERE e.[EN_id] IN (
|
||||
@@ -19,10 +24,16 @@ AND (
|
||||
)
|
||||
ORDER BY s.[SE_entity], [s].[SE_OU_code];
|
||||
|
||||
SELECT STUFF(@res,1,1,'') as OU_list
|
||||
|
||||
"@
|
||||
|
||||
$machines = Invoke-Sqlcmd -ServerInstance HCIMON -Database ControlCenter -Query $query
|
||||
$machines = Invoke-Sqlcmd -ServerInstance HCIMON -Database ControlCenter -Query $query -TrustServerCertificate
|
||||
|
||||
$machines | Format-Table
|
||||
$machines | Select-Object -First 3 | ForEach-Object {
|
||||
$trg = $_
|
||||
|
||||
$files = Get-ChildItem -Path "\\$_\c$" -Filter "*vesta*"
|
||||
$files += Get-ChildItem -Path "\\$_\d$" -Filter "*vesta*"
|
||||
$files += Get-ChildItem -Path "\\$_\f$" -Filter "*vesta*"
|
||||
$files += Get-ChildItem -Path "\\$_\u$" -Filter "*vesta*"
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user