Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $subinacl = "\\testing.com\deploy\Binaries\Pstools\subinacl.exe"
- $Services = Get-Service | Where-Object {$_.name -Like "win*"} | foreach { $_.name }
- ### SWITCH FOR NO PROD ACCESS
- $EnvironmentType = Get-EnvironmentType
- switch ($EnvironmentType.ToUpper()) {
- "PROD*" {
- Write-Warning "Sorry! Feauture Not Avaiable in Production Environment"
- }
- "default" {
- Write-Warning "Setting Access Rights On Services"
- ###Set Permissons on All win* Services
- foreach($Service in $Services) {
- $ServiceName = $Service
- Write-Host "Editing Service Permissons for DEV Acess SERVICE = $Service"
- $Parms = "/service $ServiceName /GRANT=silicon\developer=STOE"
- $Prms = $Parms.Split(" ")
- $Service | & $subinacl $Prms
- }
- ###Set Permissons for IIS Service
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement