added pre and post checks for installations

This commit is contained in:
hhofs
2018-05-16 14:56:12 +02:00
parent 6f185b558a
commit 387682e809
15 changed files with 336 additions and 80 deletions

View File

@@ -1,7 +1,10 @@
# Purpose: Configure an SMB share for Powershell transcription logs to be written to
# Source: https://blogs.msdn.microsoft.com/powershell/2015/06/09/powershell-the-blue-team/
Write-Host "Configuring the Powershell Transcripts Share"
md c:\pslogs
If (-not (Test-Path c:\pslogs))
{
md c:\pslogs
}
## Kill all inherited permissions
@@ -39,4 +42,7 @@ $acl | Set-Acl c:\pslogs\
## Create the SMB Share, granting Everyone the right to read and write files. Specific
## actions will actually be enforced by the ACL on the file folder.
New-SmbShare -Name pslogs -Path c:\pslogs -ChangeAccess Everyone
if ((Get-SmbShare -Name pslogs -ea silent) -eq $null)
{
New-SmbShare -Name pslogs -Path c:\pslogs -ChangeAccess Everyone
}