Users Online
· Guests Online: 24
· Members Online: 0
· Total Members: 188
· Newest Member: meenachowdary055
· Members Online: 0
· Total Members: 188
· Newest Member: meenachowdary055
Forum Threads
Newest Threads
No Threads created
Hottest Threads
No Threads created
Latest Articles
Articles Hierarchy
Software Installation on Multiple Servers
Software Installation on Multiple Servers
$servers = gc C:\provide path $source = "\\source_server\Treesize" ### share the folder in which the installation file is present ## $tempath ="\\source_server\Treesize" $destination = "c$" foreach ($server in $servers) { $session = New-PSSession -ComputerName $server if(test-connection -Cn $server -quiet){ Copy-Item $source -Destination \\$server\$destination -Recurse -Force if(Test-Path -path $tempath){ Invoke-command -session $session -ScriptBlock {C:\treesize\TreeSizeFreeSetup.exe /uninst /silent /restart} Write-Host -ForeGroundColor Green "Installation successful on $server" } } else { Write-Host -ForeGroundColor red "Installation failed on $server" } }
Comments
No Comments have been Posted.
Post Comment
Please Login to Post a Comment.