Created
April 17, 2014 09:56
Revisions
-
xoner created this gist
Apr 17, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ $javaDeployment = '' $profilesDir = '' ## We are runnig Windows Vista, 7, 8 , Server 2008, 2008 R2, 2012 or highter if ([System.Environment]::OSVersion.Version.Major -ge 6) { Write-Host -ForegroundColor Green "OS Windows Vista, 7, 2008, 2008R2 or highter" $javaDeployment = 'AppData\LocalLow\Sun\Java\Deployment' $profilesDir = 'C:\Users' } # We are running Windows XP or server 2003 (spanish localized) elseif ([System.Environment]::OSVersion.Version.Major -eq 5) { Write-Host -ForegroundColor Green "OS Windows XP or 2003" $javaDeployment = 'Datos de Programa\Sun\Java\Deployment' $profilesDir = 'C:\Documents and Settings' } else { Write-Host -ForegroundColor Red "OS not supported" exit } $templFolder = [System.IO.Path]::Combine($env:USERPROFILE, $javaDeployment) foreach($item in (ls $profilesDir)) { if($item.PSIsContainer) { $userDestDir = [System.IO.Path]::Combine($item.FullName, $javaDeployment); #echo $userDestDir; if ((Test-Path "$userDestDir") -and ($item.FullName -ne $env:USERPROFILE)) { echo "$($item.FullName) has sun deployment"; $configPathTmpl = $templFolder + '\deployment.properties' $urlExceptionPathTmpl = $templFolder + '\security\exception.sites'; cp -Force $configPathTmpl $userDestDir cp -Force $urlExceptionPathTmpl $($userDestDir + '\security') echo "" echo "" } } }