Advertisement
Guest User

Untitled

a guest
May 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $subinacl = "\\testing.com\deploy\Binaries\Pstools\subinacl.exe"
  2. $Services = Get-Service | Where-Object {$_.name -Like "win*"} | foreach { $_.name }
  3. ### SWITCH FOR NO PROD ACCESS
  4. $EnvironmentType = Get-EnvironmentType
  5. switch ($EnvironmentType.ToUpper()) {
  6. "PROD*" {
  7. Write-Warning "Sorry! Feauture Not Avaiable in Production Environment"
  8. }
  9. "default" {
  10. Write-Warning "Setting Access Rights On Services"
  11. ###Set Permissons on All win* Services
  12. foreach($Service in $Services) {
  13. $ServiceName = $Service
  14. Write-Host "Editing Service Permissons for DEV Acess SERVICE = $Service"
  15. $Parms = "/service $ServiceName /GRANT=silicon\developer=STOE"
  16. $Prms = $Parms.Split(" ")
  17. $Service | & $subinacl $Prms
  18. }
  19. ###Set Permissons for IIS Service
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement